Android OpenTV Player SDK
5.29.0.1685538953
|
The default implementation of OTVMediaDrmCallback.
This class can be used in most cases of streaming Widevine- or PlayReady- encrypted streams while fetching the keys from a licence server such as Nagra's Secure Service Platform (SSP).
An object of this class (or other implementations of OTVMediaDrmCallback) must be assigned to the player for playback of encrypted content. The configuration of the object is done with the following stages:
The key-value pairs define parameters that are passed to the licence server in the HTTP header. For example:
callback.setKeyRequestProperty("Content-Type", "application/octet-stream");
.
The "Content-Type" property in particular is necessary as different DRM system types may require different formats (e.g. binary, JSON, XML etc.) The object is configured prior to start of playback or setting the stream path, and then assigned to the OTVVideoView instance:
videoView.setMediaDrmCallback(callback);
Configuration can also be changed during playback.
Public Member Functions | |
OTVHttpMediaDrmCallback (String defaultLicenseUrl) | |
byte[] | executeKeyRequest (UUID uuid, KeyRequest request) throws MediaDrmCallbackException |
Executes a key request. More... | |
String | getDrmType () |
Returns the DRM type the callback instance is configured for. More... | |
boolean | isMultiSession () |
byte[] | executeProvisionRequest (UUID uuid, ProvisionRequest request) throws MediaDrmCallbackException |
Executes a provisioning request. More... | |
byte[] | executeProvisionRequest (UUID uuid, ExoMediaDrm.ProvisionRequest request) throws MediaDrmCallbackException |
Executes a provisioning request. More... | |
void | setKeyRequestProperty (String name, String value) |
Sets a header for key requests made by the callback. More... | |
void | clearKeyRequestProperty (String name) |
Clears a specified header for key requests made by the callback. More... | |
void | clearAllKeyRequestProperties () |
Clears all headers for key requests made by the callback. More... | |
void | setDrmType (String xDrmType) |
Set which DRM system to be used to play the stream. More... | |
void | setMultiSession (boolean xIsMultiSession) |
Set if the DRM system supports multiple sessions. More... | |
void | setKeyRequestOption (String name, String value) |
Sets an optional parameter for key requests. More... | |
void | clearKeyRequestOption (String name) |
Clears an option for key requests. More... | |
void | clearAllKeyRequestOptions () |
Clears all options for key requests. More... | |
HashMap< String, String > | getKeyRequestOptions () |
Gets options for key requests. More... | |
void | setDrmPropertyString (String name, String value) |
Sets a drm property. More... | |
void | clearAllDrmPropertyStrings () |
Clears all properties for media drm. More... | |
HashMap< String, String > | getDrmPropertyStrings () |
Gets properties for media drm. More... | |
void | setDrmPropertyByteArray (String name, byte[] value) |
Sets a drm byte array property. More... | |
void | clearAllDrmPropertyByteArray () |
Clears all byte array properties for media drm. More... | |
HashMap< String, byte[]> | getDrmPropertyByteArray () |
Gets byte array properties for media drm. More... | |
void | setMutualAuthentication (SSLSocketFactory xSslSocketFactory) |
Sets SSLSocketFactory for Mutual Authentication. More... | |
byte[] | executeKeyRequest (UUID uuid, ExoMediaDrm.KeyRequest request) throws MediaDrmCallbackException |
Executes a key request. More... | |
Public Attributes | |
String | OTV_DRMTYPE_WIDEVINE = "Widevine" |
Defined DRM type for Widevine. More... | |
String | OTV_DRMTYPE_PLAYREADY = "PlayReady" |
Define DRM type for PlayReady. More... | |
String | OTV_DRMTYPE_CONNECT = "Connect" |
Define DRM type for Connect. More... | |
String | OTV_DRMTYPE_WISEPLAY = "Wiseplay" |
Define DRM type for Connect. More... | |
Protected Member Functions | |
byte[] | executePost (String url, byte[] data, Map< String, String > requestProperties) throws IOException |
A utility for synchronously sending a POST HTTP message. More... | |
MediaDrmCallbackException | generateDrmCBException (@NonNull IOException exception) |
Helper method to generate MediaDrmCallbackException with IOException. More... | |
OTVHttpMediaDrmCallback | ( | String | defaultLicenseUrl | ) |
defaultLicenseUrl | The default license URL. Used for key requests that do not specify their own license URL. |
|
inherited |
Clears all byte array properties for media drm.
|
inherited |
Clears all properties for media drm.
|
inherited |
Clears all options for key requests.
|
inherited |
Clears all headers for key requests made by the callback.
|
inherited |
Clears an option for key requests.
name | The name of the option. |
|
inherited |
Clears a specified header for key requests made by the callback.
name | The name of the specified header field. |
|
inherited |
Executes a key request.
uuid | The UUID of the content protection scheme.12 |
request | The request. |
MediaDrmCallbackException | If an error occurred executing the request. |
Implemented in OTVConnectMediaDrmCallback.
byte [] executeKeyRequest | ( | UUID | uuid, |
KeyRequest | request | ||
) | throws MediaDrmCallbackException |
Executes a key request.
uuid | The UUID of the content protection scheme. |
request | The request. |
MediaDrmCallbackException | If an error occurred executing the request. |
|
protectedinherited |
A utility for synchronously sending a POST
HTTP message.
Used for requesting the licence via HTTP/HTTPS. Can be overridden if special operations are required.
url | The URL address to post to. |
data | Optional additional data to send with the POST message. |
requestProperties | A map of key-value HTTP header entries to use in the message |
IOException | If an error occurred executing the request. |
|
inherited |
Executes a provisioning request.
uuid | The UUID of the content protection scheme. |
request | The request. |
MediaDrmCallbackException | If an error occurred executing the request. |
Implemented in OTVConnectMediaDrmCallback.
|
inherited |
Executes a provisioning request.
uuid | The UUID of the content protection scheme. |
request | The request. |
MediaDrmCallbackException | If an error occurred executing the request. |
|
protectedinherited |
Helper method to generate MediaDrmCallbackException with IOException.
exception | the IOException |
|
inherited |
Gets byte array properties for media drm.
The default value is null.
Implements OTVMediaDrmCallback.
|
inherited |
Gets properties for media drm.
The default value is null.
Implements OTVMediaDrmCallback.
|
inherited |
Returns the DRM type the callback instance is configured for.
Implements OTVMediaDrmCallback.
|
inherited |
|
inherited |
Implements OTVMediaDrmCallback.
|
inherited |
Sets a drm byte array property.
name | The name of the property. |
value | The value of the byte array property. |
|
inherited |
Sets a drm property.
name | The name of the property. |
value | The value of the property. |
|
inherited |
Set which DRM system to be used to play the stream.
If not explicitly set, the default is OTV_DRMTYPE_WIDEVINE.
xDrmType | "Widevine" , "PlayReady" , "Connect" or "Wiseplay" |
|
inherited |
Sets an optional parameter for key requests.
name | The name of the option. |
value | The value of the option. |
|
inherited |
Sets a header for key requests made by the callback.
name | The name of the header field. |
value | The value of the field. |
|
inherited |
Set if the DRM system supports multiple sessions.
If not explicitly set, the default is false.
xIsMultiSession | true if the DRM system should support multiple sessions. |
|
inherited |
Sets SSLSocketFactory for Mutual Authentication.
xSslSocketFactory | SSLSocketFactory instance |
|
inherited |
Define DRM type for Connect.
|
inherited |
Define DRM type for PlayReady.
|
inherited |
Defined DRM type for Widevine.
|
inherited |
Define DRM type for Connect.