Flash 和 HTML5 是后备方案吗?
是否可以先使用 Flash 视频,然后再回退到 html5?
就像我有这样的东西 if(Flash 已安装){ 运行 flash 播放器} else if(can do video tag w/ h.264){ use HTML5 video tag with h.264}
现在这是 javascript,所以它是用 javascript 编写的,那么内部 html 将获得正确的标签。
Is it possible to have Flash video first then to fall back to html5?
Like I have something like this if(Flash is installed){ run flash player} else if(can do video tag w/ h.264){ use HTML5 video tag with h.264}
Now this is javascript so it's being written in javascript, then the inner html will get the right tags.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下是使用 Flash 作为 HTML5 视频后备的示例,正如 Andrew 所描述的: http://henriksjokvist.net/archive/2009/2/using-the-html5-video-tag-with-a-flash-fallback
我倾向于同意 Andrew 关于切换后备顺序的观点,但如果您确实想要先使用 Flash,则可以随时反转上面链接示例中所述的逻辑。
Here is an example of using Flash as a fallback to HTML5 video, as Andrew describes: http://henriksjokvist.net/archive/2009/2/using-the-html5-video-tag-with-a-flash-fallback
I tend to agree with Andrew regarding switching the fallback order, but if you really want Flash first, you could always reverse the logic as described in the above linked example.
您可以在 此处找到 javascript flash 检测教程。或者一个可以满足您需求的插件(如果我读过 wright)这里
you can find a javascript flash detection tutorial here. Or a plugin that will meet your needs (if I read wright) here
这只是我的意见,但我认为您最好切换后备顺序:HTML5 视频并后备到 Flash。 Flash 市场渗透率如此之高,以至于我怀疑是否有任何访问者访问您的网站将会体验到可以说更好的 HTML5 视频传输。另外,由于已经编写了像 VideoJS 这样的脚本来处理此类后备,因此实现起来会容易得多。这只是我的两分钱,但希望它有帮助。
This is just my opinion, but I think you'd be better off switching the fallback order: HTML5 video with a fallback to Flash. Flash market penetration is so high that I doubt any visitors to your site would ever experience the arguably better HTML5 video delivery. Plus, it would be much easier to implement as scripts like VideoJS have already been written to handle such fallbacks. This is just my two cents, but hopefully it's helpful.