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...that is, currentTime continues having the previous value.
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...that is, currentTime continues having the previous value.
I solved it:
audio.pause();
audio.src = audio.src;
It reload the audio tag, and set currentTime to 0
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