Encrypted Media Extensions API
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2019.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
TheEncrypted Media Extensions API provides interfaces for controlling the playback of content which is subject to a digital restrictions management scheme.
Access to this API is provided throughNavigator.requestMediaKeySystemAccess().
In this article
Interfaces
MediaEncryptedEventRepresents a specific
encryptedevent thrown when aHTMLMediaElementencounters some initialization data.MediaKeyMessageEventContains the content and related data when the content decryption module (CDM) generates a message for the session.
MediaKeysRepresents a set of keys that an associated
HTMLMediaElementcan use for decryption of media data during playback.MediaKeySessionRepresents a context for message exchange with a content decryption module (CDM).
MediaKeyStatusMapA read-only map of media key statuses by key IDs.
MediaKeySystemAccessProvides access to a key system for decryption and/or a content protection provider.
Extensions to other interfaces
The Encrypted Media Extensions API extends the following APIs, adding the listed features.
HTMLMediaElement
HTMLMediaElement.mediaKeysRead onlyProvides a
MediaKeysobject that represents the set of keys that the element can use for decryption of media data during playback.HTMLMediaElement.setMediaKeys()Sets the
MediaKeysthat will be used to decrypt media during playback.encryptedeventEvent that is fired on a
HTMLMediaElementwhen initialization data is encountered in the media, indicating that it is encrypted.
Navigator
Navigator.requestMediaKeySystemAccess()Returns a
Promisethat fulfils to aMediaKeySystemAccessobject that can be used to access a particular media key system, which can in turn be used to create keys for decrypting a media stream.
Specifications
| Specification |
|---|
| Encrypted Media Extensions> # navigator-extension-requestmediakeysystemaccess> |