Don't request session sharing on CDMs that don't support it

Issue: #4834

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=214258163
This commit is contained in:
olly 2018-09-24 06:34:12 -07:00 committed by Oliver Woodman
parent 34c37596dd
commit c934ce744d
2 changed files with 8 additions and 1 deletions

View File

@ -145,6 +145,9 @@
looping ([#3829](https://github.com/google/ExoPlayer/issues/3829)). looping ([#3829](https://github.com/google/ExoPlayer/issues/3829)).
* Fix issue where `player.getCurrentTag()` throws an `IndexOutOfBoundsException` * Fix issue where `player.getCurrentTag()` throws an `IndexOutOfBoundsException`
([#4822](https://github.com/google/ExoPlayer/issues/4822)). ([#4822](https://github.com/google/ExoPlayer/issues/4822)).
* Fix bug preventing use of multiple key session support (`multiSession=true`)
for non-Widevine `DefaultDrmSessionManager` instances
([#4834](https://github.com/google/ExoPlayer/issues/4834)).
* IMA extension: * IMA extension:
* Refine the previous fix for empty ad groups to avoid discarding ad breaks * Refine the previous fix for empty ad groups to avoid discarding ad breaks
unnecessarily ([#4030](https://github.com/google/ExoPlayer/issues/4030) and unnecessarily ([#4030](https://github.com/google/ExoPlayer/issues/4030) and

View File

@ -367,7 +367,11 @@ public class DefaultDrmSessionManager<T extends ExoMediaCrypto> implements DrmSe
mode = MODE_PLAYBACK; mode = MODE_PLAYBACK;
sessions = new ArrayList<>(); sessions = new ArrayList<>();
provisioningSessions = new ArrayList<>(); provisioningSessions = new ArrayList<>();
if (multiSession) { if (multiSession && C.WIDEVINE_UUID.equals(uuid) && Util.SDK_INT >= 19) {
// TODO: Enabling session sharing probably doesn't do anything useful here. It would only be
// useful if DefaultDrmSession instances were aware of one another's state, which is not
// implemented. Or if custom renderers are being used that allow playback to proceed before
// keys, which seems unlikely to be true in practice.
mediaDrm.setPropertyString("sessionSharing", "enable"); mediaDrm.setPropertyString("sessionSharing", "enable");
} }
mediaDrm.setOnEventListener(new MediaDrmEventListener()); mediaDrm.setOnEventListener(new MediaDrmEventListener());