LLLLLLL Posted February 6, 2011 Share Posted February 6, 2011 I've created an HTML5 audio player. Very basic (which is what I want)... it's a single play button that changes to a "pause" button once you've started playing, done through JavaScript. What I want to happen is that when the audio file reaches the end, the "play" button displays again. Is there some event that fires when the audio is complete? I've been to all the related forums and can't find any information. This stuff is not well documented yet. Or if you have a better solution altogether, I'm up for that as well. Quote Link to comment https://forums.phpfreaks.com/topic/226899-html5-audio/ Share on other sites More sharing options...
LLLLLLL Posted February 6, 2011 Author Share Posted February 6, 2011 Tried lots of terms, and it seems "ended" is the trick: document.getElementById('audio-player3').addEventListener('ended', function(){ // change the image back. }, false); Quote Link to comment https://forums.phpfreaks.com/topic/226899-html5-audio/#findComment-1170744 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.