Sound doesn’t work with Firefox or Opera, only Chrome. I wonder if it’s a compatibility issue between the sound format, but this problem only happens when I have this files mounted on the server. There a pattern for this? Do I need to add some like Onload event? Anyway, here is the code:
function PlayAudio(path){
var myAudio = new Audio(path);
myAudio.play();
return myAudio;
}
And i call this function from another javascript file (in the same folder) like this:
var background_audio = PlayAudio('../sound/back_sound.ogg')
Any suggestion or test is welcome.
check the mimetype your server is delivering the ogg-file with. It has to be
audio/ogg.