aud = document.getElementById('audio element');
btn = document.getElementById('btn element');
btn.addEventListener("click", playpause, false);
aud.oncanplay = reSync(1200);
function playpause() {
if (aud.paused) {
aud.play();
} else {
aud.pause();
}
}
function reSync(time) {
aud.currentTime = time;
console.log(aud.currentTime);
}
I have a audio file I would like to play on my website. But for some reason when I try to change the current time to as an example to 1200 it become 900 and something instead. The different does seem dependent on how big a change I'm trying to do. I have no idea on how to fix this.