To test this feature and view the example code, please see the Android SDK 5 Example Code Quick Start guide.
NAGRA CONNECT is the hardware implementation of NAGRA PRM. The device hardware handles PRM-encrypted content, for example, PRM-enabled Android TV set-top boxes, 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 uses the
OTVConnectManager provided by the CONNECT Player SDK, which in turn handles access to the CCL. A specific Operator Vault (OpVault) that matches your PRM-enabled licence servers is also used and must be configured with the
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
OTVConnectManageris created and configured with the appropriate OpVault and an
OTVMediaDrmCallbackthat interacts with the provisioning and license servers.
- Device Provisioning status - The
OTVConnectManagerdetermines if the device is provisioned for this operator. If it is not, provisioning must be performed.
- Device Provisioning (if not provisioned) - The
OTVConnectManagersets 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 application (containing your OpVault) installed on that device.
OTVConnectManager handles device provisioning and license requests. It obtains provisioning and key requests, provides request data to the appropriate server (via the
OTVMediaDrmCallback) 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
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.
Rather than directly implementing the
OTVConnectMediaDrmCallback implements the abstract
OTVCommonMediaDrmCallback class, which has a single constructor with the parameter
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 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
protectedClientData fields with application data will add this data to key requests' challenge data as third-party
applicationProtectedData data fields respectively.
For more information, please refer to your licence server documentation.
OTVConnectProvisionListener interface must be implemented in client code to handle the result of each provisioning attempt via the
onProvisionFailure() methods. The example code provides a basic implementation that displays the provisioning result via a toast message and starts playback if provisioning is successful.
The device supports NAGRA CONNECT.
The Operational Vault for working with the provisioning server is present and configured with the
unlockJAVADescramblingForHybridMode flag set to