I have a link to play a video in my website. When a user click on that video link, the div which embedded that video will popup(not popup window, its showing hidden div using jquery BlockUI). And there is close button it will hide the div which embedded video.
Everything is working fine. But video is not stopping on closing that div. I can hear the sound :( . I want to stop that sound too on closing that video. What to do. Please do the needful
<OBJECT ID="MediaPlayers" WIDTH="400" HEIGHT="350" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="1.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="1.wmv" NAME="MediaPlayer"
WIDTH="400" HEIGHT="350" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
Try to use this when you close the popup window.
document.getElementById("MediaPlayers").stop();
Or you can use another div to wrap this player, and then add your html into innerHTML when open popup window and then remove all when you close the window. like
<div id="playerWrap">
<OBJECT ID="MediaPlayers" ....
.....
</OBJECT>
</div>
javascript code:
document.getElementById("palyerWrap").innerHTML = "";
reference by http://www.htmlforums.com/multimedia-elements/t-accessing-mediaplayer-functionality-from-javascript-65899.html