Skip to content

Commit

Permalink
Merge widevine playback tests to v2.
Browse files Browse the repository at this point in the history
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127825954
  • Loading branch information
gauravmishra authored and ojw28 committed Jul 28, 2016
1 parent 9c6382c commit 5200c7d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -719,17 +719,18 @@ public TrackRenderer[] buildRenderers(HostActivity host, ExoPlayer player, Surfa
if (isWidevineEncrypted) {
try {
// Force L3 if secure decoder is not available.
boolean useL3Widevine = MediaCodecUtil.getDecoderInfo(videoMimeType, true) == null;
String widevineContentId = getWidevineContentId(useL3Widevine);
boolean forceL3Widevine = MediaCodecUtil.getDecoderInfo(videoMimeType, true) == null;
String widevineContentId = getWidevineContentId(forceL3Widevine);
WidevineMediaDrmCallback drmCallback =
new WidevineMediaDrmCallback(widevineContentId, WIDEVINE_PROVIDER);
drmSessionManager = StreamingDrmSessionManager.newWidevineInstance(
player.getPlaybackLooper(), drmCallback, null, handler, null);
String securityProperty = drmSessionManager.getPropertyString(SECURITY_LEVEL_PROPERTY);
if (useL3Widevine && !WIDEVINE_SECURITY_LEVEL_3.equals(securityProperty)) {
if (forceL3Widevine && !WIDEVINE_SECURITY_LEVEL_3.equals(securityProperty)) {
drmSessionManager.setPropertyString(SECURITY_LEVEL_PROPERTY, WIDEVINE_SECURITY_LEVEL_3);
}
needsSecureVideoDecoder = !useL3Widevine;
securityProperty = drmSessionManager.getPropertyString(SECURITY_LEVEL_PROPERTY);
needsSecureVideoDecoder = WIDEVINE_SECURITY_LEVEL_1.equals(securityProperty);
} catch (IOException | UnsupportedDrmException e) {
throw new IllegalStateException(e);
}
Expand Down

0 comments on commit 5200c7d

Please sign in to comment.