[英]Flash fallback not working in case HTML video is not supported
I am using HTML video with flash fallback on my site but the flash doesnt seem to work in case HTML video is not supported. 我使用的HTML视频与Flash后备我的网站 ,但不支持似乎并不万一HTML视频工作闪光灯。 Do I need to include any javascript file to make this work ?
我需要包括任何javascript文件才能使其正常工作吗?
<video width="800" height="400" preload=""
onloadeddata="document.getElementById('videoLoadImg').style.display = 'none';"
poster="/admin/config/header_files/top.jpg" autoplay="">
<source src="/admin/config/header_files/top.mp4" type='video/mp4;' />
<source src="/admin/config/header_files/top.webm" type='video/webm;
codecs="vp8, vorbis"' />
<source src="/admin/config/header_files/top.ogv" type='video/ogg;
codecs="theora, vorbis"' />
<embed src='/admin/config/header_files/top.swf'
type='application/x-shockwave-flash' width='800' height='400'
allowscriptaccess='always' allowfullscreen='false'></embed>
<img src='/admin/config/header_files/cake.jpg' />
</video>
The HTML video is not working on my iMac with Safari 5.0.6. HTML视频无法在带有Safari 5.0.6的iMac上运行。
Could it be the video is not auto played? 视频不能自动播放吗? because when I open WebKit Inspector and try
因为当我打开WebKit Inspector并尝试
document.querySelector('video').play()
and it works. 而且有效。 This case you could the code above to jQuery DOMReady, or add the
autoplay
attribute like this: 这种情况下,您可以将上面的代码添加到jQuery DOMReady中,或添加如下所示的
autoplay
属性:
<video autobuffer autoplay>
FYI: I have Safari 5.1.2, however I believe Safari has support for HTML5 video around 4.0. 仅供参考:我有Safari 5.1.2,但是我相信Safari支持4.0左右的HTML5视频。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.