How to make music autoplay and loop in background

Viewed 17048

I am currently using this and the autoplay seems to work but the loop doesn't work.

<div id="music"><embed src="Anne_Marie - 2002 [Official Video].mp3" autostart=true loop=true></div>

Also, I wanna make it like background music so the play buttons don't show up.

2 Answers
  • The loop attribute makes the audio file loop.

  • The autoplay attribute makes the file start playing without the user needing to play the file.

  • The controls attribute shows the controls, omitting it will hide the controls.

<audio loop autoplay>
    <source src="path/to/file" type="audio/filetype">
</audio>

Audio filetype can be: .mp3, .wav, .ogg

this audio work for me:

<audio autoplay loop src="music/music.mp3"></audio>

Related