web api overview
Encrypted Media Extensions API
Secure context
The Encrypted 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 through requestMediaKeySystemAccess().
Interfaces
MediaEncryptedEvent- : Represents a specific
encryptedevent thrown when aHTMLMediaElementencounters some initialization data.
- : Represents a specific
MediaKeyMessageEvent- : Contains the content and related data when the content decryption module (CDM) generates a message for the session.
MediaKeys- : Represents a set of keys that an associated
HTMLMediaElementcan use for decryption of media data during playback.
- : Represents a set of keys that an associated
MediaKeySession- : Represents a context for message exchange with a content decryption module (CDM).
MediaKeyStatusMap- : A read-only map of media key statuses by key IDs.
MediaKeySystemAccess- : Provides 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
mediaKeysRead only- : Provides a
MediaKeysobject that represents the set of keys that the element can use for decryption of media data during playback.
- : Provides a
setMediaKeys()- : Sets the
MediaKeysthat will be used to decrypt media during playback.
- : Sets the
encryptedevent- : Event that is fired on a
HTMLMediaElementwhen initialization data is encountered in the media, indicating that it is encrypted.
- : Event that is fired on a
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.
- : Returns a
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.