HTML oncanplay Attribute
Example
//Accessing the element
var vid = document.getElementById("myVideo");
//Creating a function
vid.oncanplay = function() {
alert("The video can start playing");
};
Meaning
The canplay event run when the browser can start playing the audio/video.
Standard Syntax
<element oncanplay="script">
Browser Support
Status
Applies to:
The oncanplay attribute can be used on the following element:
Attribute Values
Value | Description |
---|---|
script | Specifies the script to be run on oncanplay. |