Skip to main content

Enabling playback of FPS encrypted content

To enable FairPlay Streaming in your app:

  1. Create a new Xcode project and then implement the OTVLicenseDelegate protocol to provide the FPS-specific information that the player needs. This delegate needs to authenticate both the stream and the license server.

    CODE
    final class OTVDelegate: NSObject, OTVLicenseDelegate {
    func contentIdentifier(url: URL) -> Data? {}
    func certificate() -> Data? {}
    func ckcMessage(spc: Data) -> Data? {}
    func scheme() -> String? {}
    }
  2. Instantiate an OTVDRMManager object in OPYFPSSDK to do all the negotiation between OTVAVPlayer and your app (via the OTVLicenseDelegate implementation).

    CODE
    private let drmManager = OTVDRMManager:shared
  3. Register the delegate to the OTVDRMManager:

    CODE
        private let licenseDelegate = OTVDelegate()
        drmManager.setLicenseDelegate(licenseDelegate)
  4. Instantiate an OTVAVPlayer using either the content URL or an OTVAVPlayerItem object and call its init() method:

    CODE
        private let player = OTVAVPlayer()
        player.init(item)
        /// or:
        private let player = OTVAVPlayer()
        player.init(url)

You should now be able to use the OTVAVPlayer object to playback FPS-encrypted content in the same way as with AVPlayer.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.