I would like to know how can I check if the site is playing the audio. I have tried this, but it doesnt seem to work for me: HTML:
<iframe width="500px" height="300px" id="player" src="https://www.youtube.com/embed/gPDcwjJ8pLg"></iframe>
And my JS:
var myAudio = document.getElementById('player');
myAudio.addEventListener("ended", function(){
myAudio.currentTime = 0;
alert("ended");
});
Thanks for any advice.