I am using the following to display one .mp4 file in the browser:-
<![if !IE]>
<video width="480" height="360" controls="controls">
<source src="<?php echo $video; ?>" type="video/mp4">
<param name="src" value="<?php echo $video; ?>" />
<param name="autoplay" value="true" />
</video>
<![endif]>
<!--[if IE]>
<object width="480" height="360" type="application/x-mplayer2" codebase="http://www.microsoft.com/Windows/MediaPlayer/">
<param name="Filename" value="<?php echo $video; ?>">
<param name="AutoStart" value="true">
<param name="ShowControls" value="true">
<param name="BufferingTime" value="2">
<param name="ShowStatusBar" value="true">
<param name="AutoSize" value="true">
<param name="InvokeURLs" value="false">
</object>
<![endif]-->
In IE, it is displaying the file but it is not working in chrome. However, if I use the same code and change src to a video located on web already, it works:-
<video width="480" height="360" controls="controls">
<source src="http://ia700204.us.archive.org/2/items/Pbtestfilemp4videotestmp4/video_test_512kb.mp4" type="video/mp4">
<param name="src" value="http://ia700204.us.archive.org/2/items/Pbtestfilemp4videotestmp4/video_test_512kb.mp4" />
<param name="autoplay" value="true" />
</video>
I have also tried the embed code:-
<embed src="<?php echo $video; ?>" type="application/x-mplayer2" autostart="1" enabled="1" showstatusbar="1" showdisplay="1" showcontrols="1" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" width="480" height="360"></embed>
If it is a problem with code, then even the .mp4 file available on net should not play. If it is a problem with source, the file should not play in Internet explorer.
Can someone help me with the issue?
<param name="src" value="<?php echo $video; ?>" />
– btevfik<video>
tag with proper fallback to solve this rather than complicate things with IE/!IE if you can (you can also use canPlayType to test for support for .mp4/.webm/.ogg as needed) – Offbeatmammal