Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
47
rated 0 times [  54] [ 7]  / answers: 1 / hits: 28311  / 14 Years ago, wed, february 23, 2011, 12:00:00

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.


More From » html

 Answers
91

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);

[#93615] Monday, February 21, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
mira

Total Points: 460
Total Questions: 108
Total Answers: 99

Location: American Samoa
Member since Fri, Aug 26, 2022
2 Years ago
mira questions
;