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>';