Baseflow / XamarinMediaManager

Cross platform Xamarin plugin to play and control Audio and Video
https://baseflow.com
MIT License
767 stars 305 forks source link

RequestHeaders not passed through to ExoPlayer #701

Open simonc9999 opened 4 years ago

simonc9999 commented 4 years ago

I'm setting the authorization header with the following code and then attemping to play the audio file.

CrossMediaManager.Current.RequestHeaders["Authorization"] = $"Bearer {authToken}"; await CrossMediaManager.Current.Play(fileUrl);

When I examine the HTTP traffic in Fiddler, there are two requests issued. The first request has the correct authorization header but the second request issued by ExoPlayerLib doesn't. This means the second request fails because the request is unauthorized. See below for Fiddler HTTP raw data.

GET http://localdev:4501/Audio/GetAudio?ContentType=R&ContentID=2210514 HTTP/1.1 Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkZCMDEwMEM5MDI4MUVGRkFENjUxRDQ0RkYwRDREMDE2OTBCQUNDMjkiLCJ0eXAiOiJKV1QiLCJ4NXQiOiItd User-Agent: stagefright/1.2 (Linux;Android 8.1.0) Host: localdev:4501 Connection: Keep-Alive Accept-Encoding: gzip

GET http://localdev:4501/Audio/GetAudio?ContentType=R&ContentID=2210514 HTTP/1.1 User-Agent: Test.Mobile.Phone.Android/1.8 (Linux;Android 8.1.0) ExoPlayerLib/2.9.6 Accept-Encoding: identity Host: localdev:4501 Connection: Keep-Alive

richp582 commented 4 years ago

Yep, I reported this a while back and eventual just switched to something else.

See here: https://github.com/Baseflow/XamarinMediaManager/issues/608