2012年9月2日 星期日

Embed wmv video in HTML

To embed a wmv video in HTML, use following:
It works for Chrome, IE and Firefox.
*source value must be absolute URL, i.e. http://xxxxx/xxx.wmv (relative path not work)

<OBJECT  id=MediaPlayer2 codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 type=application/x-oleobject height=358 standby="Loading Microsoft Windows Media Player Components..." width=512>    <embed type="application/x-mplayer2"   src="http://iviewer.ouhk.edu.hk/iViewerWeb/html/iviewer/video/save%20study%20unit%20as%20pdf%20v2a.wmv"   width="480"   height="288"   pluginspage="http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin&" autosize="1" autostart="0" showcontrols="1" showdisplay="0" showstatusbar="1"> </embed></OBJECT>


One of the reason that firefox fail to play video is the server's MIME type is set as below:
<mime-mapping> 
<extension>wmv</extension> 
<mime-type>video/x-ms-wmv</mime-type> 
</mime-mapping> 

沒有留言:

張貼留言