Sunday, May 27, 2007

Ways of using object in HTML

1) Following code snippet displays the use Window Media player in HTML page ---

<object id="Player" width="320" height="300" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<param name="bgcolor" value="#FF9900" />
<param name="Volume" value="50" />
<param name="AutoStart" value="True" />
<embed type='application/x-mplayer2' id='Player' name='mediaPlayer' width="100%" height="100%" autostart='True' src='Videos/Sample.MPG' showcontrols='0' showtracker='0' showdisplay='0' showstatusbar='0' videoborder3d='0'>

2) Following code snippet displays the use Flash object in HTML page ---

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=",0,0,0" width="100%" height="100%" id="sample" align="middle">
<param name="movie" value="externalinterface.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="always" />
<embed src="externalinterface.swf" allowscriptaccess="always" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="sample" align="middle" type="application/x-shockwave-flash" pluginspage="" />

In IE we use ‘<object>……</object>’ tag while in Non-IE we use ‘<embed>……</embed>’ tag.

No comments: