Don't you think this might be a flawlles solution to Check if Audio() is playing?
问题 Do you think this might be a flawlles solution to Check if Audio() is playing? Like when handling a stratup theme ... Place this above in the head songStarted = false; song = new Audio(); song.src = 'audio/startuptheme.mp3'; song.addEventListener('playing', (event) => {songStarted = true;}); song.play(); And use the following script anywhere (where first user interaction should happen), as many times as you need if (!songStarted){ if (typeof song == 'undefined'){ song = new Audio(); song.src