Advertisement
Home Open Editor ❯

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");
};

Try this code ❯

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:


Advertisement

Attribute Values

Value Description
script Specifies the script to be run on oncanplaythrough.
Home Open Editor ❯
Advertisement