Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get response header from Lincence url request? #5740

Closed
karathb opened this issue Apr 8, 2019 · 9 comments
Closed

How to get response header from Lincence url request? #5740

karathb opened this issue Apr 8, 2019 · 9 comments

Comments

@karathb
Copy link

karathb commented Apr 8, 2019

Hi all!

I know that the response headers of the last load are available through the onLoadStarted() callback (as part of LoadEventInfo).

However I would need to parse the headers of the licence url request and as I see that is not passed there. Am I missing something? Should I somehow be able to read the response headers of the licence url request?

Thanks in advance,
Balázs

@erdemguven
Copy link
Contributor

Response headers on onLoadStarted() callback are always empty perhaps you can use onLoadCompleted().

@karathb
Copy link
Author

karathb commented Apr 8, 2019

Okay, I will test tomorrow and let you know. Though so far I did not even see loadEventInfo.uri == licenseUrl in the onLoadStarted event. Should that also come there? (with the License url)

@karathb
Copy link
Author

karathb commented Apr 9, 2019

Yeah, I am able to see the response headers of the playback urls. For each chunk it is there in onLoadCompleted(). But the issue still exists regarding the license request. For that the response header is not exposed in those callbacks.

Is there any way of grabbing the reponse header of the licence request?

@AquilesCanta
Copy link
Contributor

Assuming you are using DefaultDrmSessionManager, all license requests are done through MediaDrmCallback so you can look into it to intercept the response headers.

When you create an HttpMediaDrmCallback to pass to the DefaultDrmSessionManager, you can either pass a custom HttpDataSource.Factory or use instead a custom MediaDrmCallback that obtains the response headers through DataSource#getResponseHeaders. Hope this helps.

@karathb
Copy link
Author

karathb commented Apr 10, 2019

Okay, so when the player does the license request, it should go through either of the two methods of MediaDrmCallback interface, right? Trying to add a custom callback to intercept the response headers.

@tonihei
Copy link
Collaborator

tonihei commented Apr 10, 2019

In the long term, we should ensure these load events are reported through the normal MediaSourceEventListener callbacks if possible. We can use this issue for tracking. Note that this needs some further internal refactoring such that the license load events can be associated to a MediaSource or MediaPeriod.

@karathb
Copy link
Author

karathb commented Apr 11, 2019

Side note: for now using a custom MediaDrmCallback seems to be the easiest solution, and works perfectly fine. Thanks for all the help so far, and waiting for the deeper integration :)

@erdemguven erdemguven removed their assignment Apr 15, 2019
@ojw28
Copy link
Contributor

ojw28 commented May 6, 2019

I think this is probably a duplicate of #5399. @tonihei - Can we duplicate one to the other, and edit the title of the one that we keep to accurately reflect the request? Thanks!

@tonihei
Copy link
Collaborator

tonihei commented May 7, 2019

Yes, sounds like a duplicate. Using the other one for tracking and closing this one.

@tonihei tonihei closed this as completed May 7, 2019
@google google locked and limited conversation to collaborators Sep 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants