Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM waiting Event

HTML Audio/Video DOM waiting Event

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Display a message when the video needs to buffer the next frame before playback can start:

var vid = document.getElementById("myVideo");

vid.onwaiting = function() {

    alert("Wait! I need to buffer the next frame");

};

Try it »


Definition and Usage

The waiting event is triggered when the video stops because it needs to buffer the next frame.

This event can be used on the


Browser support

The numbers in the table indicate the version number of the first browser to support the event.

Events
waiting Yes 9.0 Yes Yes Yes

Syntax

In HTML:

<

audio|video

onwaiting="

myScript

">

Try it

In JavaScript:

audio|video

.onwaiting=function(){

myScript

};

Try it

In JavaScript, use the addEventListener() method:

audio|video

.addEventListener("waiting",

myScript

);

Try it

Note: Internet Explorer 8 and earlier IE versions do not support addEventListener() method.


Technical Details

Supported HTML tags:
Supported JavaScript objects: Audio, Video

HTML audio/video Tag Reference HTML Audio/Video DOM Reference