Join us online - 19th of November
Save your spot
For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

Interface MediaKeys

The MediaKeys interface of Encrypted Media Extensions API represents a set of keys that an associated HTMLMediaElement can use for decryption of media data during playback. Available only in secure contexts.

MDN Reference

interface MediaKeys {
    createSession(sessionType?: MediaKeySessionType): MediaKeySession;
    getStatusForPolicy(policy?: MediaKeysPolicy): Promise<MediaKeyStatus>;
    setServerCertificate(serverCertificate: BufferSource): Promise<boolean>;
}
Index
  • The getStatusForPolicy() method of the MediaKeys interface is used to check whether the Content Decryption Module (CDM) would allow the presentation of encrypted media data using the keys, based on the specified policy requirements.

    MDN Reference

    Parameters

    Returns Promise<MediaKeyStatus>

  • The setServerCertificate() method of the MediaKeys interface provides a server certificate to be used to encrypt messages to the license server.

    MDN Reference

    Parameters

    Returns Promise<boolean>

Was this helpful?