Playback of PRM encrypted content
To test this feature and view the example code, please see the Apple (FPS) SDK 5 Example Code Quick Start guide.
NAGRA’s proprietary DRM, Persistent Rights Management (PRM), can be enabled in the CONNECT Player SDK for FPS with the optional OPYSDKPRM framework.
PRM support is not compatible with bitcode, so your iOS application will not be able to support bitcode. For this reason, PRM is not available on tvOS (as bitcode is a requirement on tvOS).
Prerequisites
Set up use of the OPYSDKFPS framework as described in the Apple (FPS) SDK 5 Integration Guide.
The diagnostic tool Address Sanitizer must be switched off to avoid issues that will crash the simulator due to the KOP hardening of the PRM SDK. (In Xcode project from menu: Product > Scheme > Edit Scheme > Run > Diagnostics > deselect Address Sanitizer). This only affects the integration version, not the production one.
Link with OPYSDKPRM
To enable PRM support in your iOS application, you must link the OPYSDKPRM framework into your iOS application in the same way as for the OPYSDKFPS framework.
The versions of both the OPYSDKFPS and OPYSDKPRM frameworks should match otherwise the resulting behaviour is undefined.
Disable bitcode
To build successfully, you must disable bitcode in your application’s build settings.
Initialise PAK
For the player to be able to decrypt PRM content, you must use OTVPRMManager
to connect to your PRM server and initialise PAK.
You will need an appropriate class that conforms to the
OTVPRMDelegate
protocol, which will communicate with your PRM server. If you have an SSP PRM server you can create anOTVNonSilentDirectDelegate
and pass it toOTVPRMManager
.CODElet serverURL = URL(string: "http://...") // the URL to your PRM server let delegate = OTVNonSilentDirectDelegate(serverURL: serverURL) // you are not required to retain this reference as OTVPRMManager will hold a strong reference
Now that you have created your delegate, you can initialise PAK with the following call:
CODE// Load your opvault.json guard let opvaultPath = Bundle.main.url(forResource: "opvault", withExtension: "json"), let opvaultData = try? Data(contentsOf: opvaultPath) else { NSLog("ERROR: Failed to load opvault.json") return } OTVPRMManager.setLogging(.debug) // set log level to debug to get debug info let privateDataForInitlaization = "" // any data required to pass to your PRM server on initialisation of PAK if (!OTVPRMManager.shared().preparePAK(withOpvault: opvaultData, privateDataForInitialization: privateDataForInitialization, licensePredelivery: false, delegate: delegate) { success in if success { // you can now start playing back PRM content } else { // handle initialisation error } }) { // handle preparation error }
The licensePredelivery
parameter can be set to true
to download any licenses available for pre-delivery on your PRM server.
Playback
For PRM playback, you must create an OTVPRMAVURLAsset
and initialise an OTVAVPlayerItem
with it. This can then be used to create a player (or to replace an existing player’s current item).
To get encrypted content playback, you also need to attach the OTVPRMAVURLAsset
instance to OTVPRMManager
.
let prmAsset = OTVPRMAVURLAsset(url: streamURL)
let customData = "" // custom data is used for fetching license when it is required.
OTVPRMManager.shared().attach(toPRMAsset: prmAsset, withCustomData: customData)
let item = OTVAVPlayerItem(asset: prmAsset)
let player = OTVAVPlayer(playerItem: item
You can now playback your PRM encrypted content in the same way as any other content:
player.play()