html5 vs html4,Embeding a Video in HTML4 vs HTML5

本文对比了HTML4与HTML5中视频嵌入的区别,重点介绍了HTML5视频标签的基本用法及浏览器支持情况,并探讨了不同视频格式的支持问题。此外,还提供了一种使用VideoJS库确保向后兼容性的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题

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:

While the above code can be written in HTML5 will be:

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?

回答1:

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.

回答2:

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.

回答3:

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.

来源:https://stackoverflow.com/questions/5800822/embeding-a-video-in-html4-vs-html5

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值