Interface MediaKeySession

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

MDN Reference

interface MediaKeySession {
    $destroyListeners?: any[];
    closed: Promise<MediaKeySessionClosedReason>;
    expiration: number;
    keyStatuses: MediaKeyStatusMap;
    onkeystatuseschange: Object;
    onmessage: Object;
    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

Properties

$destroyListeners?: any[]
expiration: number
keyStatuses: MediaKeyStatusMap
onkeystatuseschange: Object
onmessage: Object
sessionId: string

Methods

  • Type Parameters

    Parameters

    Returns void

  • Parameters

    Returns 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.

    MDN Reference

    Parameters

    Returns boolean

  • Parameters

    Returns Promise<void>

  • Parameters

    • sessionId: string

    Returns Promise<boolean>

  • Type Parameters

    Parameters

    Returns void

  • Parameters

    Returns void