/** * Instantiates a new instance using the Widevine scheme. * * @param callback Performs key and provisioning requests. * @param optionalKeyRequestParameters An optional map of parameters to pass as the last argument * to {@link ExoMediaDrm#getKeyRequest(byte[], List, int, HashMap)}. May be null. * @throws UnsupportedDrmException If the specified DRM scheme is not supported. */ public static DefaultDrmSessionManager<FrameworkMediaCrypto> newWidevineInstance( MediaDrmCallback callback, HashMap<String, String> optionalKeyRequestParameters) throws UnsupportedDrmException { return newFrameworkInstance(C.WIDEVINE_UUID, callback, optionalKeyRequestParameters); }
/** * Instantiates a new instance using the PlayReady scheme. * * <p>Note that PlayReady is unsupported by most Android devices, with the exception of Android TV * devices, which do provide support. * * @param callback Performs key and provisioning requests. * @param customData Optional custom data to include in requests generated by the instance. * @throws UnsupportedDrmException If the specified DRM scheme is not supported. */ public static DefaultDrmSessionManager<FrameworkMediaCrypto> newPlayReadyInstance( MediaDrmCallback callback, String customData) throws UnsupportedDrmException { HashMap<String, String> optionalKeyRequestParameters; if (!TextUtils.isEmpty(customData)) { optionalKeyRequestParameters = new HashMap<>(); optionalKeyRequestParameters.put(PLAYREADY_CUSTOM_DATA_KEY, customData); } else { optionalKeyRequestParameters = null; } return newFrameworkInstance(C.PLAYREADY_UUID, callback, optionalKeyRequestParameters); }
/** * @deprecated Use {@link #newFrameworkInstance(UUID, MediaDrmCallback, HashMap)} and {@link * #addListener(Handler, DefaultDrmSessionEventListener)}. */ @Deprecated public static DefaultDrmSessionManager<FrameworkMediaCrypto> newFrameworkInstance( UUID uuid, MediaDrmCallback callback, HashMap<String, String> optionalKeyRequestParameters, Handler eventHandler, DefaultDrmSessionEventListener eventListener) throws UnsupportedDrmException { DefaultDrmSessionManager<FrameworkMediaCrypto> drmSessionManager = newFrameworkInstance(uuid, callback, optionalKeyRequestParameters); if (eventHandler != null && eventListener != null) { drmSessionManager.addListener(eventHandler, eventListener); } return drmSessionManager; }