Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WidevineModularDRMConfig

Hierarchy

  • WidevineModularDRMConfig

Index

Properties

LA_URL

LA_URL: string

An URL to the Widevine license server for this content (mandatory for widevine).

audioRobustness

audioRobustness: 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: Header[]

An array of objects which specify custom HTTP headers.

BuyDRM/KeyOS Specific Example:

headers : [{
  name: 'customdata',
  value: 'AUTHENTICATION-XML'
}]

DRMtoday by castLabs Specific Example:

headers : [{
  name: 'dt-custom-data',
  value: 'INSERT-YOUR-BASE64-ENCODED-CUSTOMDATA'
}]

Optional licenseRequestRetryDelay

licenseRequestRetryDelay: number

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

Optional maxLicenseRequestRetries

maxLicenseRequestRetries: 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: Object

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: 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 : function(licenseObj) {
  var license = {license: licenseObj.license};

  try {
    var drmTodayObj = JSON.parse(String.fromCharCode.apply(null, licenseObj.license));
    if (drmTodayObj && drmTodayObj.status && drmTodayObj.license) {
      if (drmTodayObj.status === 'OK') {
        var str = window.atob(drmTodayObj.license);
        var bufView = new Uint8Array(new ArrayBuffer(str.length));
        for (var 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

Type declaration

    • (licenseObject: any): any
    • Parameters

      • licenseObject: any

      Returns any

Optional prepareMessage

prepareMessage: 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 : function (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 : function (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

Type declaration

    • (keyMessage: any): any
    • Parameters

      • keyMessage: any

      Returns any

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.

videoRobustness

videoRobustness: 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: boolean

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

Generated using TypeDoc