HTML DOM Audio ended property
Examples
Check if the audio playback ends:
var x = document.getElementById("myAudio").ended;
x The output is:
true
try it"
Definition and Usage
ended property returns whether the audio has ended.
If the playback position is located at the end of the audio, the audio has ended.
Note: This property is read-only attribute
Browser Support
All major browsers support ended property.
Note: Internet Explorer 8 and earlier versions of IE does not support this property.
grammar
audioObject .ended
technical details
return value: | Boolean value that, if the audio playback ends, it returns true. Otherwise, it returns false. |
---|
Audio Object