Is there a way to mute the audio of an iframe using jQuery or CSS?
This is the iframe I need to mute
<iframe src="http://player.vimeo.com/video/4415083?api=1;title=0&byline=0&portrait=0&color=d01e2f&autoplay=1" width="500" height="281" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
Include this library in your page: https://github.com/vimeo/player-api/tree/master/javascript like this
<script src="//f.vimeocdn.com/js/froogaloop2.min.js"></script>
This code will send an API call to vimeo player to set the volume to 0 once the player is ready, based on http://developer.vimeo.com/player/js-api
// you may need another way of getting reference to the iframe:
var iframe = document.getElementsByTagName('iframe')[0];
var player = $f( iframe );
player.addEvent('ready', function() {
player.api('setVolume', 0);
});
Or, without the external library:
iframe.contentWindow.postMessage('{"method":"setVolume", "value":0}','*');