DrmUtil
@UnstableApi
class DrmUtil
DRM-related utility methods.
Summary
Nested types |
|---|
@DocumentedIdentifies the operation which caused a DRM-related error. |
Constants |
|
|---|---|
const Int |
Corresponds to failures caused by an |
const Int |
Corresponds to failures caused by an operation related to obtaining DRM licenses. |
const Int |
Corresponds to failures caused by an operation related to provisioning the device. |
Public functions |
|
|---|---|
java-static MediaDrmCallback.Response! |
executePost(Executes a HTTP POST request with retry handling and returns the entire response in a byte buffer. |
java-static Int |
@PlaybackException.ErrorCodeReturns the |
java-static Boolean |
Returns true if |
java-static Boolean |
Returns true if |
Constants
ERROR_SOURCE_EXO_MEDIA_DRM
const val ERROR_SOURCE_EXO_MEDIA_DRM = 1: Int
Corresponds to failures caused by an ExoMediaDrm method call.
ERROR_SOURCE_LICENSE_ACQUISITION
const val ERROR_SOURCE_LICENSE_ACQUISITION = 2: Int
Corresponds to failures caused by an operation related to obtaining DRM licenses.
ERROR_SOURCE_PROVISIONING
const val ERROR_SOURCE_PROVISIONING = 3: Int
Corresponds to failures caused by an operation related to provisioning the device.
Public functions
executePost
java-static fun executePost(
dataSource: DataSource!,
url: String!,
httpBody: ByteArray<Byte>?,
requestProperties: (Mutable)Map<String!, String!>!
): MediaDrmCallback.Response!
Executes a HTTP POST request with retry handling and returns the entire response in a byte buffer.
Note that this method is executing the request synchronously and blocks until finished.
The LoadEventInfo returned inside the MediaDrmCallback.Response will have the following fields unset, and they must be updated by caller before the LoadEventInfo is used elsewhere:
| Parameters | |
|---|---|
dataSource: DataSource! |
A |
url: String! |
The requested URL. |
httpBody: ByteArray<Byte>? |
The HTTP request payload. |
requestProperties: (Mutable)Map<String!, String!>! |
A keyed map of HTTP header request properties. |
| Returns | |
|---|---|
MediaDrmCallback.Response! |
A |
| Throws | |
|---|---|
androidx.media3.exoplayer.drm.MediaDrmCallbackException |
if an exception was encountered during the download. |
getErrorCodeForMediaDrmException
@PlaybackException.ErrorCode
java-static fun getErrorCodeForMediaDrmException(
exception: Throwable!,
@DrmUtil.ErrorSource errorSource: Int
): Int
Returns the PlaybackException.ErrorCode that corresponds to the given DRM-related exception.
| Parameters | |
|---|---|
exception: Throwable! |
The DRM-related exception for which to obtain a corresponding |
@DrmUtil.ErrorSource errorSource: Int |
The |
| Returns | |
|---|---|
Int |
The |
isFailureToConstructNotProvisionedException
java-static fun isFailureToConstructNotProvisionedException(e: Throwable?): Boolean
Returns true if e represents a failure to construct a NotProvisionedException. See b/291440132.
isFailureToConstructResourceBusyException
java-static fun isFailureToConstructResourceBusyException(e: Throwable?): Boolean
Returns true if e represents a failure to construct a ResourceBusyException. See b/291440132.