XamarinMediaManager icon indicating copy to clipboard operation
XamarinMediaManager copied to clipboard

RequestHeaders not passed through to ExoPlayer

Open simonc9999 opened this issue 5 years ago • 1 comments

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

simonc9999 avatar Apr 17 '20 03:04 simonc9999

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

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

richp582 avatar May 19 '20 17:05 richp582