Easy Tutorial
❮ Att Global Hidden Att Object Height ❯

HTML Audio/Video DOM canplay Event

HTML Audio/Video DOM Reference Manual

Example

Alerts that the video is ready to start playing:


Definition and Usage

The canplay event occurs when the browser can start playing the specified audio/video.

The following events occur in sequence when the audio/video is loading:


Browser Support

All major browsers support the canplay event.

Note: Internet Explorer 8 and earlier versions do not support this event.


Syntax

In HTML:

In JavaScript:

Using addEventListener():

Technical Details

Supported HTML Tags: <audio>, <video>
Supported JavaScript Objects: Audio, Video
--- ---

More Examples

Using the oncanplay attribute on HTML elements

Using addEventListener() to listen for the canplay event


❮ Att Global Hidden Att Object Height ❯