Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML Audio/Video DOM playing Event

❮ HTML Audio/Video DOM Reference


Alert that the video is playing:

let vid = document.getElementById("myVideo");
vid.onplaying = function() {
    alert("The video is now playing");
Try it Yourself »

More "Try it Yourself" examples below.

Definition and Usage

The playing event occurs when the audio/video is playing after having been paused or stopped for buffering.

Browser Support

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

playing Yes 9.0 Yes Yes Yes



<audio|video onplaying="myScript">Try it

In JavaScript:

audio|video.onplaying=function(){myScript};Try it

In JavaScript, using the addEventListener() method:

audio|video.addEventListener("playing", myScript);Try it

Technical Details

Supported HTML tags: <audio> and <video>
Supported JavaScript objects: Audio, Video

More Examples


Alert that the audio is playing:

let aud = document.getElementById("myAudio");
aud.onplaying = function() {
    alert("The audio is now playing");
Try it Yourself »

❮ HTML Audio/Video DOM Reference