Background music
How would I add background music to all my pages. Because I can't figure out how
Voters
Aliencomel
@RYANTADIPARTHI but i cant click the play button
How would I add background music to all my pages. Because I can't figure out how
@RYANTADIPARTHI but i cant click the play button
I would recommend using JavaScript's
Audio()
.Since audio is only loaded once the user interacts with the webpage, add a "click" event listener to the body to make sure the user has interacted with the webpage and then start playing the audio.
There you have it!
The best way to do this is put it in a separate file called "backgroundAudio.js" and link it into all your html files.
@Baconman321 Is there any way to have the music loop?
@JacobMcPherson1
audio.loop = true;
@Baconman321 Ok thanks!