Search in sources :

Example 1 with MediaDrm

use of android.media.MediaDrm in project ExoPlayer by google.

the class DashTestRunner method isL1WidevineAvailable.

@SuppressWarnings("ResourceType")
public static boolean isL1WidevineAvailable(String mimeType) {
    if (Util.SDK_INT >= 18) {
        try {
            // Force L3 if secure decoder is not available.
            if (MediaCodecUtil.getDecoderInfo(mimeType, /* secure= */
            true, /* tunneling= */
            false) == null) {
                return false;
            }
            MediaDrm mediaDrm = MediaDrmBuilder.build();
            String securityProperty = mediaDrm.getPropertyString(SECURITY_LEVEL_PROPERTY);
            mediaDrm.release();
            return WIDEVINE_SECURITY_LEVEL_1.equals(securityProperty);
        } catch (MediaCodecUtil.DecoderQueryException e) {
            throw new IllegalStateException(e);
        }
    }
    return false;
}
Also used : FrameworkMediaDrm(com.google.android.exoplayer2.drm.FrameworkMediaDrm) MediaDrm(android.media.MediaDrm) MediaCodecUtil(com.google.android.exoplayer2.mediacodec.MediaCodecUtil)

Aggregations

MediaDrm (android.media.MediaDrm)1 FrameworkMediaDrm (com.google.android.exoplayer2.drm.FrameworkMediaDrm)1 MediaCodecUtil (com.google.android.exoplayer2.mediacodec.MediaCodecUtil)1