I am making an audio site for fun, but I find it that the loop property to the audio tag doesnt work in firefox. I also know that conditional statements only work for IE, is there another way to accomplish the same goal?
<![if firefox]>
<script src="script.js"></script>
<![endif]>
EDIT: This is my current HTML code.
<audio id="song_1" name="audio" autobuffer loop>
<source src="song.ogg" />
<source src="song.mp3" />
<source src="song.wav" />
<div class="white_text">Your browser does not support the audio file formats or does not support HTML5.</div>
</audio>
<audio id="song_2" name="audio" autobuffer loop>
<source src="song2.ogg" />
<source src="song2.mp3" />
<source src="song2.wav" />
</audio>
<audio id="song_3" name="audio" autobuffer loop>
<source src="song3.ogg" />
<source src="song3.mp3" />
<source src="song3.wav" />
</audio>
<audio id="song_4" name="audio" autobuffer loop>
<source src="song4.ogg" />
<source src="song4.mp3" />
<source src="song4.wav" />
</audio>
<script>
var music = document.getElementsByName('audio'), i;
for (i = 0; i < n; ++i)
music[i].addEventListener('ended', function(){this.currentTime = 0;}, false);
</script>
Problem with this is that when 'loop' is added to audio tag, firefox wont loop. When 'loop' is not there, safari (or at least safari mobile, cuz thats what i have) wont loop.