files/en-us/web/api/htmlmediaelement/encrypted_event/index.md
{{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.
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.
addEventListener("encrypted", (event) => { })
onencrypted = (event) => { }
A {{domxref("MediaEncryptedEvent")}}. Inherits from {{domxref("Event")}}.
{{InheritanceDiagram("MediaEncryptedEvent")}}
null.{{Specifications}}
{{Compat}}