日期:2014-05-17  浏览次数:20722 次

网页中加入Windows media 和操作方法
1、加入Windows Media
<OBJECT id=phx height=44 width=220 classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6>
			<PARAM NAME="URL" VALUE="mms://mms.cnr.cn/cnr001?MzE5MTg0IzEjIzI5NjgwOQ==">
			<PARAM NAME="rate" VALUE="1">
			<PARAM NAME="balance" VALUE="0">
			<PARAM NAME="currentPosition" VALUE="196.7526689">
			<PARAM NAME="defaultFrame" VALUE="">
			<PARAM NAME="playCount" VALUE="1">
			<PARAM NAME="autoStart" VALUE="-1">
			<PARAM NAME="currentMarker" VALUE="0">
			<PARAM NAME="invokeURLs" VALUE="-1">
			<PARAM NAME="baseURL" VALUE="">
			<PARAM NAME="volume" VALUE="50">
			<PARAM NAME="mute" VALUE="0">
			<PARAM NAME="uiMode" VALUE="full">
			<PARAM NAME="stretchToFit" VALUE="0">
			<PARAM NAME="windowlessVideo" VALUE="0">
			<PARAM NAME="enabled" VALUE="-1">
			<PARAM NAME="enableContextMenu" VALUE="-1">
			<PARAM NAME="fullScreen" VALUE="0">
			<PARAM NAME="SAMIStyle" VALUE="">
			<PARAM NAME="SAMILang" VALUE="">
			<PARAM NAME="SAMIFilename" VALUE="">
			<PARAM NAME="captioningID" VALUE="">
			<PARAM NAME="enableErrorDialogs" VALUE="0">
			<PARAM NAME="_cx" VALUE="5821">
			<PARAM NAME="_cy" VALUE="1164"> 		    		    		    		    		    		    		    		    		    		    		    		    
			<!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示-->		    	    		    		    		    		    		    		    		    		    		    
	</OBJECT>


2、JS控制Windows Media 的方法


<SCRIPT language=javascript>
			var playUrl;
			var volv ;
			var arr = new Array();
			if(arr = parseXmlToShinyvMaterialArray('<Materials><Material><ID><![CDATA[29]]></ID><Type><![CDATA[1]]></Type><Name><![CDATA[中国之声]]></Name><Size><![CDATA[0]]></Size><PlayLength><![CDATA[0]]></PlayLength><Bitrate><![CDATA[0]]></Bitrate><MediaType><![CDATA[AV]]></MediaType><MediaFormat><![CDATA[]]></MediaFormat><VideoWndSize><![CDATA[]]></VideoWndSize><PlayUrlAsx><![CDATA[mms://mms.cnr.cn/cnr001?MzE5MTg0IzEjIzI5NjgwOQ==]]></PlayUrlAsx><PlayUrlReal><![CDATA[mms://mms.cnr.cn/cnr001?MzE5MTg0IzEjIzI5NjgwOQ==]]></PlayUrlReal></Material></Materials>')){
				playUrl = arr[0].PlayUrlAsx;
			}


		function playerInit(){
			zurl = getParameter('zurl');
			zname = getParameter('zname');
			if(zurl != null ){
				phx.URL = decodeURIComponent(zurl);
			}else{
				phx.URL = playUrl;
			}
			if(zname != null){
				songName.innerHTML = decodeURIComponent(zname);
			}
			
			
		setInterval("if(phx.playState==3){phx.currentMedia.durationString=='00:00'?s='':s='/'+phx.currentMedia.durationString;time.innerText = phx.controls.currentPositionString+s}",1000);
		setInterval("if(phx.playState==0){time.innerText = '准备'}",1000);
		setInterval("if(phx.playState==1){time.innerText = '停止'}",1000);
		setInterval("if(phx.playState==2){time.innerText = '暂停'}",1000);
		setInterval("if(phx.playState==4){time.innerText = 'ScanForward'}",1000);
		setInterval("if(phx.playState==5){time.innerText = 'ScanReverse'}",1000);
		setInterval("if(phx.playState==6){time.innerText = '缓冲'}",1000);
		setInterval("if(phx.playState==7){time.innerText = '准备'}",1000);
		setInterval("if(phx.playState==8){time.innerText = 'MediaEnded'}",1000);
		setInterval("if(phx.playState==9){time.innerText = '准备'}",1000);
		setInterval("if(phx.playState==10){time.innerText = '准备'}",1000);
		setInterval("if(phx.playState==11){time.innerText = '准备'}",1000);
		window.setTimeout('setInterval("if(phx.current