android.media.UnsupportedSchemeException Java Examples

The following examples show how to use android.media.UnsupportedSchemeException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DashTest.java    From ExoPlayer-Offline with Apache License 2.0 6 votes vote down vote up
@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);
  }
}
 
Example #2
Source File: FrameworkMediaDrm.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
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);
  }
}
 
Example #3
Source File: FrameworkMediaDrm.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
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");
  }
}
 
Example #4
Source File: FrameworkMediaDrm.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
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");
  }
}
 
Example #5
Source File: StreamingDrmSessionManager.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
/**
 * @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;
}
 
Example #6
Source File: DashVodRendererBuilder.java    From Mobilyzer with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #7
Source File: FrameworkMediaDrm.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
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);
  }
}
 
Example #8
Source File: FrameworkMediaDrm.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
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);
  }
}
 
Example #9
Source File: FrameworkMediaDrm.java    From K-Sonic with MIT License 4 votes vote down vote up
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
 
Example #10
Source File: StreamingDrmSessionManager.java    From Exoplayer_VLC with Apache License 2.0 4 votes vote down vote up
/**
 * @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);
}