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.
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