-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Force DRM license request #6337
Comments
There are some ways to avoid this problem from occurring I think:
|
Can't you generate the token at the moment MediaDrmCallback.executeKeyRequest is invoked? Retrial of licence requests is being tracked by #6334. |
As far as I've understood, the
Lazy preparation seems for me to work similarly. Maybe you can clarify the difference between using a
I can(this was what I tried to say in the third alternative solution), but this token is tied to the asset url, so it is fetched from backend(not generated on the client side) together with that. Fetching it again would be bad for obvious reasons(same call twice in a row even if it has not expired).
This would only retry or not retry the same request, as it would just call |
I don't really see the issue. Let's imagine you have a component with its own handler thread which is the TokenManager. Your media drm callback requests the token from the TokenManager each time it needs it. If the TokenManager doesn't have a token or is renewing a token at the moment, the token request blocks the MediaDrmCallback from making the license request. If the license request returns 4xx, then it notifies the TokenManager that it should invalidate the existing token. A later retry may be blocked until the TokenManager has a new token. You can then preemptively renew a token if you suspect it wont be valid in a shortly required license request. I think it's better for you to know (and act upon) the error as soon as it happens, instead of waiting until the retry call (that includes the error history) is made. Please clarify why an approach similar to the suggest above wouldn't work. |
Hey @kgrevehagen. We need more information to resolve this issue but there hasn't been an update in 14 days. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically. If you have more information that will help us get to the bottom of this, just add a comment! |
If #4133 does what I think it does, this will no longer be an issue. Can you verify(and is it guaranteed) that Again, this is only an issue when it prepares the next track while current is playing. |
No, this is not correct, and I doubt this can be guaranteed in general. I don't think you should count on this happening. The reason is that the key acquisition information may be obtained when buffering starts, which does not necessarily happen close to mediaSource.prepare() (for example in the case of a concatenating media source, where the buffering position is before the item). We will be working on prefetching keys soon: Please track #4133 for key pre-fetching. This doesn't mean we will be doing it during preparation, though, just whenever we load the key acquisition information (for example, the pssh box). If you really need to load the keys during preparation, you will have to adapt your app to whatever media type you are using. Preparation works differently in DASH and HLS. And if you are playing DASH, the key acquisition information may be obtained from the manifest or the chunks, and you'll have to act accordingly. Is the original question answered? |
Closing due to inactivity. |
Use case description
In order to fetch a DRM license from our license server, I need to supply a short-lived security token.
When playing in a
ConcatenatingMediaSource
, the security token(which is retrieved along with other playback data when preparing aMediaSource
) might have expired at the time theDefaultDrmSession
tries to get the license key. In case of a 4xx error on the license key call, I need to refetch the security token and then retry the license key request.Proposed solution
onDrmSessionManagerError
I can fetch a new security token and then force a new key request. The latter is afaik not possible, but would be helpful. The reason I want to do it inonDrmSessionManagerError
is because it's most likely still in the clear lead and the music still plays.Alternatives considered
onPlayerError
, but then I get a pause in playback, which is not good.MediaDrmCallback
and do the retry there myself, but that feels kinda backwards.The text was updated successfully, but these errors were encountered: