Home Reference Source
import EMEController from 'hls.js/src/controller/eme-controller.ts'
public class | source

EMEController

Controller to deal with encrypted media extensions (EME)

Static Member Summary

Static Public Members
public static

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

config: EMEControllerConfig

public

error: *

public

hls: Hls

public
public
public
public

log: *

public

media: *

public
public
public
public
public

warn: *

Private Members
private

Method Summary

Public Methods
public

attemptKeySystemAccess(keySystemsToAttempt: undefined): Promise

public

attemptSetMediaKeys(keySystem: KeySystems, mediaKeys: MediaKeys): Promise

public

createMediaKeySessionContext(undefined: undefined): MediaKeySessionContext

public
public

fetchServerCertificate(keySystem: KeySystems): Promise

public

generateLicenseRequestChallenge(keySessionContext: MediaKeySessionContext, keyMessage: ArrayBuffer): *

public

generateRequestWithPreferredKeySession(context: MediaKeySessionContext, initDataType: string, initData: undefined): *

public
public

getKeyIdString(decryptdata: undefined): *

public
public
public

getLicenseServerUrl(keySystem: KeySystems): *

public

getMediaKeysPromise(keySystem: KeySystems, audioCodecs: undefined, videoCodecs: undefined): Promise

public

getServerCertificateUrl(keySystem: KeySystems): *

public
public

handleParsedKeyResponse(mediaKeySessionContext: MediaKeySessionContext, licenseResponse: ArrayBuffer): Uint8Array

public

loadKey(data: KeyLoadedData): Promise

public

onKeyStatusChange(mediaKeySessionContext: MediaKeySessionContext)

public

onManifestLoaded(event: undefined, undefined: ManifestLoadedData)

public

onMediaAttached(event: undefined, data: MediaAttachedData)

public
public
public

removeSession(mediaKeySessionContext: MediaKeySessionContext): *

public

renewKeySession(mediaKeySessionContext: MediaKeySessionContext)

public

renewLicense(context: MediaKeySessionContext, keyMessage: ArrayBuffer): Promise

public

requestLicense(keySessionContext: MediaKeySessionContext, licenseChallenge: Uint8Array): Promise

public

requestMediaKeySystemAccess(keySystem: KeySystems, supportedConfigurations: undefined): Promise

public
public

setMediaKeysServerCertificate(mediaKeys: MediaKeys, keySystem: KeySystems, cert: BufferSource): Promise

public

setupLicenseXHR(xhr: XMLHttpRequest, url: string, keysListItem: MediaKeySessionContext, licenseChallenge: Uint8Array): Promise

public
public
public

updateKeySession(mediaKeySessionContext: MediaKeySessionContext, data: Uint8Array): Promise

Private Methods
private

_onMediaEncrypted(event: MediaEncryptedEvent)

private

_onWaitingForKey(event: Event)

Static Public Members

public static CDMCleanupPromise: * source

Public Constructors

public constructor() source

Public Members

public config: EMEControllerConfig source

public error: * source

public hls: Hls source

public keyFormatPromise: * source

public keyIdToKeySessionPromise: * source

public keySystemAccessPromises: * source

public log: * source

public media: * source

public mediaKeySessions: * source

public onMediaEncrypted: * source

public onWaitingForKey: * source

public setMediaKeysQueue: * source

public warn: * source

Private Members

private _requestLicenseFailureCount: number source

Public Methods

public attemptKeySystemAccess(keySystemsToAttempt: undefined): Promise source

Params:

NameTypeAttributeDescription
keySystemsToAttempt undefined

Return:

Promise

public attemptSetMediaKeys(keySystem: KeySystems, mediaKeys: MediaKeys): Promise source

Params:

NameTypeAttributeDescription
keySystem KeySystems
mediaKeys MediaKeys

Return:

Promise

public createMediaKeySessionContext(undefined: undefined): MediaKeySessionContext source

Params:

NameTypeAttributeDescription
undefined undefined

Return:

MediaKeySessionContext

public destroy() source

public fetchServerCertificate(keySystem: KeySystems): Promise source

Params:

NameTypeAttributeDescription
keySystem KeySystems

Return:

Promise

public generateLicenseRequestChallenge(keySessionContext: MediaKeySessionContext, keyMessage: ArrayBuffer): * source

Params:

NameTypeAttributeDescription
keySessionContext MediaKeySessionContext
keyMessage ArrayBuffer

Return:

*

public generateRequestWithPreferredKeySession(context: MediaKeySessionContext, initDataType: string, initData: undefined): * source

Params:

NameTypeAttributeDescription
context MediaKeySessionContext
initDataType string
initData undefined

Return:

*

public getKeyFormatPromise(keyFormats: undefined): Promise source

Params:

NameTypeAttributeDescription
keyFormats undefined

Return:

Promise

public getKeyIdString(decryptdata: undefined): * source

Params:

NameTypeAttributeDescription
decryptdata undefined

Return:

*

public getKeySystemForKeyPromise(decryptdata: LevelKey): Promise source

Params:

NameTypeAttributeDescription
decryptdata LevelKey

Return:

Promise

public getKeySystemSelectionPromise(keySystemsToAttempt: undefined): Promise source

Params:

NameTypeAttributeDescription
keySystemsToAttempt undefined

Return:

Promise

public getLicenseServerUrl(keySystem: KeySystems): * source

Params:

NameTypeAttributeDescription
keySystem KeySystems

Return:

*

public getMediaKeysPromise(keySystem: KeySystems, audioCodecs: undefined, videoCodecs: undefined): Promise source

Params:

NameTypeAttributeDescription
keySystem KeySystems
audioCodecs undefined
videoCodecs undefined

Return:

Promise

public getServerCertificateUrl(keySystem: KeySystems): * source

Params:

NameTypeAttributeDescription
keySystem KeySystems

Return:

*

public handleError(error: undefined) source

Params:

NameTypeAttributeDescription
error undefined

public handleParsedKeyResponse(mediaKeySessionContext: MediaKeySessionContext, licenseResponse: ArrayBuffer): Uint8Array source

Params:

NameTypeAttributeDescription
mediaKeySessionContext MediaKeySessionContext
licenseResponse ArrayBuffer

Return:

Uint8Array

public loadKey(data: KeyLoadedData): Promise source

Params:

NameTypeAttributeDescription
data KeyLoadedData

Return:

Promise

public onKeyStatusChange(mediaKeySessionContext: MediaKeySessionContext) source

Params:

NameTypeAttributeDescription
mediaKeySessionContext MediaKeySessionContext

public onManifestLoaded(event: undefined, undefined: ManifestLoadedData) source

Params:

NameTypeAttributeDescription
event undefined
undefined ManifestLoadedData

public onMediaAttached(event: undefined, data: MediaAttachedData) source

Params:

NameTypeAttributeDescription
event undefined
data MediaAttachedData

public onMediaDetached() source

public registerListeners() source

public removeSession(mediaKeySessionContext: MediaKeySessionContext): * source

Params:

NameTypeAttributeDescription
mediaKeySessionContext MediaKeySessionContext

Return:

*

public renewKeySession(mediaKeySessionContext: MediaKeySessionContext) source

Params:

NameTypeAttributeDescription
mediaKeySessionContext MediaKeySessionContext

public renewLicense(context: MediaKeySessionContext, keyMessage: ArrayBuffer): Promise source

Params:

NameTypeAttributeDescription
context MediaKeySessionContext
keyMessage ArrayBuffer

Return:

Promise

public requestLicense(keySessionContext: MediaKeySessionContext, licenseChallenge: Uint8Array): Promise source

Params:

NameTypeAttributeDescription
keySessionContext MediaKeySessionContext
licenseChallenge Uint8Array

Return:

Promise

public requestMediaKeySystemAccess(keySystem: KeySystems, supportedConfigurations: undefined): Promise source

Params:

NameTypeAttributeDescription
keySystem KeySystems
supportedConfigurations undefined

Return:

Promise

public selectKeySystemFormat(frag: Fragment): Promise source

Params:

NameTypeAttributeDescription
frag Fragment

Return:

Promise

public setMediaKeysServerCertificate(mediaKeys: MediaKeys, keySystem: KeySystems, cert: BufferSource): Promise source

Params:

NameTypeAttributeDescription
mediaKeys MediaKeys
keySystem KeySystems
cert BufferSource

Return:

Promise

public setupLicenseXHR(xhr: XMLHttpRequest, url: string, keysListItem: MediaKeySessionContext, licenseChallenge: Uint8Array): Promise source

Params:

NameTypeAttributeDescription
xhr XMLHttpRequest
url string
keysListItem MediaKeySessionContext
licenseChallenge Uint8Array

Return:

Promise

public throwIfDestroyed(message: undefined) source

Params:

NameTypeAttributeDescription
message undefined

public unregisterListeners() source

public updateKeySession(mediaKeySessionContext: MediaKeySessionContext, data: Uint8Array): Promise source

Params:

NameTypeAttributeDescription
mediaKeySessionContext MediaKeySessionContext
data Uint8Array

Return:

Promise

Private Methods

private _onMediaEncrypted(event: MediaEncryptedEvent) source

Params:

NameTypeAttributeDescription
event MediaEncryptedEvent

private _onWaitingForKey(event: Event) source

Params:

NameTypeAttributeDescription
event Event