我想淡出 Vimeo 通用嵌入(iframe 版本),暂停它,淡入另一个,然后自动播放。我的代码淡出并暂停第一个视频,但立即引入新的(没有淡入淡出),然后不自动播放。我猜这是语法问题。我正在使用 froogaloop js 库来控制 Vimeo API。
想法?谢谢你的帮助!
HTML:
<div id="fire" class="vim">
<iframe id="regular" class="vid" src="http://player.vimeo.com/video/22327264?api=1&title=0&byline=0&portrait=0&color=ffffff"></iframe>
<iframe id="behind" class="vid" src="http://player.vimeo.com/video/22466069?api=1&title=0&byline=0&portrait=0&color=ffffff"></iframe>
<p style="float:left">
"Sound of Fire"<br />
This Century<br />
Warner Brothers Records
</p>
<p id="bts" style="float:right;color:#000000;cursor:pointer;">
<br />
Click to launch the "Sound of Fire" behind the scenes video!<br />
</p>
</div>
JavaScript:
$('#behind').hide();
$('#bts').click(function() {
$('#regular').fadeOut(400);
var player=$f($('.vid:visible')[0]);
player.api('pause');
$('#behind').fadeIn(400);
player.api('play');
});