forked from androidx/media
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for multiple offline DRM keys (#28)
We need to support multiple DRM keys for different time periods on offline playbacks. This wasn't supported by ExoPlayer. This PR adds support for multiple keys. - Added a new setMode function in DefaultDrmSessionManager to be able to pass the needed data (lists of drmKeys and list of hash codes to find the right key for a given format) - Replaced the single keySetId in DefaultDrmSessionManager by the above 2 lists - When we acquire a session with a new format, use the hash codes list to find the index of the right key to use, instead of using the single offline key. Notes: - I had to add a field in DefaultDrmSession to be able to reuse the session. The existing schemeDatas is used in multiple ways, so changing it to keep the scheme datas even for offline playback would have required more changes (we try to limit the scope of changes to facilitate merges) - I initially also made the similar changes in MediaItem (which is given the offline key). But after investigation, turns out this code path is useless for us, we override or handle ourselves all the related object creation. So for the same reason as the previous point, I decided to revert those changes.
- Loading branch information
1 parent
a7c7de2
commit d88b7ec
Showing
4 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters