我想在艺术家网站上嵌入几个视频,自动播放和静音。
我在Muting an embedded vimeo video的帮助下设法将其静音
但有几个视频不起作用,视频会自动停止
所以我添加了&autopause=0
并播放了两个视频,但声音又恢复了!
HTML:
<iframe id="vimeo_player" src="https://player.vimeo.com/video/101835861?api=1&player_id=vimeo_player&autopause=0&autoplay=1&loop=1&title=0&portrait=0" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<iframe id="vimeo_playerr" src="https://player.vimeo.com/video/57277798?api=1&player_id=vimeo_player&autopause=0&autoplay=1&loop=1&title=0&byline=0&portrait=0" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
脚本
<script src="https://f.vimeocdn.com/js/froogaloop2.min.js"></script>
$(function() {
var vimeo_iframe = $('#vimeo_player')[0];
var player = $f(vimeo_iframe);
player.addEvent('ready', function() {
player.api('setVolume', 0);
});
var vimeo_iframer = $('#vimeo_playerr')[0];
var playerr = $f(vimeo_iframer);
playerr.addEvent('ready', function() {
playerr.api('setVolume', 0);
});
});
你们有没有想过如何解决这个问题?
答案 0 :(得分:0)
如果我理解正确,请尝试将&amp; background = 1添加到src网址而不是&amp; autoplay = 0