Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML Audio/Video DOM ended Property

HTML Audio/Video DOM ended Property

HTML audio/video Tag Reference HTML Audio/Video DOM Reference

Example

Check whether video playback has ended:

myVid=document.getElementById("video1");

alert(myVid.ended);

Try it »


Definition and Usage

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

The audio/video has ended if the playback position is at the end of the audio/video.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the ended attribute.

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


Syntax

audio|video

.ended

Technical Details

Return Value: Boolean value, true|false. Returns true if playback has ended, otherwise false.

HTML audio/video Tag Reference HTML Audio/Video DOM Reference