Script to leave my site (game) mute

4

I have a project in localhost (game in HTML 5, JS and CSS), in the background of the game plays a song, I can not make the button to turn off the sound works, someone knows some article that teaches or method of doing This?

I'm sorry I missed some details, the game itself has no audio, the page has an "audio" that comes from a video in YT, I wanted to be able to make a link that left my page changes: /

    
asked by anonymous 16.06.2015 / 15:12

1 answer

4

If the audio comes from the audio tag

 <audio id="musica" autoplay="autoplay">
      <source src="musica.mp3" type="audio/mpeg" />
    </audio> 


document.getElementById('musica').muted = true;

Since the video comes from youtube, I do not think there is any parameter for embedded videos that allows you to mute the video.

Anyway, I'll leave you a link here Player parameters

The best thing is to download the video and put it back through the

    
16.06.2015 / 20:51