FLV and MP4 in Internet Explorer
I know in IE 9 HTML5 is possible. How does one best play video in IE 8 or less? The video formats I have are .mp4 and .ogv version for each video.
I have tried using a flash container but it does not seem to play the video although I do see the container and the controls.
开发者_如何学PythonI tried using an Active-X container and the same thing. I see the container, but no video plays. I then realized that this will only play .wmv.
Here is my code for the Flash container. Any advice on why it might not be working?
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="550" HEIGHT="400" id="myMovieName">
<PARAM NAME=movie VALUE="movies/cars/cars.mp4">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED href="movies/cars/cars.mp4" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="myMovie" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
You are embedding a Flash container, but you are not linking to a Flash file - this cannot work. In order to play videos in a Flash video player, you need to link to an actual Flash video player SWF, like FlowPlayer (there is a free version), which then connects to the web server to play the video (you can use mp4s, but not ogv).
In order to use video in HTML5, you can use the <video>
tag.
But HTML5 video is not yet supported by all browsers, and neither is Flash (at least not on iOS devices).To make sure anyone can play your video, use a combined solution (HTML5 video with Flash fallback). There are free libraries which do this, like Kaltura and VideoJS (site currently seems to have some problems, but it's there).
精彩评论