HTMLMediaElement: encrypted event
{{APIRef("Encrypted Media Extensions")}}
The encrypted
event is fired when initialization data is found in the media that indicates it is encrypted.
This event is not cancelable and does not bubble.
Syntax
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}
, or set an event handler property.
addEventListener("encrypted", (event) => {});
onencrypted = (event) => {};
Event type
A {{domxref("MediaEncryptedEvent")}}
. Inherits from {{domxref("Event")}}
.
{{InheritanceDiagram("MediaEncryptedEvent")}}
Event properties
{{domxref("MediaEncryptedEvent.initDataType")}}
{{ReadOnlyInline}}
- : Returns a case-sensitive string with the type of the format of the initialization data found.
{{domxref("MediaEncryptedEvent.initData")}}
{{ReadOnlyInline}}
- : Returns an
{{jsxref("ArrayBuffer")}}
containing the initialization data found. If there is no initialization data associated with the format, it returnsnull
.
- : Returns an
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
{{domxref("HTMLAudioElement")}}
{{domxref("HTMLVideoElement")}}
{{HTMLElement("audio")}}
{{HTMLElement("video")}}
{{domxref("MediaEncryptedEvent")}}