I am working on an interactive story for a school project. I am trying to make music to go with my various endings.
I used this the first couple times and it worked once or twice on Chrome then stopped working.
<audio class="ending-tunes" src="../../../../../Audio/Stonebank - Life & Death.mp3" type="audio/mpeg" autoplay></audio>
I looked at this answer, tried the two first solutions and neither of them worked which is expected given I later found a comment saying that it no longer works but it was worth a shot and I didn't see that comment until after I tried it. I had also tried this simple script:
var audio = Document.getElementsByClassName("ending-tunes");
audio.play();
but it didn't work either.
I also looked at this which told me that Google has some policies on autoplay. With that information in mind, I decided to go over to Edge and run it there, thinking that Edge would work. It didn't. My project is due tomorrow so if you see this and can answer, please do so right away. I thank you kindly!