ExoMediaDrm.KeyRequest


public final class ExoMediaDrm.KeyRequest


Contains data used to request keys from a license server.

Summary

Nested types

@Documented
@Retention(value = RetentionPolicy.SOURCE)
@Target(value = TYPE_USE)
@IntDef(value = )
public annotation ExoMediaDrm.KeyRequest.RequestType

Key request types.

Constants

static final int

Key request type for an initial license request.

static final int

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

static final int

Key request type for license release.

static final int

Key request type for license renewal.

static final int
REQUEST_TYPE_UNKNOWN = -2147483648

Value returned from getRequestType if the underlying key request does not specify a type.

static final int

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

Public fields

final byte[]
final String
final int

Public constructors

KeyRequest(byte[] data, String licenseServerUrl)

Creates an instance with REQUEST_TYPE_UNKNOWN.

KeyRequest(
    byte[] data,
    String licenseServerUrl,
    @ExoMediaDrm.KeyRequest.RequestType int requestType
)

Creates an instance.

Public methods

byte[]

Returns the opaque key request data.

String

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

int

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

Constants

REQUEST_TYPE_INITIAL

public static final int REQUEST_TYPE_INITIAL = 0

Key request type for an initial license request.

REQUEST_TYPE_NONE

public static final int REQUEST_TYPE_NONE = 3

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

REQUEST_TYPE_RELEASE

public static final int REQUEST_TYPE_RELEASE = 2

Key request type for license release.

REQUEST_TYPE_RENEWAL

public static final int REQUEST_TYPE_RENEWAL = 1

Key request type for license renewal.

REQUEST_TYPE_UNKNOWN

public static final int REQUEST_TYPE_UNKNOWN = -2147483648

Value returned from getRequestType if the underlying key request does not specify a type.

REQUEST_TYPE_UPDATE

public static final int REQUEST_TYPE_UPDATE = 4

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

Public fields

data

public final byte[] data

licenseServerUrl

public final String licenseServerUrl

requestType

@ExoMediaDrm.KeyRequest.RequestType
public final int requestType

Public constructors

KeyRequest

public KeyRequest(byte[] data, String licenseServerUrl)

Creates an instance with REQUEST_TYPE_UNKNOWN.

Parameters
byte[] data

The opaque key request data.

String licenseServerUrl

The license server URL to which the request should be made.

KeyRequest

public KeyRequest(
    byte[] data,
    String licenseServerUrl,
    @ExoMediaDrm.KeyRequest.RequestType int requestType
)

Creates an instance.

Parameters
byte[] data

The opaque key request data.

String licenseServerUrl

The license server URL to which the request should be made.

@ExoMediaDrm.KeyRequest.RequestType int requestType

The type of the request, or REQUEST_TYPE_UNKNOWN.

Public methods

getData

public byte[] getData()

Returns the opaque key request data.

getLicenseServerUrl

public String getLicenseServerUrl()

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

getRequestType

@ExoMediaDrm.KeyRequest.RequestType
public int getRequestType()

Returns the type of the request, or 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.