Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/index.ts>dom.MediaKeySession

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.MediaKeySession
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.7/lib/index.ts";
const { MediaKeySession } = dom;

This EncryptedMediaExtensions API interface represents a context for message exchange with a content decryption module (CDM).

Properties

readonly
closed: Promise<void>
readonly
expiration: number
readonly
keyStatuses: MediaKeyStatusMap
onkeystatuseschange: ((this: MediaKeySession, ev: Event) => any) | null
onmessage: ((this: MediaKeySession, ev: MediaKeyMessageEvent) => any) | null
readonly
sessionId: string

Methods

close(): Promise<void>
generateRequest(initDataType: string, initData: BufferSource): Promise<void>
load(sessionId: string): Promise<boolean>
remove(): Promise<void>
update(response: BufferSource): Promise<void>
addEventListener<K extends keyof MediaKeySessionEventMap>(
type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof MediaKeySessionEventMap>(
type: K,
listener: (this: MediaKeySession, ev: MediaKeySessionEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void