Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/87.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery HTML5视频自动播放滑块问题_Jquery_Video_Html_Slider_Autoplay - Fatal编程技术网

Jquery HTML5视频自动播放滑块问题

Jquery HTML5视频自动播放滑块问题,jquery,video,html,slider,autoplay,Jquery,Video,Html,Slider,Autoplay,我已经将JWHTML5播放器集成到我的jQuery循环滑块中。问题是,如果我将视频设置为在页面加载时自动播放,而不是在幻灯片进入视图时播放,这就是Flash视频的情况。有没有办法阻止HTML5视频在幻灯片放映之前播放 这是我正在使用的代码: <video id="video-'.$video_name.'" width="'.$width.'" height="'.$height.'" poster="'.get_bloginfo('template_directory') .'/lib

我已经将JWHTML5播放器集成到我的jQuery循环滑块中。问题是,如果我将视频设置为在页面加载时自动播放,而不是在幻灯片进入视图时播放,这就是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>';

jwplayer(“视频-”.$video_name.”)。安装程序({
文件:“'.$url.”,
图像:“'.get_bloginfo('template_directory')。/lib/scripts/timtumb.php?src='.$image.&h='.$height.&w='.$width.&zc=1”,
图标:“'.$icons.”,
autostart:“'.$autostart.”,
拉伸:“.$STRINGING.”,
controlbar:“'.$controlbar.”,
皮肤:“.$skin.”,
屏幕颜色:“白色”,
高度:‘.$height’,
宽度:'.$width',
玩家:[';
如果($fallback==“flash”){
$out.='{type:“html5”},{type:“flash”,src:“'.get_bloginfo(“template_目录”)。/lib/scripts/mediaplayer/player.swf”}”;
}elseif($fallback==“html5”){
$out.='{type:“flash”,src:“'.get_bloginfo(“模板目录”)。/lib/scripts/mediaplayer/player.swf”},{type:“html5”};
}
$out.=']
});
';

请参阅这篇opera开发文章:


您可以将play()函数绑定到js中,以便在加载幻灯片时启动视频。

设置
video
tag
属性
preload=“auto”


“预加载”属性指定加载页面时,作者认为视频是否应加载以及加载方式。
preload
的默认值为
none
您可以将其设置为
metadata
auto

Thanks Grillz。问题是我不确定如何将该函数绑定到滑块上。我需要查看您的js,但我会将逻辑绑定到下一个/上一个按钮中,比如:如果slideshow div ID==video div ID,那么播放()