HTML Audio/Video DOM ended Property

Example

Check if the video playback has ended:

myVid=document.getElementById("video1");
alert(myVid.ended);

Try It Yourself

Definition and Usage

The ended property returns whether the audio/video has ended.

If the playback position is at the end of the audio/video, the audio/video has ended.

Browser Support

All major browsers support the ended property.

Note:Internet Explorer 8 or earlier browsers do not support this property.

Syntax

audio|video.ended

Return Value

Type Description
Boolean true|false. If the playback has ended, it returns true. Otherwise, it returns false.