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 seek backward inside a stream where DRM key rotation is in place. #8034

Closed
tibor-leo-safar-accedo opened this issue Oct 2, 2020 · 3 comments
Assignees
Labels

Comments

@tibor-leo-safar-accedo
Copy link

[REQUIRED] Searched documentation and issues

Have digging all across the internet for such issue but not much related discussions discovered so far.

[REQUIRED] Question

Hi,
The scenario of the issue is the following. We are using ExoPlayer version 2.10.8
It is given a Live DASH stream with DRM key rotation, there is a new DRM key in every 5 minute.
We do use the OfflineLicenseHelper class for DRM key acquisition, storing the key Id's in order to reuse them between playback sessions.
Playing back the head of the stream is OK, we can detect, acquire new license and the playback continues with minimal UI glitches.
The window of the live stream is quite big, 4 hours, in order to provide some extra features for our users like instant restart of a program (what can fit into te live window).
The issue comes when we try to seek back in the stream behind any of DRM key rotation events.
An example

  • we are now at 12:08 trying to instant restart a program.
  • the program we want to seek back have started at 12:00
  • at 12:05 there was a DRM key rotation.
  • when seeking back inside the stream to 12:00, playback fails with MediaCodec$CryptoException: Crypto key not available
  • requesting a new DRM key using the OfflineLicenseHelper will provide a valid key, but for the head, and playback will be still impossible because of the key mismatch.

We have tried this without using OfflineLicenseHelper, letting ExoPlayer to handle everything, of course with the same result.

Question:

  • Is it possible (if yes how?) to acquire a valid DRM key for a position back in time, where the DRM key was different then the one used for the Live edge (head) of the stream?

A full bug report captured from the device

No bug report, the description should be enough. If not, let me know what exactly to collect.

Link to test content

Issue #4133 and #3561 seems to be related somehow.
Unfortunately there is no publicly available test content.
I think the issue can be reproduced with any of the streams with DRM key rotation when seeking back in stream to any moent before a DRM key change event. (not aware of any such publicly available stream)

Would really appreciate for some help on this topic.

@AquilesCanta
Copy link
Contributor

Is it possible (if yes how?) to acquire a valid DRM key for a position back in time, where the DRM key was different then the one used for the Live edge (head) of the stream?

Yes. ExoPlayer should do that for you without any special handling. The only thing you should make sure is that you are using multiSession.

I think the issue can be reproduced with any of the streams with DRM key rotation when seeking back in stream to any moent before a DRM key change event. (not aware of any such publicly available stream)

I have tested this with internal test streams and it works well.

I think the only way we can assist here is that you provide repro steps in the demo app. This will require you to send us a sample stream, as explained in the issue template.

@tibor-leo-safar-accedo
Copy link
Author

tibor-leo-safar-accedo commented Oct 12, 2020 via email

@ojw28
Copy link
Contributor

ojw28 commented Sep 7, 2021

OfflineLicenseHelper is really intended for VOD download use cases. Trying to use it for streaming with key rotation is not something we support. It sounds like a very fragile approach.

Note that, depending on how much key reuse you need, you may find DefaultDrmSessionManager.Builder.setSessionKeepaliveMs useful.

@ojw28 ojw28 closed this as completed Sep 7, 2021
@ojw28 ojw28 removed the needs triage label Sep 7, 2021
@google google locked and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants