OTVLicenseDelegate

@objc
public protocol OTVLicenseDelegate : NSObjectProtocol

The OTVLicenseDelegate protocol defines methods that allows your code to handle the FPS request while playing a FairPlay encrypted stream.

  • Returns the scheme that the integrator uses in the EXT-X-KEY URI.

    Declaration

    Swift

    func scheme() -> String?

    Return Value

    String: Of Scheme.

  • Returns the content identifier that the integrator uses in the server side.

    Declaration

    Swift

    func contentIdentifier(url: URL) -> Data?

    Parameters

    url

    URL The URL is the EXT-X-KEY URI, which may contain the information about the content identifier. (The integrator decides what this parameter contains.)

    Return Value

    Data contains the content identifier.

  • Returns the certificate that integrator uses in the server side.

    Declaration

    Swift

    func certificate() -> Data?

    Return Value

    Data contains the certificate.

  • Returns the Content Key Context (CKC) message from the server side that is used to decrypt the FairPlay stream.

    Remark

    This delegate function only supports one asset playout. Customers should implement the ckcMessageWithID(spc:assetID:) when playback multistream in concurrency.

    Declaration

    Swift

    func ckcMessage(spc: Data) -> Data?

    Parameters

    spc

    Data The Server Playback Context (SPC) is the payload produced from AVFoundation.

    Return Value

    Data contains the Content Key Context (CKC) message.

  • ckcMessageWithID(spc:assetID:) Default implementation

    Returns the Content Key Context (CKC) message from the server side that is used to decrypt the FairPlay stream.

    Default Implementation

    Declaration

    Swift

    func ckcMessageWithID(spc: Data, assetID: String) -> Data?

    Parameters

    spc

    Data The Server Playback Context (SPC) is the payload produced from AVFoundation.

    assetID

    contentID from HLS Playlist. Multi playback should depend on the value to request different license.

    Return Value

    Data contains the Content Key Context (CKC) message.

  • Returns the Content Key Context (CKC) message from the server side that is used to decrypt the FairPlay stream.

    Remark

    In deployments where Secure Session Management is enforced by a short duration FPS license (“license-renew”), the session and keyRequest values may be saved and later used to trigger renewal of the expiring license using: keySession.renewExpiringResponseData(for: keyRequest)

    Default Implementation

    Declaration

    Swift

    func ckcMessageWith(spc: Data, assetID: String, session: AVContentKeySession, keyRequest: AVContentKeyRequest) -> Data?

    Parameters

    spc

    Data The Server Playback Context (SPC) is the payload produced from AVFoundation.

    assetID

    contentID from HLS Playlist. Multi playback should depend on the value to request different license.

    session

    the AVContentKeySession for which the CKC is required

    keyRequest

    the originating AVContentKeyRequest

    Return Value

    Data contains the Content Key Context (CKC) message.