Advertisement
Home Open Editor ❯

HTML Audio/Video DOM waiting Event

Example

//Accessing the element
var vid = document.getElementById("myVideo");

//Creating a function
vid.onwaiting = function() {
    alert("The video is waiting");
};

Try this code ❯

Meaning

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


Standard Syntax

HTML:

<element onwaiting="myScript">

JavaScript:

object.onwaiting=function(){myScript};

JavaScript, using the addEventListener() method::

object.addEventListener("waiting", myScript);


Advertisement

Technical Details

Type Description
Supported HTML tags: <audio> and <video>
Supported JavaScript objects: Audio, Video
Home Open Editor ❯
Advertisement