我似乎无法将我的 vimeo iframe 静音
I can't seem to mute my vimeo iframe
我在互联网上搜索,尝试了很多方法,但仍然无法正常工作,
我什至直接复制和粘贴代码,把它放到网上,但没有用。所以我会问你们是否可以帮助我
这是代码:
<script src="http://f.vimeocdn.com/js/froogaloop2.min.js"></script>
<iframe id="vimeo_player" src="http://player.vimeo.com/video/4415083? title=0&byline=0&portrait=0&color=d01e2f&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>
您是否已将 jQuery 添加到您的项目中?您似乎在代码中引用了它(“$”字符)
您或许可以尝试改用此方法
$(player).prop('muted', true);
我发现如果我们将 "player_id" 参数添加到 iframe URL with value = "vimeo_player" ("id" attribute of the框架)。所以结果 URL 将是:
http://player.vimeo.com/video/4415083? title=0&byline=0&portrait=0&color=d01e2f&autoplay=1&player_id=vimeo_player
我在互联网上搜索,尝试了很多方法,但仍然无法正常工作, 我什至直接复制和粘贴代码,把它放到网上,但没有用。所以我会问你们是否可以帮助我
这是代码:
<script src="http://f.vimeocdn.com/js/froogaloop2.min.js"></script>
<iframe id="vimeo_player" src="http://player.vimeo.com/video/4415083? title=0&byline=0&portrait=0&color=d01e2f&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>
您是否已将 jQuery 添加到您的项目中?您似乎在代码中引用了它(“$”字符)
您或许可以尝试改用此方法
$(player).prop('muted', true);
我发现如果我们将 "player_id" 参数添加到 iframe URL with value = "vimeo_player" ("id" attribute of the框架)。所以结果 URL 将是:
http://player.vimeo.com/video/4415083? title=0&byline=0&portrait=0&color=d01e2f&autoplay=1&player_id=vimeo_player