Class HttpMediaDrmCallback
- java.lang.Object
-
- com.google.android.exoplayer2.drm.HttpMediaDrmCallback
-
- All Implemented Interfaces:
MediaDrmCallback
public final class HttpMediaDrmCallback extends Object implements MediaDrmCallback
AMediaDrmCallback
that makes requests usingHttpDataSource
instances.
-
-
Constructor Summary
Constructors Constructor Description HttpMediaDrmCallback(String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory dataSourceFactory)
HttpMediaDrmCallback(String defaultLicenseUrl, HttpDataSource.Factory dataSourceFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearAllKeyRequestProperties()
Clears all headers for key requests made by the callback.void
clearKeyRequestProperty(String name)
Clears a header for key requests made by the callback.byte[]
executeKeyRequest(UUID uuid, ExoMediaDrm.KeyRequest request)
Executes a key request.byte[]
executeProvisionRequest(UUID uuid, ExoMediaDrm.ProvisionRequest request)
Executes a provisioning request.void
setKeyRequestProperty(String name, String value)
Sets a header for key requests made by the callback.
-
-
-
Constructor Detail
-
HttpMediaDrmCallback
public HttpMediaDrmCallback(@Nullable String defaultLicenseUrl, HttpDataSource.Factory dataSourceFactory)
- Parameters:
defaultLicenseUrl
- The default license URL. Used for key requests that do not specify their own license URL. May benull
if it's known that all key requests will specify their own URLs.dataSourceFactory
- A factory from which to obtainHttpDataSource
instances.
-
HttpMediaDrmCallback
public HttpMediaDrmCallback(@Nullable String defaultLicenseUrl, boolean forceDefaultLicenseUrl, HttpDataSource.Factory dataSourceFactory)
- Parameters:
defaultLicenseUrl
- The default license URL. Used for key requests that do not specify their own license URL, or for all key requests ifforceDefaultLicenseUrl
is set to true. May benull
ifforceDefaultLicenseUrl
isfalse
and if it's known that all key requests will specify their own URLs.forceDefaultLicenseUrl
- Whether to force use ofdefaultLicenseUrl
for key requests that include their own license URL.dataSourceFactory
- A factory from which to obtainHttpDataSource
instances.
-
-
Method Detail
-
setKeyRequestProperty
public void setKeyRequestProperty(String name, String value)
Sets a header for key requests made by the callback.- Parameters:
name
- The name of the header field.value
- The value of the field.
-
clearKeyRequestProperty
public void clearKeyRequestProperty(String name)
Clears a header for key requests made by the callback.- Parameters:
name
- The name of the header field.
-
clearAllKeyRequestProperties
public void clearAllKeyRequestProperties()
Clears all headers for key requests made by the callback.
-
executeProvisionRequest
public byte[] executeProvisionRequest(UUID uuid, ExoMediaDrm.ProvisionRequest request) throws MediaDrmCallbackException
Description copied from interface:MediaDrmCallback
Executes a provisioning request.- Specified by:
executeProvisionRequest
in interfaceMediaDrmCallback
- Parameters:
uuid
- The UUID of the content protection scheme.request
- The request.- Returns:
- The response data.
- Throws:
MediaDrmCallbackException
- If an error occurred executing the request.
-
executeKeyRequest
public byte[] executeKeyRequest(UUID uuid, ExoMediaDrm.KeyRequest request) throws MediaDrmCallbackException
Description copied from interface:MediaDrmCallback
Executes a key request.- Specified by:
executeKeyRequest
in interfaceMediaDrmCallback
- Parameters:
uuid
- The UUID of the content protection scheme.request
- The request.- Returns:
- The response data.
- Throws:
MediaDrmCallbackException
- If an error occurred executing the request.
-
-