让每个人的视频工作没有编码的OGG
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了让每个人的视频工作没有编码的OGG相关的知识,希望对你有一定的参考价值。
Video For Everybody is a great way to use the `` tag with fallbacks for QuickTime or Flash for users with old browsers, but it requires that every video be encoded twice (once for the MP4 and once for the OGG).This code (which requires Mootools but could be easily rewritten to avoid that requirement) allows you to provide a better experience for users of very old Flash Players (which don't support H.264 playback) and working video for Firefox users (without encoding any OGG files).
The code should be run onDomReady, and only if there's a `` element on the page. Due to my requirements, this code only addresses the first `` element on the page.
The video element should be enclosed in a `` or other suitable container.
checkVideo: function() { var videoElement = document.getElement('video'); var supportsVideo = !!(videoElement.canPlayType); if(!supportsVideo && (Browser.Plugins.Flash.version < 9 || (Browser.Plugins.Flash.version == 9 && Browser.Plugins.Flash.build < 60))) { var warning = new Element('div', { 'class': 'warning', 'html': '<p>Please <a href="http://www.adobe.com/go/getflash">update Flash</a> or <a href="http://www.apple.com/quicktime/download/">QuickTime</a> if you can’t see the video on the right</p>' }); warning.inject(videoElement.getParent().getParent(), 'bottom'); } else if(supportsVideo && !videoElement.canPlayType('video/mp4')) { // Browser can't play MP4 in the video tag var fallback = videoElement.get('html'); // Get fallback content (QuickTime and Flash object tags) videoElement.getParent().set('html', fallback); // Replace the video tag with the fallback content } }
以上是关于让每个人的视频工作没有编码的OGG的主要内容,如果未能解决你的问题,请参考以下文章
为啥 Chrome浏览器用<video>播放视频没有画面就只有声音,IE就可以。