I'm trying to use this javascript to loop an audio element:
music.js:
myAudio = new Audio('/assets/drumloop.mp3');
myAudio.loop = true;
myAudio.play();
When I include this as a script in a plain html file and open the html file in Safari 5.1, it loops just fine. When I include this javascript from my Rails application running on a local rails server, the audio plays, but does not loop.
I have tried using a callback on the 'ended' event to set the time to zero and play again (as suggested here, but that does not work either.
Is it possible that rails isn't sending enough information in the http header?