PRM-protected playback with CCL plug-in
The CONNECT Player SDK provides tools to enable playback of NAGRA Persistent Rights Management (PRM) encrypted streams using NAGRA CONNECT - the hardware implementation of NAGRA PRM.
Handling of PRM-encrypted content requires the device hardware, for example PRM-enabled Android TV set-top boxes, to support NAGRA Connect, and does not require a PRM-enabled version of the CONNECT Player SDK .aar file. Such devices use Android's MediaDrm API, extended with the Connect Client Library (CCL).
Client code will use the OTVConnectManager
provided by the CONNECT Player SDK, which in turn handles access to the CCL. A specific Operator Vault (OpVault) that matches customers' PRM-enabled license servers is required to use Connect.
unlockJAVADescramblingForHybridMode
flag set to true
; see Prerequisites.
The OTVConnectManager
also handles device provisioning which enables the device to use NAGRA Connect.
Enabling the playback of encrypted streams comprises the following steps:
- Connect Preparation - An
OTVConnectManager
is created and is configured with the appropriate OpVault and anOTVMediaDrmCallback
that interacts with the provisioning and license servers. - Device Provisioning status - The
OTVConnectManager
determines if the device is provisioned for this operator. If it is not, provisioning must be performed. - Device Provisioning (if not provisioned) - The
OTVConnectManager
sets up a provisioning request. Its data is sent to the provisioning server, located at the URL specified in the request. The response is then processed and stored by the CCL. - Setting the stream token - Specific for each stream, providing the token for requesting a licence.
Provisioning is 'per device, per operator', and must be done once for each operator's application (containing that operator's OpVault) installed on that device.
OTVConnectManager
The OTVConnectManager
handles device provisioning and license requests. It obtains provisioning and key requests, provides request data to the appropriate server (via the OTVMediaDrmCallback
provided) and then uses the response, with the help of the CCL to handle licenses and decrypt the content. It is implemented as a singleton and so cannot be instantiated directly; its lifecycle is controlled through the createInstance()
, getInstance()
and releaseInstance()
methods.
OTVConnectMediaDrmCallback
The SDK provides OTVConnectMediaDrmCallback
as the default implementation of the OTVMediaDrmCallback
interface, which handles communication with the provisioning and license servers, and is used in the example code provided.
Rather than directly implementing the OTVMediaDrmCallback
interface, OTVConnectMediaDrmCallback
implements the abstract OTVCommonMediaDrmCallback
class, which has a single constructor with the parameter defaultLicenseUrl
.
Some licence servers expect extra information from the application. This information is a blob of data in a specific data field within the key request challenge data coming from the CCL and sent to the license server. The CCL library can be configured to add that extra data by setting an option in the OTVConnectMediaDrmCallback
class instance. For example, configuring the clientData
and/or protectedClientData
fields with application data will add this data to key requests' challenge data as third-party applicationClearData
and applicationProtectedData
data fields respectively.
For more information, please refer to your licence server documentation.
OTVConnectProvisionListener
The OTVConnectProvisionListener
interface must be implemented in client code to handle the result of each provisioning attempt, via the onProvisionCompleted()
and onProvisionFailure()
methods. The example code provides a basic implementation that displays the provisioning result via a toast message, and also starts playback if provisioning is successful.
Prerequisites
The following are required:
- The device supports NAGRA CONNECT.
- The Operator Vault for working with the provisioning server is present and configured with the
unlockJAVADescramblingForHybridMode
flag set totrue
.