audioplayers icon indicating copy to clipboard operation
audioplayers copied to clipboard

Add Support for header tokens

Open pepie opened this issue 5 years ago • 21 comments

pepie avatar Mar 23 '19 12:03 pepie

It would be nice to be able to pass an auth token, for secured remote content. is this possible?

pepie avatar Mar 23 '19 12:03 pepie

I am not sure, would to do some research. I wonder if this is something achieved on the native platform

erickzanardo avatar Mar 26 '19 11:03 erickzanardo

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

zencubic avatar Jul 28 '19 18:07 zencubic

Maybe this is helpful for iOS: https://stackoverflow.com/questions/15456130/add-custom-header-field-in-request-of-avplayer

zencubic avatar Jul 28 '19 18:07 zencubic

I need this feature too!

s98113161 avatar Oct 30 '19 09:10 s98113161

I've implemented the Android side - anyone have experience with Objective C willing to do the iOS side for this?

MasjZam avatar Feb 14 '20 02:02 MasjZam

Somebody has some news for this? I would need it too.

mihael998 avatar Mar 20 '20 10:03 mihael998

Please add this feature!

alectogeek avatar Apr 25 '20 18:04 alectogeek

I need this feature too!

qianciling avatar Dec 09 '20 08:12 qianciling

+1

WinXaito avatar Jun 07 '21 21:06 WinXaito

HTTPS headers for web please :D

BartusZak avatar Jul 17 '21 16:07 BartusZak

any updates on HTTPS headers for web?

AhemadAbbasVagh avatar Sep 20 '21 09:09 AhemadAbbasVagh

Pl add this feature!

keyur005 avatar Jul 04 '22 10:07 keyur005

Please add this feature.

raheemuddin786 avatar Aug 11 '22 14:08 raheemuddin786

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

synchronisator avatar Dec 01 '22 10:12 synchronisator

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.

Gustl22 avatar Jan 11 '23 10:01 Gustl22

any update ?

cnkygmr avatar Oct 04 '23 12:10 cnkygmr

+1 Any update ?

maximeburri avatar Dec 26 '23 14:12 maximeburri

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.

1250422131 avatar Jan 19 '24 09:01 1250422131

+1

jvaleski avatar Mar 25 '24 14:03 jvaleski

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.

jvaleski avatar Mar 26 '24 00:03 jvaleski