Hi all, hopefully my last post for this project, I just need to enable an audio check loop that enables my audio to play all the way through before redirecting to a new page. this is my script so far:
<script>
function notrust() {
var audio = new Audio('voices/notrust.mp3');
audio.play();
setTimeout(audiocheck, 10);
}
function audiocheck() {
if (audio.isPlaying == false) {
setTimeout(redirect, 10);
} else if (audio.isPlaying == true) {
setTimeout("audiocheck()",500);
} else {
}
}
function redirect() {
window.location.replace("http://www.google.com");
}
</script>
any help would be appreciated
Cheers!