MediaKeySession
This EncryptedMediaExtensions API interface represents a context for message exchange with a content decryption module (CDM). Available only in secure contexts.
interface MediaKeySession extends EventTarget {
readonly closed: Promise<MediaKeySessionClosedReason>;
readonly expiration: number;
readonly keyStatuses: MediaKeyStatusMap;
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null;
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null;
readonly sessionId: string;
addEventListener<K extends keyof MediaKeySessionEventMap>(
type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;close(): Promise<void>;
load(sessionId: string): Promise<boolean>;
remove(): Promise<void>;
removeEventListener<K extends keyof MediaKeySessionEventMap>(
type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;update(response: BufferSource): Promise<void>;
}var MediaKeySession: {
prototype: MediaKeySession;
new (): MediaKeySession;
};§Extends
§Properties
§
readonly closed: Promise<MediaKeySessionClosedReason>
[src]§
readonly keyStatuses: MediaKeyStatusMap
[src]§
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null
[src]§
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null
[src]§Methods
§
addEventListener<K extends keyof MediaKeySessionEventMap>(
[src]type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
removeEventListener<K extends keyof MediaKeySessionEventMap>(
[src]type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void§
update(response: BufferSource): Promise<void>
[src]