私はJW HTML5プレーヤーをjQuery Cycleスライダーに統合しました。問題は、ページが読み込まれたときに自動再生されるようにビデオを設定し、そのスライドが表示されていないときにフラッシュのビデオで起こることです。スライドが表示されるまでHTML5動画が再生されないようにする方法はありますか?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>';
Thannks Grillzに設定できます。問題は、その機能をスライダーにどのように結びつけるのかが分かりません。 – GhostPool
私はあなたのjsを参照する必要がありますが、私は何かのようなものと次の/前のボタンにロジックを結びつけるでしょう:もしslideshow div ID ==ビデオdiv id then play() –