Easy Tutorial
❮ Canvas Drawimage Att Input Max ❯

HTML Audio/Video DOM pause Event

HTML Audio/Video DOM Reference Manual

Example

Display a message when the video is paused:

var vid = document.getElementById("myVideo");
vid.onpause = function() {
    alert("Video is paused");
};

More examples are available at the bottom of this page.


Definition and Usage

The pause event is triggered when the audio/video is paused.

Tip: The play event is triggered when the audio/video starts playing (or resumes from a pause).


Browser Support

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

Event Chrome IE Firefox Safari Opera
pause Yes 9.0 Yes Yes Yes

Syntax

In HTML:

In JavaScript:

In JavaScript, using the addEventListener() method:

Note: The addEventListener() method is not supported in Internet Explorer 8 and earlier versions.


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

More Examples

Example

Display a message when the audio is paused:

❮ Canvas Drawimage Att Input Max ❯