The waiting event is fired when playback has stopped because of a temporary lack of data.
| Bubbles | No |
|---|---|
| Cancelable | No |
| Interface | Event |
| Target | Element |
| Default Action | None |
| Event handler property | GlobalEventHandlers.onwaiting |
| Specification | HTML5 media |
Examples
These examples add an event listener for the HTMLMediaElement's waiting event, then post a message when that event handler has reacted to the event firing.
Using addEventListener():
const video = document.querySelector('video');
video.addEventListener('waiting', (event) => {
console.log('Video is waiting for more data.');
});
Using the onwaiting event handler property:
const video = document.querySelector('video');
video.onwaiting = (event) => {
console.log('Video is waiting for more data.');
};
Specifications
| Specification | Status |
|---|---|
| HTML Living Standard The definition of 'waiting media event' in that specification. |
Living Standard |
| HTML5 The definition of 'waiting media event' in that specification. |
Recommendation |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
waiting event | Chrome Full support Yes | Edge Full support 12 | Firefox Full support Yes | IE Full support 9 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
Related Events
HTMLMediaElement: playing eventHTMLMediaElement: waiting eventHTMLMediaElement: seeking eventHTMLMediaElement: seeked eventHTMLMediaElement: ended eventHTMLMediaElement: loadedmetadata eventHTMLMediaElement: loadeddata eventHTMLMediaElement: canplay eventHTMLMediaElement: canplaythrough eventHTMLMediaElement: durationchange eventHTMLMediaElement: timeupdate eventHTMLMediaElement: play eventHTMLMediaElement: pause eventHTMLMediaElement: ratechange eventHTMLMediaElement: volumechange eventHTMLMediaElement: suspend eventHTMLMediaElement: emptied eventHTMLMediaElement: stalled event
