ใช้ oncanplaythrough เพื่อเรียกใช้สคริปต์เมื่อไฟล์สามารถเล่นได้จนจบโดยไม่ต้องหยุดชั่วคราวสำหรับการบัฟเฟอร์ใน HTML
ตัวอย่าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้งาน oncanplaythrough แอตทริบิวต์ −
<!DOCTYPE html>
<html>
<body>
<video id = "myVideo" width = "400" height = "200" controls oncanplaythrough = "display()">
<source src = "/html5/foo.ogg" type = "video/ogg" />
<source src = "/html5/foo.mp4" type = "video/mp4" />
Your browser does not support the video element.
</video>
<script>
function display() {
alert("Can be played without pausing for buffering.");
}
</script>
</body>
</html>