当前位置: 首页>>代码示例>>Java>>正文


Java UnsupportedSchemeException类代码示例

本文整理汇总了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);
  }
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:18,代码来源:DashTest.java

示例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);
        }
    }
 
开发者ID:kaltura,项目名称:player-sdk-native-android,代码行数:26,代码来源:OfflineDrmSessionManager.java

示例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);
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:9,代码来源:DashRendererBuilder.java

示例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;
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:27,代码来源:StreamingDrmSessionManager.java

示例5: build

import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public static MediaDrm build () {
  try {
    return new MediaDrm(WIDEVINE_UUID);
  } catch (UnsupportedSchemeException e) {
    throw new IllegalStateException(e);
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:8,代码来源:DashTestRunner.java

示例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);
}
 
开发者ID:y20k,项目名称:transistor,代码行数:9,代码来源:FrameworkMediaDrm.java

示例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;
}
 
开发者ID:edx,项目名称:edx-app-android,代码行数:23,代码来源:StreamingDrmSessionManager.java

示例8: FrameworkMediaDrm

import android.media.UnsupportedSchemeException; //导入依赖的package包/类
public FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:4,代码来源:FrameworkMediaDrm.java

示例9: FrameworkMediaDrm

import android.media.UnsupportedSchemeException; //导入依赖的package包/类
private FrameworkMediaDrm(UUID uuid) throws UnsupportedSchemeException {
  this.mediaDrm = new MediaDrm(Assertions.checkNotNull(uuid));
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:4,代码来源:FrameworkMediaDrm.java

示例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);
}
 
开发者ID:Weco,项目名称:android-exoplayer,代码行数:6,代码来源:SmoothStreamingRendererBuilder.java


注:本文中的android.media.UnsupportedSchemeException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。