Friday, 15 February 2013

Embedding Windows Media Player in IE


Embedding Windows Media Player in IE


So Here I am with another Post.. This time how to integrate Windows Media Player in Internet Explorer using ASP.Net.. 

Use the following HTML Code in your .aspx file and include a .wmv Video in your root directory and rename it as Song.wmv...

Note: It will work only in IE


<html xmlns="http://www.w3.org/1999/xhtml" >

<head runat="server">

<script language=jscript FOR = VIDEO EVENT = playStateChange(NewState) type=text/jscript>
// Test for the player current state, display a message for each.
switch (NewState)
{
case 1:
alert('Stopped');
break;

case 2:
alert('Paused');
break;

case 3:
alert('Playing');
break;

// Other cases go here.
default:
//alert('Your Default Message.');
}
</script> 

<title>Embedd Windows Media Player</title>

</head>

<body>
    <form id="form1" runat="server">
    <div>   
    <object id="VIDEO" width="900px" height="600px" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
    <param name="URL" value="Song.wmv" />
    <param name="SendPlayStateChangeEvents" value="True" />
    <param name="AutoStart" value="True" />
    <param name="uiMode" value="none" />
    <param name="windowlessVideo" value="True" />
    <param name="stretchToFit" value="true" />
    </object>
    </div>
    </form>
</body>

</html>

No comments:

Post a comment

Thank You for Your Comments. We will get back to you soon.

back to top