HTML oncanplaythrough Attribute

❮ HTML Attributes

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">



Browser Support




Status




Applies to:

The oncanplaythrough attribute can be used on the following element:

Element Attribute
<audio> oncanplaythrough
<video> oncanplaythrough






Attribute Values

Value Description
script Specifies the script to be run on oncanplaythrough.
❮ HTML Attributes