我已将 JW HTML5 播放器集成到我的 jQuery Cycle 滑块中。问题是,如果我将视频设置为在页面加载时自动播放,而不是在幻灯片进入视图时播放 - 这就是 Flash 视频所发生的情况。有没有办法阻止 HTML5 视频在幻灯片显示之前播放?
这是我正在使用的代码:
<video id="video-'.$video_name.'" width="'.$width.'" height="'.$height.'" poster="'.get_bloginfo('template_directory') .'/lib/scripts/timthumb.php?src='.$image.'&h='.$height.'&w='.$width.'&zc=1" controls="controls">
<source src="'.$html5_1.'" type="video/mp4" />
<source src="'.$html5_1.'" type="video/webm" />
<source src="'.$html5_2.'" type="video/ogg" />
</video>
<script>
jwplayer("video-'.$video_name.'").setup({
file: "'.$url.'",
image: "'.get_bloginfo('template_directory') .'/lib/scripts/timthumb.php?src='.$image.'&h='.$height.'&w='.$width.'&zc=1",
icons: "'.$icons.'",
autostart: "'.$autostart.'",
stretching: "'.$stretching.'",
controlbar: "'.$controlbar.'",
skin: "'.$skin.'",
screencolor: "white",
height: '.$height.',
width: '.$width.',
players: [';
if($fallback == "flash") {
$out .= '{type: "html5"}, {type: "flash", src: "'.get_bloginfo("template_directory").'/lib/scripts/mediaplayer/player.swf"}';
} elseif($fallback == "html5") {
$out .= '{type: "flash", src: "'.get_bloginfo("template_directory").'/lib/scripts/mediaplayer/player.swf"}, { type: "html5" },';
}
$out .= ']
});
</script>';