Class: shaka.util.FairPlayUtils

A set of FairPlay utility functions.

Constructor

new FairPlayUtils()

A set of FairPlay utility functions.

Source:

Methods

commonFairPlayResponse(type, response)

Common FairPlay response transform for some DRMs providers.
Parameters:
Name Type Description
type shaka.net.NetworkingEngine.RequestType
response shaka.extern.Response
Source:

defaultGetContentId(initDatanon-null) → {string}

Using the default method, extract a content ID from the init data. This is based on the FairPlay example documentation.
Parameters:
Name Type Description
initData BufferSource
Source:
Returns:
Type
string

initDataTransform(initDatanon-null, contentId, certnullable) → {Uint8Array}

Transforms the init data buffer using the given data. The format is:
[4 bytes] initDataSize
[initDataSize bytes] initData
[4 bytes] contentIdSize
[contentIdSize bytes] contentId
[4 bytes] certSize
[certSize bytes] cert
Parameters:
Name Type Attributes Description
initData BufferSource
contentId BufferSource | string
cert BufferSource <nullable>
The server certificate; this will throw if not provided.
Source:
Returns:
Type
Uint8Array

isFairPlaySupported() → {Promise.<boolean>}

Check if FairPlay is supported.
Source:
Returns:
Type
Promise.<boolean>

spcFairPlayRequest(type, request)

SPC FairPlay request.
Parameters:
Name Type Description
type shaka.net.NetworkingEngine.RequestType
request shaka.extern.Request
Source: