Class ExoMediaDrm.KeyRequest
- java.lang.Object
-
- com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest
-
- Enclosing interface:
- ExoMediaDrm
public static final class ExoMediaDrm.KeyRequest extends Object
Contains data used to request keys from a license server.- See Also:
MediaDrm.KeyRequest
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceExoMediaDrm.KeyRequest.RequestTypeKey request types.
-
Field Summary
Fields Modifier and Type Field Description static intREQUEST_TYPE_INITIALKey request type for an initial license request.static intREQUEST_TYPE_NONEKey request type if keys are already loaded and available for use.static intREQUEST_TYPE_RELEASEKey request type for license release.static intREQUEST_TYPE_RENEWALKey request type for license renewal.static intREQUEST_TYPE_UNKNOWNValue returned fromgetRequestType()if the underlying key request does not specify a type.static intREQUEST_TYPE_UPDATEKey request type if keys have been loaded, but an additional license request is needed to update their values.
-
Constructor Summary
Constructors Constructor Description KeyRequest(byte[] data, String licenseServerUrl)Creates an instance withREQUEST_TYPE_UNKNOWN.KeyRequest(byte[] data, String licenseServerUrl, @com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType int requestType)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]getData()Returns the opaque key request data.StringgetLicenseServerUrl()Returns the URL of the license server to which the request should be made.@com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType intgetRequestType()Returns the type of the request, orREQUEST_TYPE_UNKNOWNif the underlying key request does not specify a type.
-
-
-
Field Detail
-
REQUEST_TYPE_UNKNOWN
public static final int REQUEST_TYPE_UNKNOWN
Value returned fromgetRequestType()if the underlying key request does not specify a type.- See Also:
- Constant Field Values
-
REQUEST_TYPE_INITIAL
public static final int REQUEST_TYPE_INITIAL
Key request type for an initial license request.- See Also:
- Constant Field Values
-
REQUEST_TYPE_RENEWAL
public static final int REQUEST_TYPE_RENEWAL
Key request type for license renewal.- See Also:
- Constant Field Values
-
REQUEST_TYPE_RELEASE
public static final int REQUEST_TYPE_RELEASE
Key request type for license release.- See Also:
- Constant Field Values
-
REQUEST_TYPE_NONE
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
-
REQUEST_TYPE_UPDATE
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
-
-
Constructor Detail
-
KeyRequest
public KeyRequest(byte[] data, String licenseServerUrl)Creates an instance withREQUEST_TYPE_UNKNOWN.- Parameters:
data- The opaque key request data.licenseServerUrl- The license server URL to which the request should be made.
-
KeyRequest
public KeyRequest(byte[] data, String 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, orREQUEST_TYPE_UNKNOWN.
-
-
Method Detail
-
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
public @com.google.android.exoplayer2.drm.ExoMediaDrm.KeyRequest.RequestType int getRequestType()
Returns the type of the request, orREQUEST_TYPE_UNKNOWNif the underlying key request does not specify a type. Note that when using a platformMediaDrminstance, key requests only specify a type on API levels 23 and above.
-
-