-1

Id like to know, how to put one song in autoplay and loop not in main page, because i know that its not possible to put on first page of website, right? so, id like to put it in another page of website... is it possible?

IVE this code... but it doesnt work :/

thank you so much

HTML

<iframe src="https://files.cargocollective.com/c995491/GAME.mp3" allow="autoplay" style="display:none" id="iframeAudio">
</iframe> 

JS


var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
  if (!isChrome){
      $('#iframeAudio').remove()
  }
  else {
      $('#playAudio').remove() // just to make sure that it will not have 2x audio in the background 
  }

didi
  • 21
  • 3

1 Answers1

0

To put any audio in autoplay and loop, you can use:

<audio src="https://files.cargocollective.com/c995491/GAME.mp3" autoplay loop></audio>


It will not be displayed but it if you want it to be displayed or show controls to the user then use controls inside the audio tag, just like autoplay or loop .

m24197
  • 1,038
  • 1
  • 4
  • 12