使主流浏览器兼容video和audio标签

梦想不抛弃苦心追求的人,只要不停止追求,你们会沐浴在梦想的光辉之中。再美好的梦想与目标,再完美的计划和方案,如果不能尽快在行动中落实,最终只能是纸上谈兵,空想一番。只要瞄准了大方向,坚持不懈地做下去,才能够扫除挡在梦想前面的障碍,实现美好的人生蓝图。使主流浏览器兼容video和audio标签,希望对大家有帮助,欢迎收藏,转发!站点地址:www.bmabk.com,来源:原文

How to enable <video> and <audio> tags in all major browsers 

 

To make Html5 video and audio tags work in all major browsers, simply add the following line of code somewhere in the <head> of your document.

<script src="http://api.html5media.info/1.1.8/html5media.min.js"></script>

 

That’s it! There is no second step!

How to embed video
You can embed video into your page using the following code.

 

 

 

 

<video src="video.mp4" width="320" height="200" controls preload></video>

 

For more information and troubleshooting, please visit the video wiki page.(https://github.com/etianen/html5media/wiki/embedding-video)

How to embed audio
You can embed audio into your page using the following code.

 

 

 

 

 

 

<audio src="audio.mp3" controls preload></audio>

 

 

For more information and troubleshooting, please visit the audio wiki page(https://github.com/etianen/html5media/wiki/embedding-audio).

Why use html5media?
HTML5 video and audio tags were designed to make embedding a video as easy as embedding an image. They were also designed to give users a faster experience by doing away with browser plugins such as Adobe Flash.

Unfortunately, older browsers don’t support HTML5 video and audio tags, and even modern browsers don’t support a consistent set of video codecs, making embedding a video rather difficult.

The html5media project makes embedding video or audio as easy as it was meant to be. It’s a fire-and-forget solution, and doesn’t require installing any files on your server. Unlike many other HTML5 video players, it allows people to use the video controls supplied by their own web browser. It’s one of the smallest, fastest solutions available, and as browser technology improves it will become even faster.

More information
The html5media project is open source and can be found on GitHub. You can find out more information on the html5media wiki(https://github.com/etianen/html5media/wiki), or the mainhtml5media project page(https://github.com/etianen/html5media).

转自/参考:https://html5media.info/

 

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/151235.html

(0)
飞熊的头像飞熊bm

相关推荐

发表回复

登录后才能评论
极客之音——专业性很强的中文编程技术网站,欢迎收藏到浏览器,订阅我们!