类android.media.UnsupportedSchemeException源码实例Demo

下面列出了怎么用android.media.UnsupportedSchemeException的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ExoPlayer-Offline   文件: DashTest.java
@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 项目: MediaSDK   文件: FrameworkMediaDrm.java
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  Assertions.checkNotNull(uuid);
  Assertions.checkArgument(!C.COMMON_PSSH_UUID.equals(uuid), "Use C.CLEARKEY_UUID instead");
  this.uuid = uuid;
  this.mediaDrm = new MediaDrm(adjustUuid(uuid));
  // Creators of an instance automatically acquire ownership of the created instance.
  referenceCount = 1;
  if (C.WIDEVINE_UUID.equals(uuid) && needsForceWidevineL3Workaround()) {
    forceWidevineL3(mediaDrm);
  }
}
 
源代码3 项目: TelePlus-Android   文件: FrameworkMediaDrm.java
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);
  if (C.WIDEVINE_UUID.equals(uuid) && needsForceL3Workaround()) {
    mediaDrm.setPropertyString("securityLevel", "L3");
  }
}
 
源代码4 项目: TelePlus-Android   文件: FrameworkMediaDrm.java
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);
  if (C.WIDEVINE_UUID.equals(uuid) && needsForceL3Workaround()) {
    mediaDrm.setPropertyString("securityLevel", "L3");
  }
}
 
/**
 * @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;
}
 
源代码6 项目: Mobilyzer   文件: DashVodRendererBuilder.java
public static Pair<DrmSessionManager, Boolean> getDrmSessionManagerData(DemoPlayer player,
    MediaDrmCallback drmCallback) throws UnsupportedSchemeException {
  StreamingDrmSessionManager streamingDrmSessionManager = new StreamingDrmSessionManager(
      DemoUtil.WIDEVINE_UUID, player.getPlaybackLooper(), drmCallback, player.getMainHandler(),
      player);
  return Pair.create((DrmSessionManager) streamingDrmSessionManager,
      getWidevineSecurityLevel(streamingDrmSessionManager) == SECURITY_LEVEL_1);
}
 
源代码7 项目: Telegram-FOSS   文件: FrameworkMediaDrm.java
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  Assertions.checkNotNull(uuid);
  Assertions.checkArgument(!C.COMMON_PSSH_UUID.equals(uuid), "Use C.CLEARKEY_UUID instead");
  this.uuid = uuid;
  this.mediaDrm = new MediaDrm(adjustUuid(uuid));
  if (C.WIDEVINE_UUID.equals(uuid) && needsForceWidevineL3Workaround()) {
    forceWidevineL3(mediaDrm);
  }
}
 
源代码8 项目: Telegram   文件: FrameworkMediaDrm.java
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  Assertions.checkNotNull(uuid);
  Assertions.checkArgument(!C.COMMON_PSSH_UUID.equals(uuid), "Use C.CLEARKEY_UUID instead");
  this.uuid = uuid;
  this.mediaDrm = new MediaDrm(adjustUuid(uuid));
  if (C.WIDEVINE_UUID.equals(uuid) && needsForceWidevineL3Workaround()) {
    forceWidevineL3(mediaDrm);
  }
}
 
源代码9 项目: K-Sonic   文件: FrameworkMediaDrm.java
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
 
源代码10 项目: Exoplayer_VLC   文件: StreamingDrmSessionManager.java
/**
 * @deprecated Use the other constructor, passing null as {@code optionalKeyRequestParameters}.
 */
@Deprecated
public StreamingDrmSessionManager(UUID uuid, Looper playbackLooper, MediaDrmCallback callback,
    Handler eventHandler, EventListener eventListener) throws UnsupportedSchemeException {
  this(uuid, playbackLooper, callback, null, eventHandler, eventListener);
}
 
 类所在包
 同包方法