Search code examples
javascripthtmliframevimeo

I can't seem to mute my vimeo iframe


I searched across the internet, tried many things but it's still not working, I even straight up copied and pasted codes, put it online and it didn't work. So I'll ask you guys if you can help me

this is the code:

    <script src="http://f.vimeocdn.com/js/froogaloop2.min.js"></script>
    <iframe id="vimeo_player" src="http://player.vimeo.com/video/4415083?  title=0&amp;byline=0&amp;portrait=0&amp;color=d01e2f&amp;autoplay=1" width="500" height="281"  frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
    <script>
    var iframe = $('#vimeo_player')[0],
        player = $f(iframe),
        status = $('.status');

        player.addEvent('ready', function() {
            player.api('setVolume', 0);
        });
    </script>

live preview : http://mrwhoohoo.nl/Testing/test.html


Solution

  • I've found out that the problem will be solved if we add "player_id" parameter to the iframe URL with value = "vimeo_player" ("id" attribute of the iframe). So the resulting URL will be:

    http://player.vimeo.com/video/4415083?  title=0&amp;byline=0&amp;portrait=0&amp;color=d01e2f&amp;autoplay=1&player_id=vimeo_player