Is there an oncomplete
event for HTML5 audio? I could not find anything on this. I am trying to play a sound after it completes.
Well, specifically I am trying to play through an array of sounds one after the other.
Thanks.
There is the ended
event . . .
http://dev.w3.org/html5/spec/Overview.html#event-media-ended
Example:
var audioElement = document.getElementById("myAudio"); audioElement.addEventListener('ended', function() { // Audio has ended when this function is executed. },false);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With