EMEController
Extends:
Controller to deal with encrypted media extensions (EME)
Constructor Summary
Public Constructor | ||
public |
constructor(hls: Hls) |
Member Summary
Public Members | ||
public get |
|
Private Members | ||
private |
_emeEnabled: * |
|
private |
|
|
private |
|
|
private |
|
|
private |
_media: * |
|
private |
|
|
private |
|
|
private |
_mediaKeysList: *[] |
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
getLicenseServerUrl(keySystem: string): string |
|
public |
onManifestParsed(data: *) |
|
public |
onMediaAttached(data: *) |
Private Methods | ||
private |
Requests access object and adds it to our list upon success |
|
private |
|
|
private |
_createLicenseXhr(url: string, keyMessage: ArrayBuffer, callback: function): XMLHttpRequest |
|
private |
_generateLicenseRequestChallenge(keysListItem: object, keyMessage: ArrayBuffer): ArrayBuffer |
|
private |
|
|
private |
_onKeySessionMessage(keySession: *, message: *) |
|
private |
_onLicenseRequestReadyStageChange(xhr: XMLHttpRequest, url: string, keyMessage: ArrayBuffer, callback: function) |
|
private |
_onMediaEncrypted(initDataType: *, initData: *) |
|
private |
_onMediaKeySystemAccessObtained(keySystem: string, mediaKeySystemAccess: MediaKeySystemAccess) Handles obtaining access to a key-system |
|
private |
Handles key-creation (represents access to CDM). |
|
private |
_onNewMediaKeySession(keySession: *) |
|
private |
_requestLicense(keyMessage: *, callback: *) |
Inherited Summary
From class EventHandler | ||
public |
|
|
public |
hls: * |
|
public |
|
|
public |
destroy() |
|
public |
isEventHandler(): * |
|
public |
onEvent(event: *, data: *) arguments: event (string), data (any) |
|
public |
onEventGeneric(event: *, data: *) |
|
public |
|
|
public |
|
|
public |
|
|
public |
|
Public Constructors
public constructor(hls: Hls) source
Override:
EventHandler#constructorParams:
Name | Type | Attribute | Description |
hls | Hls | Our Hls.js instance |
Public Members
public get requestMediaKeySystemAccess: * source
Private Members
private _emeEnabled: * source
private _licenseXhrSetup: * source
private _media: * source
private _mediaEncryptionInitData: * source
private _mediaEncryptionInitDataType: * source
private _mediaKeysList: *[] 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 |
public onManifestParsed(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |
public onMediaAttached(data: *) source
Params:
Name | Type | Attribute | Description |
data | * |
Private Methods
private _attemptKeySystemAccess(keySystem: string, audioCodecs: Array<string>, videoCodecs: Array<string>) source
Requests access object and adds it to our list upon success
private _attemptSetMediaKeys() source
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 |
private _generateLicenseRequestChallenge(keysListItem: object, keyMessage: ArrayBuffer): ArrayBuffer source
Params:
Name | Type | Attribute | Description |
keysListItem | object | ||
keyMessage | ArrayBuffer |
private _generateRequestWithPreferredKeySession() source
private _onKeySessionMessage(keySession: *, message: *) source
Params:
Name | Type | Attribute | Description |
keySession | * | ||
message | * |
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 _onMediaEncrypted(initDataType: *, initData: *) source
Params:
Name | Type | Attribute | Description |
initDataType | * | ||
initData | * |
private _onMediaKeySystemAccessObtained(keySystem: string, mediaKeySystemAccess: MediaKeySystemAccess) source
Handles obtaining access to a key-system
Params:
Name | Type | Attribute | Description |
keySystem | string | ||
mediaKeySystemAccess | MediaKeySystemAccess | https://developer.mozilla.org/en-US/docs/Web/API/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 | * |