Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WidevineModularDRMConfig

Hierarchy

  • WidevineModularDRMConfig

Index

Properties

Optional LA_URL

LA_URL: undefined | string

An URL to the Widevine license server for this content (optional). Can be defined in the configuration or taken out from the video manifest if defined there. If the config URL is defined it has precedence over the URL defined in the manifest.

Optional audioRobustness

audioRobustness: undefined | string

Sets the robustness level for audio. The robustness specifies the security level of the DRM key system. If a string specifies a higher security level than the system is able to support playback will fail. The lowest security level is the empty string. The strings are specific to a key system and currently only the values for Widevine are known based on the Chromium source code:

  • SW_SECURE_CRYPTO
  • SW_SECURE_DECODE
  • HW_SECURE_CRYPTO
  • HW_SECURE_DECODE
  • HW_SECURE_ALL

Optional headers

headers: HttpHeaders

An object which specifies custom HTTP headers.

BuyDRM/KeyOS Specific Example:

headers : {
  customdata: 'AUTHENTICATION-XML'
}

DRMtoday by castLabs Specific Example:

headers : {
  'dt-custom-data': 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
}

Optional licenseRequestRetryDelay

licenseRequestRetryDelay: undefined | number

Specifies how long in milliseconds should be waited before a license request should be retried.

Optional maxLicenseRequestRetries

maxLicenseRequestRetries: undefined | number

Specifies how often a license request should be retried if was not successful (e.g. the license server was not reachable). Default is 1. 0 disables retries.

Optional mediaKeySystemConfig

mediaKeySystemConfig: MediaKeySystemConfiguration

An object which allows to specify configuration options of the DRM key system, such as distinctiveIdentifier or persistentState (refer to MediaKeySystemConfiguration for more details). Please note that these settings need to be supported by the browser or playback will fail.

Optional prepareLicense

prepareLicense: undefined | function

A function which gets the widevine license from the server. Is needed for custom widevine servers where not only the license itself is responded, but instead the license is e.g. wrapped in an JSON object.

DRMtoday by castLabs Specific Example:

prepareLicense : (licenseObj) => {
  const license = {license: licenseObj.license};

  try {
    const drmTodayObj = JSON.parse(String.fromCharCode.apply(null, licenseObj.license));
    if (drmTodayObj && drmTodayObj.status && drmTodayObj.license) {
      if (drmTodayObj.status === 'OK') {
        const str = window.atob(drmTodayObj.license);
        const bufView = new Uint8Array(new ArrayBuffer(str.length));
        for (let i = 0; i < str.length; i++) {
          bufView[i] = str.charCodeAt(i);
        }
        license.license = bufView;
      } else {
        // license not okay
      }
    } else {
      // no valid DRMtoday license
    }
  } catch (e) {
    // no valid DRMtoday license
  }
  return license;
};
param

Optional prepareMessage

prepareMessage: undefined | function

A function to prepare the license acquisition message which will be sent to the license acquisition server. As many DRM provider expect different, vendor-specific message, this can be done using this user-defined function (optional / depending on the DRM server). The parameter is the key message event object as given by the Widevine Content Decryption Module (CDM).

Default Implementation Example:

prepareMessage : (keyMessage) => {
  return keyMessage.message;
}

This will send just the actual key message as provided by the CDM to the license server.

Vualto Specific Example:

prepareMessage : (keyMessage) => {
  return JSON.stringify({
    token: VUALTO_TOKEN,
    drm_info: Array.apply(null, new Uint8Array(keyMessage.message)),
    kid: 'VUALTO_KID'
  });
}

This will send a JSON object to the license server. This object contains the Vualto-specific token (token), a pre-processed key message (drm_info), and the key ID (kid).

param

Optional serverCertificate

serverCertificate: ArrayBuffer

A server certificate to be used to encrypt messages to the DRM license server. The contents are Key System-specific. It allows an application to proactively provide a server certificate to implementations that support it to avoid the additional round trip, should the Content Decryption Module (CDM) request it. It is intended as an optimization, and applications are not required to use it. If not set but required by the CDM, the CDM will request a certificate from the DRM license server.

Optional videoRobustness

videoRobustness: undefined | string

Sets the robustness level for video. The robustness specifies the security level of the DRM key system. If a string specifies a higher security level than the system is able to support playback will fail. The lowest security level is the empty string. The strings are specific to a key system and currently only the values for Widevine are known based on the Chromium source code:

  • SW_SECURE_CRYPTO
  • SW_SECURE_DECODE
  • HW_SECURE_CRYPTO
  • HW_SECURE_DECODE
  • HW_SECURE_ALL

Optional withCredentials

withCredentials: undefined | false | true

Set to true to send credentials such as cookies or authorization headers along with the license requests. Default is false.

Generated using TypeDoc