HTML Audio/Video DOM playing Event
Example
//Accessing the element
var vid = document.getElementById("myVideo");
//Creating a function
vid.onplaying = function() {
alert("The video is playing");
};
Meaning
The playing event run when the audio/video is playing after having been paused or stopped for buffering.
Standard Syntax
HTML:
<element onplaying="myScript">
JavaScript:
object.onplaying=function(){myScript};
JavaScript, using the addEventListener() method::
object.addEventListener("playing", myScript);
Advertisement