MrWhoohoo
MrWhoohoo

Reputation: 13

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

Upvotes: 1

Views: 245

Answers (2)

Ilya Pyatin
Ilya Pyatin

Reputation: 36

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

Upvotes: 2

origami
origami

Reputation: 21

Have you added jQuery to your project? You seem to be referring to it in your code (the '$' character)

You could maybe try using this instead

$(player).prop('muted', true);

Upvotes: 1

Related Questions