flash video - How to close WMP automatically when the play ends -


i need close wmp (window media player) automatically display on flash. code follows.

main page wmp displayed code:

<script type="text/javascript">     $(document).ready(function(){         var flashvars = {        shelfxmldata : "/elibnida/shelf/categoryinclientlistxml/${clientid}",        coverxmldata : "/elibnida/shelf/coverbookincategoryxml",        saverxmldata : "/elibnida/shelf/screensaverinclientxml/?clientid=${clientid}",        secureurl:"http://elibrary4.nida.ac.th/media/crossdomain.xml"     };       var params = {        menu: "false",        allowdomain : "always",        allowscriptaccess: "always",        allowfullscreen: "true",        wmode:"opaque"     };       var attribute = {};     $.post("/elibnida/shelf/themeinclient/${clientid}",function(theme){                                                swfobject.embedswf("${createlinkto(dir:'swf',file:'digitalbookshelf"+theme+".swf')}","flash","1920","1080","9.0.0","${createlinkto(dir:'swf',file:'expressinstall.swf')}",                         flashvars, params, attribute);                         })     }); 

display wmp code:

<div id="media" style="margin-left:auto;margin-right:auto"></div>  <script type="text/javascript">     $(document).ready(function(){     var thistype = "${contenttype}";     var opaclink = "${opclink}";      if(thistype == "windowclip"){                        wmv = '<object id="mediaplayer" width="1280" height="960"                 classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95"                standby="loading windows media player components..."                     type="application/x-oleobject">';         wmv += '<param name="filename" value="${value}">';         wmv += '<param name="autostart" value="true">';         wmv += '<param name="showcontrols" value="true">';         wmv += '<param name="showstatusbar" value="false">';         wmv += '<param name="showdisplay" value="false">';         wmv += '<param name="stretchtofit" value="true">';         wmv += '<param name="loop" value="true">';          wmv += '<embed  type="application/x-ms-wmp" src="${value}"                  name="mediaplayer"width="1280" height="960" showcontrols="true"                  showstatusbar="false"showdisplay="false" autostart="true"                  stretchtofit="true" loop="true"</embed>';             wmv += '</object>';                                                               $("#media").prepend(wmv).width(1280).height(960).css({"margin-top":"50px"});  

how close it?


Comments