本文整理汇总了Java中android.media.UnsupportedSchemeException类的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedSchemeException类的具体用法?Java UnsupportedSchemeException怎么用?Java UnsupportedSchemeException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UnsupportedSchemeException类属于android.media包,在下文中一共展示了UnsupportedSchemeException类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isL1WidevineAvailable
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
@TargetApi(18)
@SuppressWarnings("ResourceType")
private static boolean isL1WidevineAvailable(String videoMimeType) {
try {
// Force L3 if secure decoder is not available.
if (MediaCodecUtil.getDecoderInfo(videoMimeType, true) == null) {
return false;
}
MediaDrm mediaDrm = new MediaDrm(WIDEVINE_UUID);
String securityProperty = mediaDrm.getPropertyString(SECURITY_LEVEL_PROPERTY);
mediaDrm.release();
return WIDEVINE_SECURITY_LEVEL_1.equals(securityProperty);
} catch (DecoderQueryException | UnsupportedSchemeException e) {
throw new IllegalStateException(e);
}
}
示例2: OfflineDrmSessionManager
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
OfflineDrmSessionManager(OfflineKeySetStorage storage) throws UnsupportedDrmException {
mStorage = storage;
try {
mMediaDrm = new MediaDrm(WIDEVINE_UUID);
OfflineDrmManager.printAllProperties(mMediaDrm);
mMediaDrm.setOnEventListener(new MediaDrm.OnEventListener() {
@Override
public void onEvent(@NonNull MediaDrm md, byte[] sessionId, int event, int extra, byte[] data) {
Log.d(TAG, "onEvent:" + toHexString(sessionId) + ":" + event + ":" + extra + ":" + toHexString(data));
}
});
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setOnKeyStatusChangeListener();
}
} catch (UnsupportedSchemeException e) {
throw new UnsupportedDrmException(UnsupportedDrmException.REASON_UNSUPPORTED_SCHEME, e);
}
}
示例3: getDrmSessionManagerData
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public static Pair<DrmSessionManager, Boolean> getDrmSessionManagerData(DemoPlayer player,
MediaDrmCallback drmCallback) throws UnsupportedSchemeException {
StreamingDrmSessionManager streamingDrmSessionManager = new StreamingDrmSessionManager(
DemoUtil.WIDEVINE_UUID, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
return Pair.create((DrmSessionManager) streamingDrmSessionManager,
getWidevineSecurityLevel(streamingDrmSessionManager) == SECURITY_LEVEL_1);
}
示例4: StreamingDrmSessionManager
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
/**
* @param uuid The UUID of the drm scheme.
* @param playbackLooper The looper associated with the media playback thread. Should usually be
* obtained using {@link com.google.android.exoplayer.ExoPlayer#getPlaybackLooper()}.
* @param callback Performs key and provisioning requests.
* @param optionalKeyRequestParameters An optional map of parameters to pass as the last argument
* to {@link MediaDrm#getKeyRequest(byte[], byte[], String, int, HashMap)}. May be null.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @throws UnsupportedSchemeException If the specified DRM scheme is not supported.
*/
public StreamingDrmSessionManager(UUID uuid, Looper playbackLooper, MediaDrmCallback callback,
HashMap<String, String> optionalKeyRequestParameters, Handler eventHandler,
EventListener eventListener) throws UnsupportedSchemeException {
this.uuid = uuid;
this.callback = callback;
this.optionalKeyRequestParameters = optionalKeyRequestParameters;
this.eventHandler = eventHandler;
this.eventListener = eventListener;
mediaDrm = new MediaDrm(uuid);
mediaDrm.setOnEventListener(new MediaDrmEventListener());
mediaDrmHandler = new MediaDrmHandler(playbackLooper);
postResponseHandler = new PostResponseHandler(playbackLooper);
state = STATE_CLOSED;
}
示例5: build
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public static MediaDrm build () {
try {
return new MediaDrm(WIDEVINE_UUID);
} catch (UnsupportedSchemeException e) {
throw new IllegalStateException(e);
}
}
示例6: FrameworkMediaDrm
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
Assertions.checkNotNull(uuid);
Assertions.checkArgument(!C.COMMON_PSSH_UUID.equals(uuid), "Use C.CLEARKEY_UUID instead");
// ClearKey had to be accessed using the Common PSSH UUID prior to API level 27.
uuid = Util.SDK_INT < 27 && C.CLEARKEY_UUID.equals(uuid) ? C.COMMON_PSSH_UUID : uuid;
this.uuid = uuid;
this.mediaDrm = new MediaDrm(uuid);
}
示例7: StreamingDrmSessionManager
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
/**
* @param uuid The UUID of the drm scheme.
* @param playbackLooper The looper associated with the media playback thread. Should usually be
* obtained using {@link com.google.android.exoplayer.ExoPlayer#getPlaybackLooper()}.
* @param callback Performs key and provisioning requests.
* @param eventHandler A handler to use when delivering events to {@code eventListener}. May be
* null if delivery of events is not required.
* @param eventListener A listener of events. May be null if delivery of events is not required.
* @throws UnsupportedSchemeException If the specified DRM scheme is not supported.
*/
public StreamingDrmSessionManager(UUID uuid, Looper playbackLooper, MediaDrmCallback callback,
Handler eventHandler, EventListener eventListener) throws UnsupportedSchemeException {
this.uuid = uuid;
this.callback = callback;
this.eventHandler = eventHandler;
this.eventListener = eventListener;
mediaDrm = new MediaDrm(uuid);
mediaDrm.setOnEventListener(new MediaDrmEventListener());
mediaDrmHandler = new MediaDrmHandler(playbackLooper);
postResponseHandler = new PostResponseHandler(playbackLooper);
state = STATE_CLOSED;
}
示例8: FrameworkMediaDrm
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
示例9: FrameworkMediaDrm
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
示例10: getDrmSessionManager
import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public static DrmSessionManager getDrmSessionManager(UUID uuid, DemoPlayer player,
MediaDrmCallback drmCallback) throws UnsupportedSchemeException {
return new StreamingDrmSessionManager(uuid, player.getPlaybackLooper(), drmCallback, null,
player.getMainHandler(), player);
}