CONNECT Player SDK 5 for Apple (FPS)
5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.8.x 5.7.x 5.6.x 5.5.x 5.4.x 5.3.x 5.2.x 5.1.x 5.0.x
5.14.x 5.13.x 5.12.x 5.11.x 5.10.x 5.9.x 5.8.x 5.7.x 5.6.x 5.5.x 5.4.x 5.3.x 5.2.x 5.1.x 5.0.x

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.

    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).

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

        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:

        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.