androidx / androidx/media

Key Rotation Support for Offline Downloader

Open
#2,021 6 comments 0 reactions 1 assignee View on GitHub

@icbaker is already working on this.

Since Jan 10, 2025.

question
Dominant language
Java
Stars
3k
Forks
955
Avg merge
12d 14h
Merged PRs (30d)
2

Description

We are working with ExoPlayer Downloader (com.google.android.exoplayer2) and want to test with a manifest having multiple keys i.e. the content is having key rotation.

After reading from different forums, we added "setMultiSession(true)" during creation of "OfflineLicenseHelper" used for download.

We tried
val offlineLicenseHelper = OfflineLicenseHelper( DefaultDrmSessionManager.Builder() .setKeyRequestParameters(drmConfiguration.requestHeaders) .setMultiSession(true) .build(httpMediaDrmCallback), DrmSessionEventListener.EventDispatcher() )

Also during creation of MediaItem, we have used "mediaItemBuilder.setDrmMultiSession(true)"

Result :
I am not sure if multiple keys are getting downloaded or not.
Because when I try to play the downloaded content, it plays till the duration of 1st key. When it encounters segments from 2nd key we get "Caused by: android.media.MediaCodec$CryptoException: Crypto key not available" error.

Please help.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.