HTML5视频播放不支持IE6-IE8系列浏览器,同时一些比较旧的浏览器也只支持flash方式,拥抱HTML5的同时还要兼容其他浏览,本文将介绍接种方式来解决这个问题。下面这段代码为兼容所有浏览器的代码。
<video width="640" height="360" controls>
<source src="__VIDEO__.MP4" type="video/mp4" />
<source src="__VIDEO__.OGV" type="video/ogg" />
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF">
<param name="movie" value="__FLASH__.SWF" />
<param name="flashvars" value="controlbar=over&image=__POSTER__.JPG&file=__VIDEO__.MP4" />
<img src="__VIDEO__.JPG" width="640" height="360" alt="__TITLE__"
title="No video playback capabilities, please download the video below" />
</object>
</video>
<p> <strong>Download Video:</strong>
Closed Format: <a href="__VIDEO__.MP4">"MP4"</a>
Open Format: <a href="__VIDEO__.OGV">"Ogg"</a>
</p>
虽然看起来很好,但实际上有缺陷。
http://mediaelementjs.com/
http://camendesign.co.uk/code/video_for_everybody
http://www.ckplayer.com/
http://blog.csdn.net/freshlover/article/details/7535785
http://caniuse.com/video