Baseflow / Baseflow/XamarinMediaManager

RequestHeaders not passed through to ExoPlayer

Open
#701 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
763
Forks
299
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

Start at the CrossMediaManager.Current.RequestHeaders and Play entry points, then trace the Android ExoPlayerLib request path described in the Fiddler output. Compare the first authorized request with the second request and verify that the Authorization header is retained for ExoPlayer's request; done means both requests carry the required header.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.