This EncryptedMediaExtensions API interface represents a context for message exchange with a content decryption module (CDM). Available only in secure contexts.

interface MediaKeySession {
    closed: Promise<MediaKeySessionClosedReason>;
    expiration: number;
    keyStatuses: MediaKeyStatusMap;
    onkeystatuseschange: ((this, ev) => any);
    onmessage: ((this, ev) => any);
    sessionId: string;
    addEventListener<K>(type, listener, options?): void;
    addEventListener(type, listener, options?): void;
    close(): Promise<void>;
    dispatchEvent(event): boolean;
    generateRequest(initDataType, initData): Promise<void>;
    load(sessionId): Promise<boolean>;
    remove(): Promise<void>;
    removeEventListener<K>(type, listener, options?): void;
    removeEventListener(type, listener, options?): void;
    update(response): Promise<void>;
}

Hierarchy

  • EventTarget
    • MediaKeySession

Properties

expiration: number
keyStatuses: MediaKeyStatusMap
onkeystatuseschange: ((this, ev) => any)

Type declaration

onmessage: ((this, ev) => any)

Type declaration

sessionId: string

Methods

  • Type Parameters

    Parameters

    Returns void

  • Parameters

    Returns void

  • Returns Promise<void>

  • Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.

    Parameters

    • event: Event

    Returns boolean

  • Parameters

    Returns Promise<void>

  • Parameters

    • sessionId: string

    Returns Promise<boolean>

  • Returns Promise<void>

  • Type Parameters

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns Promise<void>

Generated using TypeDoc