``` More examples are included at the bottom"> ``` More examples are included at the bottom" />
Easy Tutorial
❮ Prop Style Opacity Event Onmousedown ❯

oncanplaythrough Event

Event Object

Example

Execute JavaScript when the video can be played without stopping:

<video oncanplaythrough="myFunction()">

More examples are included at the bottom of this article.


Definition and Usage

The oncanplaythrough event is triggered when the video/audio can be played all the way to the end without stopping for buffering.

The sequence of events during the loading of a video/audio is as follows:


Browser Support

The numbers in the table specify the first browser version that supports the event.

Event
oncanplaythrough Yes 9.0 Yes Yes Yes

Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

Note: Internet Explorer 8 and earlier versions do not support the addEventListener() method.


Bubbles: No
Cancelable: No
--- ---
Event Type: Event
--- ---
Supported HTML Tags: <audio>, <video>
--- ---

More Examples

Example

Execute JavaScript when the audio can be played without stopping:

<audio oncanplaythrough="myFunction()">

❮ Prop Style Opacity Event Onmousedown ❯