HTML Audio/Video DOM canplaythrough Event
Example
//Accessing the element
var vid = document.getElementById("myVideo");
//Creating a function
vid.oncanplaythrough = function() {
alert("The video can play through without stopping");
};
Meaning
The canplaythrough event run when the browser can play through the audio/video without stopping for buffering.
Standard Syntax
HTML:
<element oncanplaythrough="myScript">
JavaScript:
object.oncanplaythrough=function(){myScript};
JavaScript, using the addEventListener() method::
object.addEventListener("canplaythrough", myScript);
Advertisement