Skip to content Skip to sidebar Skip to footer

Html5 Audio Currenttime Doesn't Work

I don't know why but it doesn't work. I have this: function stop() { audio.pause(); audio.currentTime = 0; } When I change the value of currentTime to 0, nothing changes...tha

Solution 1:

I solved it:

audio.pause();
audio.src = audio.src;

It reload the audio tag, and set currentTime to 0

Solution 2:

This could be a browser compatibility issue. Unfortunately the HTML5 Audio API is still not very mature. Consider using a 'wrapper' such as soundmanager2.

Also see older answer here

Post a Comment for "Html5 Audio Currenttime Doesn't Work"