JWDRMContentKeyDataSource

@objc
public protocol JWDRMContentKeyDataSource

This dataSource requests the necessary data to decrypt protected content following the DRM standard.

Note

Currently, only Apple FairPlay Streaming (FPS) protocol is supported.
  • Called when the JWPlayerKit needs to decrypt the current protected content and requires a content identifier from the application to start the decryption process.

    Declaration

    Swift

    func contentIdentifierForURL(_ url: URL, completionHandler handler: @escaping (_ contentIdentifier: Data?) -> Void)

    Parameters

    url

    The url of the resource being loaded.

    handler

    The handler block used to provide the JWPlayerKit with the content identifier.

    contentIdentifier

    The case of Apple FairPlay this is an opaque identifier for the content and is needed to obtain the SPC (Server Playback Context) message from the operating system.

  • Called when the JWPlayerKit needs to decrypt the current protected content and requires an application identifier from the application to start the decryption process.

    Declaration

    Swift

    func appIdentifierForURL(_ url: URL, completionHandler handler: @escaping (_ appIdentifier: Data?) -> Void)

    Parameters

    url

    The url of the resource being loaded.

    handler

    The handler block used to provide the JWPlayerKit with the application identifier.

    appIdentifier

    The case of Apple FairPlay this is the Application Certificate data you receive after registering an FPS playback app.

  • Called when the JWPlayerKit needs to decrypt the current protected content and requires a content key from the application to start the decryption process.

    Declaration

    Swift

    func contentKeyWithSPCData(_ spcData: Data, completionHandler handler: @escaping (_ ckcData: Data?, _ renewalDate: Date?, _ contentType: String?) -> Void)

    Parameters

    spcData

    The key request data that must be transmitted to the key vendor to obtain the content key. In the case of Apple FairPlay this is the SPC (Server Playback Context) message from the operating system which must be sent to the Key Server in order to obtain the CKC (Content Key Context) message.

    handler

    The completion block used to provide the JWPlayerKit with the Server Response.

    ckcData

    The case of Apple FairPlay, the response is the content key wrapped inside an encrypted Content Key Context (the CKC message) returned by the key server.

    renewalDate

    In the case of Apple FairPlay, a date for renewal of resources that expire can be specified by passing a renewal date in the completion block.

    contentType

    The UTI indicating the type of data contained by the response. When specifying a renewalDate the content type should be specified.