views:

210

answers:

2

how to play and stop sound control by javascript in wmplayer in asp.net ?

A: 

You can embed the windows media player in an HTML page and then use javascript to manipulate the object.

They have properties for volume, balance and methods to mute.

http://msdn.microsoft.com/en-us/library/dd564581%28VS.85%29.aspx

EDIT: Here's another good reference: http://www.mioplanet.com/rsc/embed%5Fmediaplayer.htm

bryanbcook
A: 
<script type="text/javascript">
   function doThings(n) {
     if(n==1)
       document.getElementById('VIDEO').controls.play();
     else
     if(n==2)
       document.getElementById('VIDEO').controls.stop();
   }
</script>
<OBJECT id="VIDEO" width="320" height="240" 
    CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
    type="application/x-oleobject">

    <PARAM NAME="URL" VALUE="town.mid">
    <PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
    <PARAM NAME="AutoStart" VALUE="False">
    <PARAM name="uiMode" value="none">
    <PARAM name="PlayCount" value="9999">
</OBJECT>

<input type="button" value="start" onclick="doThings(1)"/>
<input type="button" value="stop" onclick="doThings(2)"/>
adatapost