LocalMediaDrmCallback


@UnstableApi
public final class LocalMediaDrmCallback implements MediaDrmCallback


A MediaDrmCallback that provides a fixed response to key requests. Provisioning is not supported. This implementation is primarily useful for providing locally stored keys to decrypt ClearKey protected content. It is not suitable for use with Widevine or PlayReady protected content.

Summary

Public constructors

LocalMediaDrmCallback(byte[] keyResponse)

Public methods

byte[]

Executes a key request.

byte[]

Executes a provisioning request.

Public constructors

LocalMediaDrmCallback

public LocalMediaDrmCallback(byte[] keyResponse)
Parameters
byte[] keyResponse

The fixed response for all key requests.

Public methods

executeKeyRequest

public byte[] executeKeyRequest(UUID uuid, ExoMediaDrm.KeyRequest request)

Executes a key request.

Parameters
UUID uuid

The UUID of the content protection scheme.

ExoMediaDrm.KeyRequest request

The request.

Returns
byte[]

The response data.

Throws
androidx.media3.exoplayer.drm.MediaDrmCallbackException

If an error occurred executing the request.

executeProvisionRequest

public byte[] executeProvisionRequest(
    UUID uuid,
    ExoMediaDrm.ProvisionRequest request
)

Executes a provisioning request.

Parameters
UUID uuid

The UUID of the content protection scheme.

ExoMediaDrm.ProvisionRequest request

The request.

Returns
byte[]

The response data.

Throws
androidx.media3.exoplayer.drm.MediaDrmCallbackException

If an error occurred executing the request.