EMEController
Extends:
Controller to deal with encrypted media extensions (EME)
Constructor Summary
Public Constructor | ||
public |
constructor(hls: Hls) |
Member Summary
Public Members | ||
public |
|
|
public get |
|
Private Members | ||
private |
_config: * |
|
private |
_emeEnabled: * |
|
private |
|
|
private |
|
|
private |
_media: * |
|
private |
_mediaKeysList: *[] |
|
private |
_onMediaEncrypted(e: *): * |
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
getLicenseServerUrl(keySystem: string): string |
|
public |
onManifestParsed(data: undefined) |
|
public |
onMediaAttached(data: undefined) |
|
public |
|
Private Methods | ||
private |
_attemptKeySystemAccess(keySystem: KeySystems, audioCodecs: undefined, videoCodecs: undefined) Requests access object and adds it to our list upon success |
|
private |
_attemptSetMediaKeys(mediaKeys: *) |
|
private |
_createLicenseXhr(url: string, keyMessage: ArrayBuffer, callback: function): XMLHttpRequest |
|
private |
_generateLicenseRequestChallenge(keysListItem: MediaKeysListItem, keyMessage: ArrayBuffer): ArrayBuffer |
|
private |
_generateRequestWithPreferredKeySession(initDataType: *, initData: *) |
|
private |
_onKeySessionMessage(keySession: MediaKeySession, message: ArrayBuffer) |
|
private |
_onLicenseRequestReadyStageChange(xhr: XMLHttpRequest, url: string, keyMessage: ArrayBuffer, callback: function) |
|
private |
_onMediaKeySystemAccessObtained(keySystem: KeySystems, mediaKeySystemAccess: MediaKeySystemAccess): Promise Handles obtaining access to a key-system |
|
private |
Handles key-creation (represents access to CDM). |
|
private |
_onNewMediaKeySession(keySession: *) |
|
private |
_requestLicense(keyMessage: *, callback: *) |
Public Constructors
Public Members
public mediaKeysPromise: * source
public get requestMediaKeySystemAccess: * source
Private Members
private _config: * source
private _emeEnabled: * source
private _licenseXhrSetup: * source
private _media: * source
private _mediaKeysList: *[] source
private _onMediaEncrypted(e: *): * source
private _requestMediaKeySystemAccess: * source
private _widevineLicenseUrl: * source
Public Methods
public getLicenseServerUrl(keySystem: string): string source
Params:
Name | Type | Attribute | Description |
keySystem | string | Identifier for the key-system, see |
Throw:
* |
if a unsupported keysystem is passed |
public onMediaDetached() source
Private Methods
private _attemptKeySystemAccess(keySystem: KeySystems, audioCodecs: undefined, videoCodecs: undefined) source
Requests access object and adds it to our list upon success
private _attemptSetMediaKeys(mediaKeys: *) source
Params:
Name | Type | Attribute | Description |
mediaKeys | * |
private _createLicenseXhr(url: string, keyMessage: ArrayBuffer, callback: function): XMLHttpRequest source
Params:
Name | Type | Attribute | Description |
url | string | License server URL |
|
keyMessage | ArrayBuffer | Message data issued by key-system |
|
callback | function | Called when XHR has succeeded |
Return:
XMLHttpRequest | Unsent (but opened state) XHR object |
Throw:
* |
if XMLHttpRequest construction failed |
private _generateLicenseRequestChallenge(keysListItem: MediaKeysListItem, keyMessage: ArrayBuffer): ArrayBuffer source
Params:
Name | Type | Attribute | Description |
keysListItem | MediaKeysListItem | ||
keyMessage | ArrayBuffer |
Throw:
* |
if KeySystem is unsupported |
private _generateRequestWithPreferredKeySession(initDataType: *, initData: *) source
Params:
Name | Type | Attribute | Description |
initDataType | * | ||
initData | * |
private _onKeySessionMessage(keySession: MediaKeySession, message: ArrayBuffer) source
Params:
Name | Type | Attribute | Description |
keySession | MediaKeySession | ||
message | ArrayBuffer |
private _onLicenseRequestReadyStageChange(xhr: XMLHttpRequest, url: string, keyMessage: ArrayBuffer, callback: function) source
Params:
Name | Type | Attribute | Description |
xhr | XMLHttpRequest | ||
url | string | License server URL |
|
keyMessage | ArrayBuffer | Message data issued by key-system |
|
callback | function | Called when XHR has succeeded |
private _onMediaKeySystemAccessObtained(keySystem: KeySystems, mediaKeySystemAccess: MediaKeySystemAccess): Promise source
Handles obtaining access to a key-system
Params:
Name | Type | Attribute | Description |
keySystem | KeySystems | ||
mediaKeySystemAccess | MediaKeySystemAccess |
private _onMediaKeysCreated() source
Handles key-creation (represents access to CDM). We are going to create key-sessions upon this for all existing keys where no session exists yet.
private _onNewMediaKeySession(keySession: *) source
Params:
Name | Type | Attribute | Description |
keySession | * |
private _requestLicense(keyMessage: *, callback: *) source
Params:
Name | Type | Attribute | Description |
keyMessage | * | ||
callback | * |