diff --git a/RELEASENOTES.md b/RELEASENOTES.md index e2aba8d0ac..86cc960862 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -128,10 +128,14 @@ ([#7134](https://github.com/google/ExoPlayer/issues/7134)). * Fix failure to play WAV files that contain trailing non-media bytes ([#7129](https://github.com/google/ExoPlayer/issues/7129)) +* DRM: + * Fix playback of Widevine protected content that only provides V1 PSSH atoms + on API levels 21 and 22. + * Fix playback of PlayReady content on Fire TV Stick (Gen 2). * DASH: - * Update the manifest URI to avoid repeated HTTP redirects - ([#6907](https://github.com/google/ExoPlayer/issues/6907)). - * Parse period `AssetIdentifier` elements. + * Update the manifest URI to avoid repeated HTTP redirects + ([#6907](https://github.com/google/ExoPlayer/issues/6907)). + * Parse period `AssetIdentifier` elements. * UI: Add an option to set whether to use the orientation sensor for rotation in spherical playbacks ([#6761](https://github.com/google/ExoPlayer/issues/6761)). diff --git a/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java b/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java index d037264d68..2227738ed5 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/drm/FrameworkMediaDrm.java @@ -369,14 +369,20 @@ public final class FrameworkMediaDrm implements ExoMediaDrm { C.PLAYREADY_UUID, addLaUrlAttributeIfMissing(schemeSpecificData)); } - // Prior to L the Widevine CDM required data to be extracted from the PSSH atom. Some Amazon - // devices also required data to be extracted from the PSSH atom for PlayReady. - if ((Util.SDK_INT < 21 && C.WIDEVINE_UUID.equals(uuid)) + // Prior to API level 21, the Widevine CDM required scheme specific data to be extracted from + // the PSSH atom. We also extract the data on API levels 21 and 22 because these API levels + // don't handle V1 PSSH atoms, but do handle scheme specific data regardless of whether it's + // extracted from a V0 or a V1 PSSH atom. Hence extracting the data allows us to support content + // that only provides V1 PSSH atoms. API levels 23 and above understand V0 and V1 PSSH atoms, + // and so we do not extract the data. + // Some Amazon devices also require data to be extracted from the PSSH atom for PlayReady. + if ((Util.SDK_INT < 23 && C.WIDEVINE_UUID.equals(uuid)) || (C.PLAYREADY_UUID.equals(uuid) && "Amazon".equals(Util.MANUFACTURER) && ("AFTB".equals(Util.MODEL) // Fire TV Gen 1 || "AFTS".equals(Util.MODEL) // Fire TV Gen 2 - || "AFTM".equals(Util.MODEL)))) { // Fire TV Stick Gen 1 + || "AFTM".equals(Util.MODEL) // Fire TV Stick Gen 1 + || "AFTT".equals(Util.MODEL)))) { // Fire TV Stick Gen 2 byte[] psshData = PsshAtomUtil.parseSchemeSpecificData(initData, uuid); if (psshData != null) { // Extraction succeeded, so return the extracted data.