4

hey friends,

I am making a game based on html5 and JS, i want to play a audio clip of 8 seconds in background in loop but when I add audio in HTML code by using :

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

but still it plays audio for once.

can anybody tell me how to do this??

laaposto
  • 11,835
  • 15
  • 54
  • 71
AZT
  • 149
  • 1
  • 13

1 Answers1

5

You may want to check these posts 1 and 2 because some browsers have issues with loop attribute so you have to do it manually.

Community
  • 1
  • 1
Hazem Hagrass
  • 9,329
  • 10
  • 32
  • 54