本文介绍了如果浏览器不支持 HTML5 的<video>,我如何显示图像?标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
有谁知道如何为不支持该标签的浏览器显示图像?显示文本,例如:
Does anyone know how can I display an image for the browsers which don't support the tag ? Displaying a text such as in:
<video src="video.mp4" type="video/mp4">
Your browser does not support the <video> tag
</video>
很简单,但是如果我用 img 标签替换文本,它会始终显示图像,即使浏览器确实支持 video 标签.
Is easy, but if I replace the text with an img tag, it will always show the image, even when the browser DOES support the video tag.
感谢分享您的知识
(编辑)事实并非如此,我的测试是错误的,并且 img 标签确实只有在不支持视频时才会呈现(例如 Safari 5)
(EDIT) This is not the case, my tests were wrong and img tag indeed gets rendered only when video is not supported (e.g. Safari 5)
推荐答案
我只是在查看这个链接,以及HTML5 的规范,所以这段代码应该适合你:
I was just checking this link, as well as HTML5's spec, so this code should work for you:
<video controls="controls" poster="<your image poster if applicable>">
<source src="video.mp4" type="video/mp4" />
<img src="<your No video support image>" title="Your browser does not support the <video> tag" />
</video>
这篇关于如果浏览器不支持 HTML5 的<video>,我如何显示图像?标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
The End




大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)