In addition to solution 1, you should consider browser compatibility as well.
The
<object>
will only work in Internet Explorer on Windows.
The
<embed>
will only work if the user has installed the Windows Media Player plugin. In Firefox,
this plugin is disabled by default[
^].
The plugin is also not supported in 64-bit browsers.
You'd probably have better luck using
the HTML5 <video>
element[
^] instead. It's supported by
pretty much everything[
^] beyond IE8. You can still use your current code as a fallback.
<video src="/AppVideos/2.mp4" controls autoplay>
<!--
<object classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701" type="application/x-oleobject" width="320" height="310">
<param name="filename" value="/AppVideos/2.mp4" />
<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" />
<!--
<embed src="/AppVideoa/2.mp4" 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="320" height="310" />
</object>
</video>