HTML Audio/Video DOMcanplaythroughEvents
HTML Audio/Video DOM Reference Manual
Example
Indicates that the video can keep playing without pausing:
myVid=document.getElementById("video1");
myVid.oncanplaythrough=alert("Can play through video without stopping");
myVid.oncanplaythrough=alert("Can play through video without stopping");
Try it Yourself »
Definition and Usage
The canplaythrough event occurs when the browser estimates it can play the specified audio/video continuously without having to stop for buffering.
When the audio/video is in the process of loading, the following events occur in sequence:
- loadstart
- durationchange
- loadedmetadata
- loadeddata
- progress
- canplay
- canplaythrough
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the canplaythrough event.
Note:Internet Explorer 8 and earlier versions do not support this event.
Syntax
In HTML:
<audio|video oncanplaythrough="SomeJavaScriptCode">
In JavaScript:
audio|video.oncanplaythrough=SomeJavaScriptCode;
Using addEventListener():
audio|video.addEventListener("canplaythrough", function()
{
//SomeJavaScriptCode
}
);
{
//SomeJavaScriptCode
}
);
Technical Details
| The following HTML tags are supported: | <audio>, <video> |
|---|---|
| The following JavaScript objects are supported: | Audio, Video |

More Examples
Using the oncanplaythrough Attribute on HTML Elements
Use addEventListener() to listen for the canplaythrough event
HTML Audio/Video DOM Reference Manualother extensions