我在这里有一个 vimeo JavaScript,有人可以告诉我是否有可能让 vimeo 视频在完成后开始播放;
这是我到目前为止使用 JavaScript 的代码
// JavaScript Document
var animSpeed = 400;
function onPlay(id) {
jQuery('.blankOverlay').fadeIn(animSpeed);
jQuery('h2').text('You clicked play!');
}
function onPause(id) {
jQuery('.blankOverlay').fadeOut(animSpeed);
jQuery('h2').text('The video is paused.');
}
function onFinish(id) {
jQuery('.blankOverlay').fadeOut(animSpeed);
jQuery('h2').text('The video has now finished.');
}
jQuery(function($) {
// ---------------------------------------------------------------------------------------------
// --------------------------------------------- PHYSICIAN INDIVIDUAL PAGES --
/* ----- video player api (vimeo) ----- */
var iframe = $('#vplayer')[0],
player = $f(iframe);
// When the player is ready, add listeners for play, pause, finish, and playProgress
player.addEvent('ready', function() {
player.addEvent('play', onPlay);
player.addEvent('pause', onPause);
player.addEvent('finish', onFinish);
player.addEvent('playProgress', onPlayProgress);
});
$('.introContent, iframe').click(function(){ $('.blankOverlay').fadeIn(animSpeed); });
$('.blankOverlay').click(function(){ $(this).fadeOut(animSpeed); player.api('pause'); });
// ---------------------------------------------------------------------------------------------
});