bluefireteam / audioplayers

A Flutter package to play multiple audio files simultaneously (Android/iOS/web/Linux/Windows/macOS)
https://pub.dartlang.org/packages/audioplayers
MIT License
2.01k stars 845 forks source link

[WEB] Add Support for set crossOrigin #1804

Open talski opened 5 months ago

talski commented 5 months ago

Checklist

Use case / Problem

When building to web, I have to hardcode p.crossOrigin = 'use-credentials'; in the file wrapped_player.dart in the audioplayers_web lib to my cookie credentials to work, it's something like withCredentials in http request libs

Proposal / Solution

It would be nice to have an option in UrlSource or AudioPlayer class to change this value on the go

Example Code

Example Code ```dart final source = UrlSource('https://api.crossdomain.com/restricted/audio_file.mp3'); // defaults to 'anonymous' // or final source = UrlSource('https://api.crossdomain.com/restricted/audio_file.mp3', crossOrigin: 'use-credentials'); ```

Affected platforms

web

Platform details

No response

Audio Files/URLs/Sources

No response

Mockups

No response

Related issues / more information

129, #1479

Working on PR

no way