forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTMLMediaElement waitingforkey event docs
- Loading branch information
1 parent
fbc04f8
commit 3d09048
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
files/en-us/web/api/htmlmediaelement/waitingforkey_event/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: "HTMLMediaElement: waitingforkey event" | ||
short-title: waitingforkey | ||
slug: Web/API/HTMLMediaElement/waitingforkey_event | ||
page-type: web-api-event | ||
browser-compat: api.HTMLMediaElement.waitingforkey_event | ||
--- | ||
|
||
{{APIRef("Encrypted Media Extensions")}} | ||
|
||
The `waitingforkey` event is fired at a media element when it is first unable to play because it needs a key to decode the following data, and playback is stopped. | ||
|
||
If the video frame and/or audio data for the current playback position have been decoded, {{domxref("HTMLMediaElement.readyState", "readyState")}} is set to [`HAVE_CURRENT_DATA`](/en-US/docs/Web/API/HTMLMediaElement/readyState#htmlmediaelement.have_current_data). | ||
Otherwise, including if the data was previously available but isn't anymore, the `readyState` is set to [`HAVE_METADATA`](/en-US/docs/Web/API/HTMLMediaElement/readyState#htmlmediaelement.have_metadata). | ||
|
||
## Syntax | ||
|
||
Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property. | ||
|
||
```js | ||
addEventListener("waitingforkey", (event) => {}); | ||
|
||
onwaitingforkey = (event) => {}; | ||
``` | ||
|
||
## Event type | ||
|
||
An {{domxref("Event")}}. | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("HTMLAudioElement")}} | ||
- {{domxref("HTMLVideoElement")}} | ||
- {{HTMLElement("audio")}} | ||
- {{HTMLElement("video")}} |