OfflineLicenseHelper
@UnstableApi
class OfflineLicenseHelper
Helper class to download, renew and release offline licenses.
Summary
Public constructors |
|---|
OfflineLicenseHelper(Constructs an instance. |
Public functions |
|
|---|---|
synchronized ByteArray<Byte>! |
downloadLicense(format: Format!)Downloads an offline license. |
synchronized Pair<Long!, Long!>! |
getLicenseDurationRemainingSec(offlineLicenseKeySetId: ByteArray!)Returns the remaining license and playback durations in seconds, for an offline license. |
java-static OfflineLicenseHelper! |
newWidevineInstance(Instantiates a new instance which uses Widevine CDM. |
java-static OfflineLicenseHelper! |
newWidevineInstance(Instantiates a new instance which uses Widevine CDM. |
java-static OfflineLicenseHelper! |
newWidevineInstance(Instantiates a new instance which uses Widevine CDM. |
java-static OfflineLicenseHelper! |
newWidevineInstance(Instantiates a new instance which uses Widevine CDM. |
Unit |
release()Releases the helper. |
synchronized Unit |
releaseLicense(offlineLicenseKeySetId: ByteArray!)Releases an offline license. |
synchronized ByteArray<Byte>! |
renewLicense(offlineLicenseKeySetId: ByteArray!)Renews an offline license. |
Public constructors
OfflineLicenseHelper
OfflineLicenseHelper(
defaultDrmSessionManager: DefaultDrmSessionManager!,
eventDispatcher: DrmSessionEventListener.EventDispatcher!
)
Constructs an instance. Call release when the instance is no longer required.
| Parameters | |
|---|---|
defaultDrmSessionManager: DefaultDrmSessionManager! |
The |
eventDispatcher: DrmSessionEventListener.EventDispatcher! |
A |
Public functions
downloadLicense
synchronized fun downloadLicense(format: Format!): ByteArray<Byte>!
Downloads an offline license.
| Parameters | |
|---|---|
format: Format! |
The |
| Throws | |
|---|---|
androidx.media3.exoplayer.drm.DrmSession.DrmSessionException |
Thrown when a DRM session error occurs. |
getLicenseDurationRemainingSec
synchronized fun getLicenseDurationRemainingSec(offlineLicenseKeySetId: ByteArray!): Pair<Long!, Long!>!
Returns the remaining license and playback durations in seconds, for an offline license.
| Parameters | |
|---|---|
offlineLicenseKeySetId: ByteArray! |
The key set id of the license. |
| Throws | |
|---|---|
androidx.media3.exoplayer.drm.DrmSession.DrmSessionException |
Thrown when a DRM session error occurs. |
newWidevineInstance
java-static fun newWidevineInstance(
defaultLicenseUrl: String!,
dataSourceFactory: DataSource.Factory!,
eventDispatcher: DrmSessionEventListener.EventDispatcher!
): OfflineLicenseHelper!
Instantiates a new instance which uses Widevine CDM. Call release when the instance is no longer required.
| Parameters | |
|---|---|
defaultLicenseUrl: String! |
The default license URL. Used for key requests that do not specify their own license URL. |
dataSourceFactory: DataSource.Factory! |
A factory from which to obtain |
eventDispatcher: DrmSessionEventListener.EventDispatcher! |
A |
| Returns | |
|---|---|
OfflineLicenseHelper! |
A new instance which uses Widevine CDM. |
newWidevineInstance
java-static fun newWidevineInstance(
drmConfiguration: MediaItem.DrmConfiguration!,
dataSourceFactory: DataSource.Factory!,
eventDispatcher: DrmSessionEventListener.EventDispatcher!
): OfflineLicenseHelper!
Instantiates a new instance which uses Widevine CDM. Call release when the instance is no longer required.
| Parameters | |
|---|---|
drmConfiguration: MediaItem.DrmConfiguration! |
The |
dataSourceFactory: DataSource.Factory! |
A factory from which to obtain |
eventDispatcher: DrmSessionEventListener.EventDispatcher! |
A |
| Returns | |
|---|---|
OfflineLicenseHelper! |
A new instance which uses Widevine CDM. |
newWidevineInstance
java-static fun newWidevineInstance(
defaultLicenseUrl: String!,
forceDefaultLicenseUrl: Boolean,
dataSourceFactory: DataSource.Factory!,
eventDispatcher: DrmSessionEventListener.EventDispatcher!
): OfflineLicenseHelper!
Instantiates a new instance which uses Widevine CDM. Call release when the instance is no longer required.
| Parameters | |
|---|---|
defaultLicenseUrl: String! |
The default license URL. Used for key requests that do not specify their own license URL. |
forceDefaultLicenseUrl: Boolean |
Whether to use |
dataSourceFactory: DataSource.Factory! |
A factory from which to obtain |
eventDispatcher: DrmSessionEventListener.EventDispatcher! |
A |
| Returns | |
|---|---|
OfflineLicenseHelper! |
A new instance which uses Widevine CDM. |
newWidevineInstance
java-static fun newWidevineInstance(
defaultLicenseUrl: String!,
forceDefaultLicenseUrl: Boolean,
dataSourceFactory: DataSource.Factory!,
optionalKeyRequestParameters: (Mutable)Map<String!, String!>?,
eventDispatcher: DrmSessionEventListener.EventDispatcher!
): OfflineLicenseHelper!
Instantiates a new instance which uses Widevine CDM. Call release when the instance is no longer required.
| Parameters | |
|---|---|
defaultLicenseUrl: String! |
The default license URL. Used for key requests that do not specify their own license URL. |
forceDefaultLicenseUrl: Boolean |
Whether to use |
dataSourceFactory: DataSource.Factory! |
A factory from which to obtain |
optionalKeyRequestParameters: (Mutable)Map<String!, String!>? |
An optional map of parameters to pass as the last argument to |
eventDispatcher: DrmSessionEventListener.EventDispatcher! |
A |
| Returns | |
|---|---|
OfflineLicenseHelper! |
A new instance which uses Widevine CDM. |
| See also | |
|---|---|
DefaultDrmSessionManager.Builder |
release
fun release(): Unit
Releases the helper. Should be called when the helper is no longer required.
releaseLicense
synchronized fun releaseLicense(offlineLicenseKeySetId: ByteArray!): Unit
Releases an offline license.
| Parameters | |
|---|---|
offlineLicenseKeySetId: ByteArray! |
The key set id of the license to be released. |
| Throws | |
|---|---|
androidx.media3.exoplayer.drm.DrmSession.DrmSessionException |
Thrown when a DRM session error occurs. |
renewLicense
synchronized fun renewLicense(offlineLicenseKeySetId: ByteArray!): ByteArray<Byte>!
Renews an offline license.
| Parameters | |
|---|---|
offlineLicenseKeySetId: ByteArray! |
The key set id of the license to be renewed. |
| Throws | |
|---|---|
androidx.media3.exoplayer.drm.DrmSession.DrmSessionException |
Thrown when a DRM session error occurs. |