HTMLMediaElement: waitingforkey event

Baseline 2024
Newly available

Since November 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

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, readyState is set to HAVE_CURRENT_DATA. Otherwise, including if the data was previously available but isn't anymore, the readyState is set to HAVE_METADATA.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

js
addEventListener("waitingforkey", (event) => { })

onwaitingforkey = (event) => { }

Event type

An Event.

Specifications

Specification
Encrypted Media Extensions
# dom-htmlmediaelement-onwaitingforkey

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
waitingforkey event
Chrome – Full support
Chrome 55 (Release date: 2016-12-01)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Partial support
Firefox 52 – 132 (Release date: 2017-03-07)
footnote Partial support
footnote The onwaitingforkey event handler property is not supported.
Firefox – Full support
Firefox 133 (Release date: 2024-11-26)
footnote Full support
Opera – Full support
Opera 42 (Release date: 2016-12-13)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 55 (Release date: 2016-12-06)
footnote Full support
Firefox for Android – Partial support
Firefox for Android 52 – 132 (Release date: 2017-03-07)
footnote Partial support
footnote The onwaitingforkey event handler property is not supported.
Firefox for Android – Full support
Firefox for Android 133 (Release date: 2024-11-26)
footnote Full support
Opera Android – Full support
Opera Android 42 (Release date: 2017-01-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 55 (Release date: 2016-12-06)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
Has more compatibility info.

See also