public final class

ExoMediaDrm.KeyRequest

extends java.lang.Object

 java.lang.Object

↳androidx.media3.exoplayer.drm.ExoMediaDrm.KeyRequest

Overview

Contains data used to request keys from a license server.

Summary

Fields
public static final intREQUEST_TYPE_INITIAL

Key request type for an initial license request.

public static final intREQUEST_TYPE_NONE

Key request type if keys are already loaded and available for use.

public static final intREQUEST_TYPE_RELEASE

Key request type for license release.

public static final intREQUEST_TYPE_RENEWAL

Key request type for license renewal.

public static final intREQUEST_TYPE_UNKNOWN

Value returned from ExoMediaDrm.KeyRequest.getRequestType() if the underlying key request does not specify a type.

public static final intREQUEST_TYPE_UPDATE

Key request type if keys have been loaded, but an additional license request is needed to update their values.

Constructors
publicKeyRequest(byte[] data[], java.lang.String licenseServerUrl)

Creates an instance with ExoMediaDrm.KeyRequest.REQUEST_TYPE_UNKNOWN.

publicKeyRequest(byte[] data[], java.lang.String licenseServerUrl, int requestType)

Creates an instance.

Methods
public byte[]getData()

Returns the opaque key request data.

public java.lang.StringgetLicenseServerUrl()

Returns the URL of the license server to which the request should be made.

public intgetRequestType()

Returns the type of the request, or ExoMediaDrm.KeyRequest.REQUEST_TYPE_UNKNOWN if the underlying key request does not specify a type.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int REQUEST_TYPE_UNKNOWN

Value returned from ExoMediaDrm.KeyRequest.getRequestType() if the underlying key request does not specify a type.

public static final int REQUEST_TYPE_INITIAL

Key request type for an initial license request.

public static final int REQUEST_TYPE_RENEWAL

Key request type for license renewal.

public static final int REQUEST_TYPE_RELEASE

Key request type for license release.

public static final int REQUEST_TYPE_NONE

Key request type if keys are already loaded and available for use. No license request is necessary, and no key request data is returned.

public static final int REQUEST_TYPE_UPDATE

Key request type if keys have been loaded, but an additional license request is needed to update their values.

Constructors

public KeyRequest(byte[] data[], java.lang.String licenseServerUrl)

Creates an instance with ExoMediaDrm.KeyRequest.REQUEST_TYPE_UNKNOWN.

Parameters:

data: The opaque key request data.
licenseServerUrl: The license server URL to which the request should be made.

public KeyRequest(byte[] data[], java.lang.String licenseServerUrl, int requestType)

Creates an instance.

Parameters:

data: The opaque key request data.
licenseServerUrl: The license server URL to which the request should be made.
requestType: The type of the request, or ExoMediaDrm.KeyRequest.REQUEST_TYPE_UNKNOWN.

Methods

public byte[] getData()

Returns the opaque key request data.

public java.lang.String getLicenseServerUrl()

Returns the URL of the license server to which the request should be made.

public int getRequestType()

Returns the type of the request, or ExoMediaDrm.KeyRequest.REQUEST_TYPE_UNKNOWN if the underlying key request does not specify a type. Note that when using a platform MediaDrm instance, key requests only specify a type on API levels 23 and above.