在 HTML4 与 HTML5 中嵌入视频
在寻找 HTML4 和 HTML5 之间的差异时,我发现了以下观点:
HTML5 为网络世界带来了全新的维度。无需使用Flash等特殊软件即可在网页中嵌入视频
因此,如果我们考虑 HTML4 中的示例代码,然后嵌入视频,那么这将是:
<embed src="MyVideo.mp4"/>
虽然上面的代码可以用 HTML5 编写,
<video src="MyVideo.mp4"></video>
但我可以做什么 :看到的只是语法差异。除此之外还有什么区别呢。
这是否意味着如果我们使用 HTML5 嵌入视频,那么浏览器将不会使用任何第三方软件来播放视频?
While searching for difference between HTML4 and HTML5 I came across the point that :
HTML5 brings a whole new dimension to web world. It can embed video on web-pages without using any special software like Flash
So if we will consider a sample code in HTML4 then for embeding video then that will be:
<embed src="MyVideo.mp4"/>
While the above code can be written in HTML5 will be:
<video src="MyVideo.mp4"></video>
So what can I see is just the syntax difference. Apart from that what else is the difference.
Does this mean if we will use HTML5 to embed a video then the browser is not going to use any third parties software to play the video?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关于标签的想法是浏览器应该对其有本机支持,而不需要使用任何附加软件。该标准尚未准备就绪,尚未达成一致的要点之一是支持哪些编解码器。有关详细信息,您可以查看 html5 视频 wiki 页面,其中包含浏览器支持的列表什么格式。
如果您计划实现 html5 视频标签,则应该提供向后兼容性。一种方法是使用 VideoJS 库,如果浏览器不支持视频源,该库将回退到 flash。
The idea regarding the tag is that the browsers should have native support for it, without the use of any additional software. The standard is not yet ready, and one of the points not agreed upon is regarding what codecs to support. For more information you could have a look at the html5 video wiki page which includes a list of which browsers support what formats.
If you are planning on implementing the html5 video tag, you should provide backwards compatibility. One way is to use the VideoJS library, which will fall back to flash, if the browser doesn't support the video source.
当前的 HTML5 草案规范并未指定浏览器在 video 标签中应支持哪些视频格式。用户代理可以自由支持他们认为合适的任何视频格式。如果浏览器中未内置解码器,则格式支持将由操作系统的多媒体框架决定。
The current HTML5 draft specification does not specify which video formats browsers should support in the video tag. User agents are free to support any video formats they feel are appropriate. In cases where decoders are not built into the browser, the format support will be dictated by the multimedia framework of the operating system.
以下是您可能想看到的内容: 20 个 HTML5 视频播放器示例及源码
VideoJS 是一个 HTML5 视频播放器,使用 Javascript 和 CSS 构建, Flash 视频的后备方案当浏览器不支持 HTML5 视频时使用的播放器。
Here is what you might want to see : 20 Examples of HTML5 Video Player with Source
VideoJS is an HTML5 Video Player, built with Javascript and CSS, with a fallback to a Flash video player for when the browser doesn't support HTML5 video.