docs/doc/reference/com/google/android/exoplayer2/drm/ExoMediaDrm.KeyRequest.html
Package com.google.android.exoplayer2.drm
Enclosing interface:ExoMediaDrm
public static final classExoMediaDrm.KeyRequestextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")
Contains data used to request keys from a license server.
See Also:MediaDrm.KeyRequest
Nested Classes | Modifier and Type | Class | Description |
| --- | --- | --- |
| static interface | ExoMediaDrm.KeyRequest.RequestType |
Key request types.
|
Fields | Modifier and Type | Field | Description |
| --- | --- | --- |
| static int | REQUEST_TYPE_INITIAL |
Key request type for an initial license request.
|
| static int | REQUEST_TYPE_NONE |
Key request type if keys are already loaded and available for use.
|
| static int | REQUEST_TYPE_RELEASE |
Key request type for license release.
|
| static int | REQUEST_TYPE_RENEWAL |
Key request type for license renewal.
|
| static int | REQUEST_TYPE_UNKNOWN |
Value returned from getRequestType() if the underlying key request does not specify a type.
|
| static int | REQUEST_TYPE_UPDATE |
Key request type if keys have been loaded, but an additional license request is needed to update their values.
|
Constructors | Constructor | Description |
| --- | --- |
| KeyRequest(byte[] data, String licenseServerUrl) |
Creates an instance with REQUEST_TYPE_UNKNOWN.
|
| KeyRequest(byte[] data, String licenseServerUrl, @com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType int requestType) |
Creates an instance.
|
All Methods Instance Methods Concrete Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| byte[] | getData() |
Returns the opaque key request data.
|
| String | getLicenseServerUrl() |
Returns the URL of the license server to which the request should be made.
|
| @com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType int | getRequestType() |
Returns the type of the request, or REQUEST_TYPE_UNKNOWN if the underlying key request does not specify a type.
|
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
public static final int REQUEST_TYPE_UNKNOWN
Value returned from getRequestType() if the underlying key request does not specify a type.
See Also:Constant Field Values
-
public static final int REQUEST_TYPE_INITIAL
Key request type for an initial license request. See Also:Constant Field Values
-
public static final int REQUEST_TYPE_RENEWAL
Key request type for license renewal. See Also:Constant Field Values
-
public static final int REQUEST_TYPE_RELEASE
Key request type for license release. See Also:Constant Field Values
-
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. See Also:Constant Field Values
-
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. See Also:Constant Field Values
-
public KeyRequest(byte[] data,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")licenseServerUrl)
Creates an instance with 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,[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")licenseServerUrl,
@com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType 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 REQUEST_TYPE_UNKNOWN.
-
public byte[] getData()
Returns the opaque key request data.
-
public[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getLicenseServerUrl()
Returns the URL of the license server to which the request should be made.
-
public @com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType 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.