samedi 24 janvier 2015

I need to mute sound vars by their name

I need to be able to mute all sounds that I have. the sounds arn't continuous so .pause() is not a solution. this is what my audio looks like:



var soundName = new Audio("sound/soundname.wav","sound/soundname.ogg","sound/soundname.mp3");
soundName.play();


I want to mute it the moment I click on a div called #mute but this doesn't work:



$("#mute").click(function(e) {
soundName.mute()
});


I do not understand a single thing about the HTML 5 player plugins so that's why I need a temporary solution untill I do understand that. I've tried many things. Including the simple solutions. but my audio needs to be able to overlap. and that is only possible with the :



var name = new audio();


as far as i know


Aucun commentaire:

Enregistrer un commentaire