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 ?

Best Solution

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).

Related Question