jeudi 28 mai 2015

Play Sound randoom not work in firefox

i have this code in jquery function.

   var soundFile = sounds[Math.floor(Math.random()*sounds.length)];
     document.getElementById("player").innerHTML="<embed src=\""+soundFile+"\" hidden=\"true\" autostart=\"true\" loop=\"false\" />";   

I have an array of .ogg file in a var named "sounds", and 1 button with onClick event. But when i click on the button, only on chorme work. Firefox or other browsers do not work.




Aucun commentaire:

Enregistrer un commentaire