Saturday, March 8, 2008

Embed Media Player for web Site

Windows Media Player Object Model Reference

Working in IE6 and IE7

<OBJECT ID="Player" width="0" height="0"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<embed type="application/x-mplayer2" id="Player"
pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/"
width="0" height="0" src="song.mp3"
filename="1.mp3" autostart="False"
showcontrols="True" showstatusbar="False"
showdisplay="False" autorewind="True"></embed>
</object>

Method and Properties :-
Player.playState // to get The State of Player (Play,Pause or stop)
Player.controls.play() //to Play
Player.controls.pause() //to Pause
Player.controls.stop() //to Stop
Player.controls.currentPosition //to get Current Postion of File
Player.currentMedia.duration //to get Length of the file


Please Find More Information : -
http://msdn2.microsoft.com/en-us/library/bb249259(VS.85).aspx
http://msdn2.microsoft.com/en-us/library/bb249259%28VS.85%29.aspx> // for Settings object
http://msdn2.microsoft.com/en-us/library/bb262747(VS.85).aspx // for Media Object
http://msdn2.microsoft.com/en-us/library/bb249349(VS.85).aspx // for Player Object

No comments: