how to play .mpeg, .avi and flv file on html
I have php script from where user can upload the video file. The file may be mpeg, flv and avi.
Should I need to use two player in html on flash player for flv and second embedded MediaPlayer1 for other files.
But how the embedded code will 开发者_开发知识库be opened at mac/linux based client side. Is the only way to convert mpeg into flv format??
What about html 5 ?
If you really want to play MPEG (non-MP4) or AVI in a web page, yes, you will need to embed a Media Player, with all the consequent codec, compatibility and stability problems that led people to using Flash video (and latterly HTML5) instead.
Non-Windows machines can play these files if they have suitable plugins and codecs installed, as long as you include a standard <object type="...">
, or old-school <embed>
tag inside the IE-specific <object classid="...">
ActiveX media player embedding.
However, yes, for viewer convenience most video-sharing sites do convert uploaded files into FLV, or—these days more likely—MP4 (which plays on recent Flash players as well as some HTML5 <video>
implementations), possibly with OGV or WebM as well (for HTML5 browsers that don't implement MP4 for licensing reasons).
I've tried to play wma, avi, mpg and mp4 video formats on several browsers. Google Chrome and Firefox plays mp4 video with the tag (<video src="Video.mp4" controls="controls"> </video>
).Opera and Internet Explorer could not recognise video in tag. Internet Explorer can play avi video with IE's internal codec. I've used this code for IE:
<embed type="application/x-mplayer2"
name="mediaplayer1" autoplay="false" autostart="false"
width="900" height="600" loop="false" controls="false"
allowFullscreen="True"
src="Video.avi">
</object>
精彩评论