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