public final class OfflineLicenseHelper extends Object
| Constructor | Description |
|---|---|
OfflineLicenseHelper(DefaultDrmSessionManager defaultDrmSessionManager,
DrmSessionEventListener.EventDispatcher eventDispatcher) |
Constructs an instance.
|
OfflineLicenseHelper(UUID uuid,
ExoMediaDrm.Provider mediaDrmProvider,
MediaDrmCallback callback,
Map<String,String> optionalKeyRequestParameters,
DrmSessionEventListener.EventDispatcher eventDispatcher) |
Deprecated.
|
| Modifier and Type | Method | Description |
|---|---|---|
byte[] |
downloadLicense(Format format) |
Downloads an offline license.
|
Pair<Long,Long> |
getLicenseDurationRemainingSec(byte[] offlineLicenseKeySetId) |
Returns the remaining license and playback durations in seconds, for an offline license.
|
static OfflineLicenseHelper |
newWidevineInstance(String defaultLicenseUrl,
boolean forceDefaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory,
DrmSessionEventListener.EventDispatcher eventDispatcher) |
Instantiates a new instance which uses Widevine CDM.
|
static OfflineLicenseHelper |
newWidevineInstance(String defaultLicenseUrl,
boolean forceDefaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory,
Map<String,String> optionalKeyRequestParameters,
DrmSessionEventListener.EventDispatcher eventDispatcher) |
Instantiates a new instance which uses Widevine CDM.
|
static OfflineLicenseHelper |
newWidevineInstance(String defaultLicenseUrl,
HttpDataSource.Factory httpDataSourceFactory,
DrmSessionEventListener.EventDispatcher eventDispatcher) |
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.
|
@Deprecated public OfflineLicenseHelper(UUID uuid, ExoMediaDrm.Provider mediaDrmProvider, MediaDrmCallback callback, @Nullable Map<String,String> optionalKeyRequestParameters, DrmSessionEventListener.EventDispatcher eventDispatcher)
public OfflineLicenseHelper(DefaultDrmSessionManager defaultDrmSessionManager, DrmSessionEventListener.EventDispatcher eventDispatcher)
release() when the instance is no longer required.defaultDrmSessionManager - The DefaultDrmSessionManager used to download licenses.eventDispatcher - A DrmSessionEventListener.EventDispatcher used to distribute
DRM-related events.public static OfflineLicenseHelper newWidevineInstance(String defaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory, DrmSessionEventListener.EventDispatcher eventDispatcher)
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.eventDispatcher - A DrmSessionEventListener.EventDispatcher used to distribute
DRM-related events.public static OfflineLicenseHelper newWidevineInstance(String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory, DrmSessionEventListener.EventDispatcher eventDispatcher)
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.eventDispatcher - A DrmSessionEventListener.EventDispatcher used to distribute
DRM-related events.public static OfflineLicenseHelper newWidevineInstance(String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory httpDataSourceFactory, @Nullable Map<String,String> optionalKeyRequestParameters, DrmSessionEventListener.EventDispatcher eventDispatcher)
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[], java.lang.String, int, java.util.HashMap<java.lang.String, java.lang.String>). May be null.eventDispatcher - A DrmSessionEventListener.EventDispatcher used to distribute
DRM-related events.DefaultDrmSessionManager.Builderpublic byte[] downloadLicense(Format format) throws DrmSession.DrmSessionException
format - The Format of the content whose license is to be downloaded. Must contain
a non-null Format.drmInitData.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 Pair<Long,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()