Jquery html5视频和回退到iframe不工作
我正在用HTML5和vimeo自动播放视频Jquery html5视频和回退到iframe不工作,jquery,html,video,iframe,Jquery,Html,Video,Iframe,我正在用HTML5和vimeo自动播放视频 <video width="100%" height="100%" autoplay="autoplay"> <source src="video/mp4.mp4" type="video/mp4" /> <source src="video/ogv.theora.ogv" type="video/ogg" /> <iframe src="http://player.vimeo.com/
<video width="100%" height="100%" autoplay="autoplay">
<source src="video/mp4.mp4" type="video/mp4" />
<source src="video/ogv.theora.ogv" type="video/ogg" />
<iframe src="http://player.vimeo.com/video/43010500?title=0&byline=0&portrait=0&color=ffffff&autoplay=1" width="100%" height="100%" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</video>
这对Safari和Firefox都很好,但在chrome上有回音。我拿出vimeo iframe,回声消失了,我猜chrome正在使用HTML5视频,iframe视频也隐藏在它下面播放
如果浏览器无法播放html5视频,那么返回iframe的最佳方式是什么
谢谢。我建议您使用Modernizer来检查是否支持html5视频。如果支持,则插入视频标签;如果不支持,则插入iframe
if(现代化视频){
$('#videoplayer').html('您拥有的所有视频内容');//或构建它并附加
}否则{
$('#videoplayer').html('iframe code');
}
我不必说,已经有很多插件和工具可以做到这一点
谢谢,我从未使用过Modernizer。但这是完美的。
<div id="videoplayer"></div>
if (Modernizr.video) {
$('#videoplayer').html('all the video stuff you have'); // or build it and append
} else {
$('#videoplayer').html('iframe code');
}