在HTML4和HTML5中嵌入视频 [英] Embeding a Video in HTML4 vs HTML5
问题描述
< embed src =MyVideo.mp4/>
虽然上面的代码可以用HTML5写成:
< video src =MyVideo.mp4>< / video>
所以我能看到的仅仅是语法差异。除此之外,还有什么区别。
这是否意味着如果我们将使用HTML5嵌入视频,那么浏览器不会使用任何第三方软件播放视频?
关于标签的想法是浏览器应该有本地支持,而不需要额外的软件。该标准还没有准备好,其中一个未达成共识的观点就是支持哪些编解码器。有关更多信息,您可以查看 html5视频wiki 页面,其中包含哪些浏览器支持的列表什么格式。
如果您计划实施html5视频标签,则应提供向后兼容性。一种方法是使用 VideoJS 库,如果浏览器不支持视频源,该库将回退到闪存。
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?
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.
这篇关于在HTML4和HTML5中嵌入视频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!