--- title: MediaKeySession slug: Web/API/MediaKeySession tags: - API - Audio - EncryptedMediaExtensions - Interface - Media - MediaKeySession - NeedsExample - NeedsTranslation - Reference - TopicStub - Video translation_of: Web/API/MediaKeySession ---
{{APIRef("EncryptedMediaExtensions")}}{{SeeCompatTable}}
The MediaKeySession
interface of the EncryptedMediaExtensions API represents a context for message exchange with a content decryption module (CDM).
MediaKeySession
closes. This promise can only be fulfilled and is never rejected. Closing a session means that licenses and keys associated with it are no longer valid for decrypting media data. NaN
if no such time exists. This value is determined by the CDM and measured in milliseconds since January 1, 1970, UTC. This value may change during a session lifetime, such as when an action triggers the start of a window.Returns a {{jsxref("Promise")}} after notifying the current media session is no longer needed and that the CDM should release any resources associated with this object and close it.
// TBD
Specification | Status | Comment |
---|---|---|
{{SpecName('EME', '#mediakeysession-interface', 'MediaKeySession')}} | {{Spec2('EME')}} | Initial definition. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | {{CompatChrome(42.0)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} |
onkeystatuseschange and onmessage |
{{CompatChrome(55.0)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatOpera(42)}} | {{CompatUnknown}} |
Feature | Android | Android Webview | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|---|
Basic support | {{CompatNo}} | {{CompatChrome(43.0)}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatVersionUnknown}} | {{CompatUnknown}} | {{CompatChrome(42.0)}} |
onkeystatuseschange and onmessage |
{{CompatNo}} | {{CompatChrome(55.0)}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatOperaMobile(42)}} | {{CompatUnknown}} | {{CompatChrome(55.0)}} |