I am running the following code in Chrome:
audioEl = document.getElementById('#mySound');
audioEl.play();
Then half way through the sound playing back I'm running this code:
audioEl.pause();
audioEl.currentTime = 0;
audioEl.play();
The result is that the last call to play() returns a pending promise that never returns until I call pause() again, at which point the promise is rejected with The play() request was interrupted by a call to pause()..
The same code works fine on Firefox and I can't see any logical problems with it. Is there a way around this? Is there something I'm missing?
Looks like this is a problem with OGG files. MP3 works fine.