Class: shaka.polyfill.EmeEncryptionScheme

Members

originalRMKSA_ :function(this:Navigator, string, !Array<!MediaKeySystemConfiguration>): !Promise<!MediaKeySystemAccess>

The original requestMediaKeySystemAccess, before we patched it.
Type:
  • function(this:Navigator, string, !Array<!MediaKeySystemConfiguration>): !Promise<!MediaKeySystemAccess>
Source:

Methods

filterCapabilities_(capabilities, supportedSchemenullable) → {!Array<!MediaKeySystemMediaCapability>|undefined}

Filters out capabilities that don't match the supported encryption scheme.
Parameters:
Name Type Attributes Description
capabilities !Array<!MediaKeySystemMediaCapability> | undefined An array of capabilities, or null or undefined.
supportedScheme string <nullable>
The encryption scheme that we think is supported by the key system.
Source:
Returns:
A filtered array of capabilities based on |supportedScheme|. May be undefined if the input was undefined.
Type
!Array<!MediaKeySystemMediaCapability> | undefined

install()

Installs the polyfill. To avoid the possibility of extra user prompts, this will shim EME so long as it exists, without checking support for encryptionScheme upfront. The support check will happen on-demand the first time EME is used.
Source:

polyfillRMKSA_(keySystem, supportedConfigurationsnon-null) → {Promise<!MediaKeySystemAccess>}

A polyfill for navigator.requestMediaKeySystemAccess to handle the encryptionScheme field in browsers that don't support it. It uses the user-agent string to guess what encryption schemes are supported, then those guesses are used to filter videoCapabilities and audioCapabilities and reject unsupported schemes.
This:
  • Navigator
Parameters:
Name Type Description
keySystem string The key system ID.
supportedConfigurations Array<!MediaKeySystemConfiguration> An array of supported configurations the application can use.
Source:
Returns:
A Promise to a MediaKeySystemAccess instance.
Type
Promise<!MediaKeySystemAccess>

probeRMKSA_(keySystem, supportedConfigurationsnon-null) → {Promise<!MediaKeySystemAccess>}

A shim for navigator.requestMediaKeySystemAccess to check for encryptionScheme support. Only used until we know if the browser has native support for the encryptionScheme field.
This:
  • Navigator
Parameters:
Name Type Description
keySystem string The key system ID.
supportedConfigurations Array<!MediaKeySystemConfiguration> An array of supported configurations the application can use.
Source:
Returns:
A Promise to a MediaKeySystemAccess instance.
Type
Promise<!MediaKeySystemAccess>