Javascript alert block blocking sound object
I have a little problem. Basically, what I'm trying to do is make the application appear in the box when playing a certain sound. Here is part of the error code:
var audio = new Audio('song.mp3');
audio.play();
alert(1);
The problem is that the sound plays after the warning window. I am assuming this is happening because the application does not download the song file right away, but I have an idea how can I do this?
+3
source to share