audioplayers
audioplayers copied to clipboard
Add Support for header tokens
It would be nice to be able to pass an auth token, for secured remote content. is this possible?
I am not sure, would to do some research. I wonder if this is something achieved on the native platform
Would like to have this feature too! @erickzanardo On android ist not too complicated (https://stackoverflow.com/a/29128037, https://developer.android.com/reference/android/media/MediaPlayer.html#setDataSource(android.content.Context,%2520android.net.Uri,%2520java.util.Map%3Cjava.lang.String,%2520java.lang.String%3E)) but I don't know about iOS. It would probably be best if you pass your own HTTP-Header in dart code
Maybe this is helpful for iOS: https://stackoverflow.com/questions/15456130/add-custom-header-field-in-request-of-avplayer
I need this feature too!
I've implemented the Android side - anyone have experience with Objective C willing to do the iOS side for this?
Somebody has some news for this? I would need it too.
Please add this feature!
I need this feature too!
+1
HTTPS headers for web please :D
any updates on HTTPS headers for web?
Pl add this feature!
Please add this feature.
I try to play a file from a Nextcloud. To do this, i need to add a Basic Authentication Header. This is not possible at the moment. Because in web it is not possible to save the file to disk and play it from there, and playing UInt8List is also not implemented, it is at this moment not possible to play a file from nextcloud in web.
Please add this feature. Thanks
Proposal: implement #374 by downloading the file beforehand and then can use header tokens to get the file, so we don't rely on the platform implementation.
any update ?
+1 Any update ?
Proposal: implement #374 by downloading the file beforehand and then can use header tokens to get the file, so we don't rely on the platform implementation.
Downloading files in advance is reasonable and effective, but we need to be aware of one issue: most of the time, we prefer online audio to be cached in segments rather than caching the entire file before playback. This allows us to save some data usage and enables faster playback of online music.
+1
audioplayers uses AVPlayerItem under the hood for iOS, and Apple has gone way out of their way to prevent arbitrary (auth for example) header additions to the AVURLAsset's that AVPlayerItem uses. as best I can tell, you'd have to subclass AVURLAsset, creating your own custom URL scheme, and implement your own delegation of the resource loading to manage all the network interactions yourself.
feeling like all roads lead to accessing remote URLs that require custom headers via an HTTP lib, saving data locally, then having audioplayers play the local file. the alternative is a pretty big overhaul of how audioplayers currently implements UrlSource in order to get custom headers in there.