Represents a FairPlay Streaming DRM config.

interface FairplayConfig {
    certificateRequestHeaders?: Record<string, string>;
    certificateUrl?: string;
    licenseRequestHeaders?: Record<string, string>;
    licenseUrl: string;
    prepareCertificate?: ((certificate) => string);
    prepareContentId?: ((contentId) => string);
    prepareLicense?: ((license) => string);
    prepareLicenseServerUrl?: ((licenseServerUrl) => string);
    prepareMessage?: ((message, assetId) => string);
    prepareSyncMessage?: ((syncMessage, assetId) => string);
}

Properties

certificateRequestHeaders?: Record<string, string>

A dictionary to specify custom HTTP headers for the certificate request.

certificateUrl?: string

The URL to the FairPlay Streaming certificate of the license server.

licenseRequestHeaders?: Record<string, string>

A dictionary to specify custom HTTP headers for the license request.

licenseUrl: string

The DRM license acquisition URL.

prepareCertificate?: ((certificate) => string)

A block to prepare the loaded certificate before building SPC data and passing it into the system. This is needed if the server responds with anything else than the certificate, e.g. if the certificate is wrapped into a JSON object. The server response for the certificate request is passed as parameter “as is”.

Note that both the passed certificate data and this block return value should be a Base64 string. So use whatever solution suits you best to handle Base64 in React Native.

Type declaration

    • (certificate): string
    • Parameters

      • certificate: string

        Base64 encoded certificate data.

      Returns string

Returns

The processed Base64 encoded certificate.

prepareContentId?: ((contentId) => string)

A block to prepare the contentId, which is sent to the FairPlay Streaming license server as request body, and which is used to build the SPC data. As many DRM providers expect different, vendor-specific messages, this can be done using this user-defined block. The parameter is the skd:// URI extracted from the HLS manifest (m3u8) and the return value should be the contentID as string.

Type declaration

    • (contentId): string
    • Parameters

      • contentId: string

        Extracted content id string.

      Returns string

Returns

The processed contentId.

prepareLicense?: ((license) => string)

A block to prepare the loaded CKC Data before passing it to the system. This is needed if the server responds with anything else than the license, e.g. if the license is wrapped into a JSON object.

Note that both the passed license data and this block return value should be a Base64 string. So use whatever solution suits you best to handle Base64 in React Native.

Type declaration

    • (license): string
    • Parameters

      • license: string

        Base64 encoded license data.

      Returns string

Returns

The processed Base64 encoded license.

prepareLicenseServerUrl?: ((licenseServerUrl) => string)

A block to prepare the URI (without the skd://) from the HLS manifest before passing it to the system.

Type declaration

    • (licenseServerUrl): string
    • Parameters

      • licenseServerUrl: string

        License server URL string.

      Returns string

Returns

The processed license server URL string.

prepareMessage?: ((message, assetId) => string)

A block to prepare the data which is sent as the body of the POST license request. As many DRM providers expect different, vendor-specific messages, this can be done using this user-defined block.

Note that both the passed message data and this block return value should be a Base64 string. So use whatever solution suits you best to handle Base64 in React Native.

Type declaration

    • (message, assetId): string
    • Parameters

      • message: string

        Base64 encoded message data.

      • assetId: string

        Stream asset ID.

      Returns string

Returns

The processed Base64 encoded message.

prepareSyncMessage?: ((syncMessage, assetId) => string)

A block to prepare the data which is sent as the body of the POST request for syncing the DRM license information.

Note that both the passed syncMessage data and this block return value should be a Base64 string. So use whatever solution suits you best to handle Base64 in React Native.

Type declaration

    • (syncMessage, assetId): string
    • Parameters

      • syncMessage: string
      • assetId: string

        Asset ID.

      Returns string

Returns

The processed Base64 encoded sync message.