Latest web development tutorials

HTML Audio / Video DOM waiting event

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

Examples

A message appears when the video starts playing before the next frame buffer need:

var vid = document.getElementById ( "myVideo");
vid.onwaiting = function () {
alert ( "! Wait I need to buffer the next frame");
};

try it"

Definition and Usage

waiting event is triggered when the next frame buffer video due to the need to stop.

This event can be used <audio> elements, but usually are used in the video.


Browser Support

Figures in the table represent the first browser to support this version of events.

event
waiting Yes 9.0 Yes Yes Yes


grammar

In HTML:

<Audio | video onwaiting = "myScript "> try

In JavaScript:

audio | video .onwaiting = function () {myScript}; try

JavaScript, use the addEventListener () method:

audio | video .addEventListener ( "waiting" , myScript); try

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


technical details
Supported HTML tags: <Audio> and <video>
Supported JavaScript Objects: Audio, Video


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