HTML oncanplaythrough Attribute
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
<element oncanplaythrough="script">
Applies to:
The oncanplaythrough attribute can be used on the following element:
| Element | Attribute |
|---|---|
| <audio> | oncanplaythrough |
| <video> | oncanplaythrough |
Advertisement
Attribute Values
| Value | Description |
|---|---|
| script | Specifies the script to be run on oncanplaythrough. |