HttpMediaDrmCallback


@UnstableApi
class HttpMediaDrmCallback : MediaDrmCallback


A MediaDrmCallback that makes requests using DataSource instances.

Summary

Public constructors

HttpMediaDrmCallback(
    defaultLicenseUrl: String?,
    dataSourceFactory: DataSource.Factory!
)

Constructs an instance.

HttpMediaDrmCallback(
    defaultLicenseUrl: String?,
    forceDefaultLicenseUrl: Boolean,
    dataSourceFactory: DataSource.Factory!
)

Constructs an instance.

Public functions

Unit

Clears all headers for key requests made by the callback.

Unit

Clears a header for key requests made by the callback.

ByteArray<Byte>!

Executes a key request.

ByteArray<Byte>!
executeProvisionRequest(
    uuid: UUID!,
    request: ExoMediaDrm.ProvisionRequest!
)

Executes a provisioning request.

Unit
setKeyRequestProperty(name: String!, value: String!)

Sets a header for key requests made by the callback.

Public constructors

HttpMediaDrmCallback

HttpMediaDrmCallback(
    defaultLicenseUrl: String?,
    dataSourceFactory: DataSource.Factory!
)

Constructs an instance.

Parameters
defaultLicenseUrl: String?

The default license URL. Used for key requests that do not specify their own license URL. May be null if it's known that all key requests will specify their own URLs.

dataSourceFactory: DataSource.Factory!

A factory from which to obtain DataSource instances. This will usually be an HTTP-based DataSource.

HttpMediaDrmCallback

HttpMediaDrmCallback(
    defaultLicenseUrl: String?,
    forceDefaultLicenseUrl: Boolean,
    dataSourceFactory: DataSource.Factory!
)

Constructs an instance.

Parameters
defaultLicenseUrl: String?

The default license URL. Used for key requests that do not specify their own license URL, or for all key requests if forceDefaultLicenseUrl is set to true. May be null if forceDefaultLicenseUrl is false and if it's known that all key requests will specify their own URLs.

forceDefaultLicenseUrl: Boolean

Whether to force use of defaultLicenseUrl for key requests that include their own license URL.

dataSourceFactory: DataSource.Factory!

A factory from which to obtain DataSource instances. This will * usually be an HTTP-based DataSource.

Public functions

clearAllKeyRequestProperties

fun clearAllKeyRequestProperties(): Unit

Clears all headers for key requests made by the callback.

clearKeyRequestProperty

fun clearKeyRequestProperty(name: String!): Unit

Clears a header for key requests made by the callback.

Parameters
name: String!

The name of the header field.

executeKeyRequest

fun executeKeyRequest(uuid: UUID!, request: ExoMediaDrm.KeyRequest!): ByteArray<Byte>!

Executes a key request.

Parameters
uuid: UUID!

The UUID of the content protection scheme.

request: ExoMediaDrm.KeyRequest!

The request.

Returns
ByteArray<Byte>!

The response data.

Throws
androidx.media3.exoplayer.drm.MediaDrmCallbackException

If an error occurred executing the request.

executeProvisionRequest

fun executeProvisionRequest(
    uuid: UUID!,
    request: ExoMediaDrm.ProvisionRequest!
): ByteArray<Byte>!

Executes a provisioning request.

Parameters
uuid: UUID!

The UUID of the content protection scheme.

request: ExoMediaDrm.ProvisionRequest!

The request.

Returns
ByteArray<Byte>!

The response data.

Throws
androidx.media3.exoplayer.drm.MediaDrmCallbackException

If an error occurred executing the request.

setKeyRequestProperty

fun setKeyRequestProperty(name: String!, value: String!): Unit

Sets a header for key requests made by the callback.

Parameters
name: String!

The name of the header field.

value: String!

The value of the field.