mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Demo app: Fix DRM support check for ClearKey
Issue: Issue: #7735 PiperOrigin-RevId: 325900705
This commit is contained in:
parent
4faee07d57
commit
bcc4f797b2
3 changed files with 13 additions and 2 deletions
|
|
@ -23,6 +23,8 @@
|
|||
* IMA extension: Upgrade to IMA SDK 3.19.4, bringing in a fix for setting the
|
||||
media load timeout
|
||||
([#7170](https://github.com/google/ExoPlayer/issues/7170)).
|
||||
* Demo app: Fix playback of ClearKey protected content on API level 26 and
|
||||
earlier ([#7735](https://github.com/google/ExoPlayer/issues/7735)).
|
||||
|
||||
### 2.11.7 (2020-06-29) ###
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ package com.google.android.exoplayer2.demo;
|
|||
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.media.MediaDrm;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.util.Pair;
|
||||
|
|
@ -47,6 +46,7 @@ import com.google.android.exoplayer2.drm.ExoMediaCrypto;
|
|||
import com.google.android.exoplayer2.drm.FrameworkMediaDrm;
|
||||
import com.google.android.exoplayer2.drm.HttpMediaDrmCallback;
|
||||
import com.google.android.exoplayer2.drm.MediaDrmCallback;
|
||||
import com.google.android.exoplayer2.drm.FrameworkMediaDrm;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.DecoderInitializationException;
|
||||
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException;
|
||||
import com.google.android.exoplayer2.offline.DownloadHelper;
|
||||
|
|
@ -485,7 +485,7 @@ public class PlayerActivity extends AppCompatActivity
|
|||
drmSessionManager = DrmSessionManager.getDummyDrmSessionManager();
|
||||
} else if (Util.SDK_INT < 18) {
|
||||
errorStringId = R.string.error_drm_unsupported_before_api_18;
|
||||
} else if (!MediaDrm.isCryptoSchemeSupported(drmInfo.drmScheme)) {
|
||||
} else if (!FrameworkMediaDrm.isCryptoSchemeSupported(drmInfo.drmScheme)) {
|
||||
errorStringId = R.string.error_drm_unsupported_scheme;
|
||||
} else {
|
||||
MediaDrmCallback mediaDrmCallback =
|
||||
|
|
|
|||
|
|
@ -75,6 +75,15 @@ public final class FrameworkMediaDrm implements ExoMediaDrm<FrameworkMediaCrypto
|
|||
private final MediaDrm mediaDrm;
|
||||
private int referenceCount;
|
||||
|
||||
/**
|
||||
* Returns whether the DRM scheme with the given UUID is supported on this device.
|
||||
*
|
||||
* @see MediaDrm#isCryptoSchemeSupported(UUID)
|
||||
*/
|
||||
public static boolean isCryptoSchemeSupported(UUID uuid) {
|
||||
return MediaDrm.isCryptoSchemeSupported(adjustUuid(uuid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an instance with an initial reference count of 1. {@link #release()} must be called on
|
||||
* the instance when it's no longer required.
|
||||
|
|
|
|||
Loading…
Reference in a new issue