public final class OfflineLicenseHelper<T extends ExoMediaCrypto>
extends java.lang.Object
| Constructor and Description |
|---|
OfflineLicenseHelper(java.util.UUID uuid,
ExoMediaDrm<T> mediaDrm,
MediaDrmCallback callback,
java.util.HashMap<java.lang.String,java.lang.String> optionalKeyRequestParameters)
Constructs an instance.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
downloadLicense(DrmInitData drmInitData)
Downloads an offline license.
|
android.util.Pair<java.lang.Long,java.lang.Long> |
getLicenseDurationRemainingSec(byte[] offlineLicenseKeySetId)
Returns the remaining license and playback durations in seconds, for an offline license.
|
byte[] |
getPropertyByteArray(java.lang.String key) |
java.lang.String |
getPropertyString(java.lang.String key) |
static OfflineLicenseHelper<FrameworkMediaCrypto> |
newWidevineInstance(java.lang.String defaultLicenseUrl,
boolean forceDefaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory)
Instantiates a new instance which uses Widevine CDM.
|
static OfflineLicenseHelper<FrameworkMediaCrypto> |
newWidevineInstance(java.lang.String defaultLicenseUrl,
boolean forceDefaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory,
java.util.HashMap<java.lang.String,java.lang.String> optionalKeyRequestParameters)
Instantiates a new instance which uses Widevine CDM.
|
static OfflineLicenseHelper<FrameworkMediaCrypto> |
newWidevineInstance(java.lang.String defaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory)
Instantiates a new instance which uses Widevine CDM.
|
void |
release()
Releases the helper.
|
void |
releaseLicense(byte[] offlineLicenseKeySetId)
Releases an offline license.
|
byte[] |
renewLicense(byte[] offlineLicenseKeySetId)
Renews an offline license.
|
void |
setPropertyByteArray(java.lang.String key,
byte[] value) |
void |
setPropertyString(java.lang.String key,
java.lang.String value) |
public OfflineLicenseHelper(java.util.UUID uuid,
ExoMediaDrm<T> mediaDrm,
MediaDrmCallback callback,
java.util.HashMap<java.lang.String,java.lang.String> optionalKeyRequestParameters)
release() when the instance is no longer required.uuid - The UUID of the drm scheme.mediaDrm - An underlying ExoMediaDrm for use by the manager.callback - Performs key and provisioning requests.optionalKeyRequestParameters - An optional map of parameters to pass as the last argument
to MediaDrm.getKeyRequest(byte[], byte[], String, int, HashMap). May be null.DefaultDrmSessionManager.DefaultDrmSessionManager(java.util.UUID, ExoMediaDrm,
MediaDrmCallback, HashMap, Handler, DefaultDrmSessionEventListener)public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(java.lang.String defaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory) throws UnsupportedDrmException
release() when the instance
is no longer required.defaultLicenseUrl - The default license URL. Used for key requests that do not specify
their own license URL.httpDataSourceFactory - A factory from which to obtain HttpDataSource instances.UnsupportedDrmException - If the Widevine DRM scheme is unsupported or cannot be
instantiated.public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(java.lang.String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory) throws UnsupportedDrmException
release() when the instance
is no longer required.defaultLicenseUrl - The default license URL. Used for key requests that do not specify
their own license URL.forceDefaultLicenseUrl - Whether to use defaultLicenseUrl for key requests that
include their own license URL.httpDataSourceFactory - A factory from which to obtain HttpDataSource instances.UnsupportedDrmException - If the Widevine DRM scheme is unsupported or cannot be
instantiated.public static OfflineLicenseHelper<FrameworkMediaCrypto> newWidevineInstance(java.lang.String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory, java.util.HashMap<java.lang.String,java.lang.String> optionalKeyRequestParameters) throws UnsupportedDrmException
release() when the instance
is no longer required.defaultLicenseUrl - The default license URL. Used for key requests that do not specify
their own license URL.forceDefaultLicenseUrl - Whether to use defaultLicenseUrl for key requests that
include their own license URL.optionalKeyRequestParameters - An optional map of parameters to pass as the last argument
to MediaDrm.getKeyRequest(byte[], byte[], String, int, HashMap). May be null.UnsupportedDrmException - If the Widevine DRM scheme is unsupported or cannot be
instantiated.DefaultDrmSessionManager.DefaultDrmSessionManager(java.util.UUID, ExoMediaDrm,
MediaDrmCallback, HashMap, Handler, DefaultDrmSessionEventListener)public byte[] getPropertyByteArray(java.lang.String key)
public void setPropertyByteArray(java.lang.String key,
byte[] value)
public java.lang.String getPropertyString(java.lang.String key)
public void setPropertyString(java.lang.String key,
java.lang.String value)
public byte[] downloadLicense(DrmInitData drmInitData) throws DrmSession.DrmSessionException
drmInitData - The DrmInitData for the content whose license is to be downloaded.DrmSession.DrmSessionException - Thrown when a DRM session error occurs.public byte[] renewLicense(byte[] offlineLicenseKeySetId)
throws DrmSession.DrmSessionException
offlineLicenseKeySetId - The key set id of the license to be renewed.DrmSession.DrmSessionException - Thrown when a DRM session error occurs.public void releaseLicense(byte[] offlineLicenseKeySetId)
throws DrmSession.DrmSessionException
offlineLicenseKeySetId - The key set id of the license to be released.DrmSession.DrmSessionException - Thrown when a DRM session error occurs.public android.util.Pair<java.lang.Long,java.lang.Long> getLicenseDurationRemainingSec(byte[] offlineLicenseKeySetId)
throws DrmSession.DrmSessionException
offlineLicenseKeySetId - The key set id of the license.DrmSession.DrmSessionException - Thrown when a DRM session error occurs.public void release()