Latest web development tutorials

HTML Audio / Video DOM ended property

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

Examples

Check that video playback has ended:

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

try it"

Definition and Usage

ended property return to the audio / video playback whether has ended.

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


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support ended property.

Note: 8 and earlier versions of Internet Explorer does not support this property.


grammar

audio|video .ended

technical details

返回值: 布尔值,true|false。如果播放已结束,则返回 true,否则返回 false。


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