简体   繁体   English

在 HTML4 中嵌入视频与 HTML5

[英]Embeding a Video in HTML4 vs HTML5

While searching for difference between HTML4 and HTML5 I came across the point that:在寻找 HTML4 和 HTML5 之间的区别时,我遇到了以下问题:

HTML5 brings a whole new dimension to web world. HTML5 为 web 世界带来了全新的维度。 It can embed video on web-pages without using any special software like Flash它可以在网页上嵌入视频,而无需使用任何特殊软件,如 Flash

So if we will consider a sample code in HTML4 then for embeding video then that will be:因此,如果我们将考虑 HTML4 中的示例代码,然后用于嵌入视频,那么它将是:

<embed src="MyVideo.mp4"/>

While the above code can be written in HTML5 will be:而上面的代码可以写成 HTML5 将是:

<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?这是否意味着如果我们将使用 HTML5 嵌入视频,那么浏览器将不会使用任何第三方软件来播放视频?

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.有关更多信息,您可以查看html5 视频 wiki页面,其中包含哪些浏览器支持哪些格式的列表。

If you are planning on implementing the html5 video tag, you should provide backwards compatibility.如果您计划实施 html5 视频标签,您应该提供向后兼容性。 One way is to use the VideoJS library, which will fall back to flash, if the browser doesn't support the video source.一种方法是使用VideoJS库,如果浏览器不支持视频源,它将回退到 flash。

The current HTML5 draft specification does not specify which video formats browsers should support in the video tag.当前的 HTML5 草案规范没有指定浏览器应该在视频标签中支持哪些视频格式。 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.在浏览器中没有内置解码器的情况下,格式支持将由操作系统的多媒体框架决定。

Here is what you might want to see: 20 Examples of HTML5 Video Player with Source以下是您可能希望看到的内容: 20 个 HTML5 视频播放器示例

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. 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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM