⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cnsidebud.js

📁 简单的博客 基于asp开发的网站
💻 JS
📖 第 1 页 / 共 2 页
字号:
 else{	var idx=cActIdx;
 	var blnFind=false;
	for(var i=0;i<intSelMmCnt;i++){	if(cActIdx==arrSelMm[i]){idx=i+1; blnFind=true;}}
	if(!blnFind){startCnSideBud();return;}
	if(idx>=intSelMmCnt){idx=0;cActIdx=arrSelMm[idx];}
	else{cActIdx=arrSelMm[idx];}
	selMmPlay(cActIdx);
 }
}


function retryPlay(){
  selMmPlay(cActIdx);
}


function chkRept(){
 var wmps=CnSideBud.playState;
 if(wmps == 3){clearInterval(tidTLab);}
 if(blnRept){blnRept=false; imgChange('rept',0);disp2.innerHTML="Norm. Play";}
 else{blnRept=true; imgChange('rept',1);disp2.innerHTML="Repeat";}
 tidMsg= setTimeout('rtnTLab()',1000);
}


function chgPMode(){
 var wmps=CnSideBud.playState;
 if(wmps == 3){clearInterval(tidTLab);}
 if(blnRndPlay){blnRndPlay=false; imgChange('pmode',0);disp2.innerHTML="SEQ. Play";}
 else{blnRndPlay=true; imgChange('pmode',1);disp2.innerHTML="RND. Play";}
 tidMsg=setTimeout('rtnTLab()',1000); 
}


function evtOSChg(f){
// 0(Undefined) 8(MediaChanging) 9(MediaLocating) 10(MediaConnecting) 11(MediaLoading) 
// 12(MediaOpening) 13(MediaOpen) 20(MediaWaiting) 21(OpeningUnknownURL)

 if(f==8){capText.innerHTML='<iframe name="ads" id="ads" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="width:100%;height:60;overflow:hidden;" allowtransparency src="ads.html"></iframe>';}
 if(f==13){
	var strTitle = CnSideBud.currentMedia.getItemInfo("title");
	if(strTitle.length <=0){strTitle = "未知"}
	var strAuthor = CnSideBud.currentMedia.getItemInfo("Author");
	if(strAuthor.length <=0){strAuthor = "未知"}
	var strCopy = CnSideBud.currentMedia.getItemInfo("Copyright");
	if(strCopy.length <=0){strCopy = "未知"}
	var strType = CnSideBud.currentMedia.getItemInfo("MediaType");
	var strDur=CnSideBud.currentMedia.durationString;
	var strUrl =CnSideBud.URL;
	var trknum=cActIdx+1;
	var ctit = objMmInfo[cActIdx].mmTit;
	var ccl = objMmInfo[cActIdx].mmCl;
	if(ctit=="nAnT"){ objMmInfo[cActIdx].mmTit = strAuthor + " - " + strTitle;
		ctit=strAuthor + " - " + strTitle;
		cActTit="T"+ trknum + ". " +ctit;
		disp1.innerHTML = cActTit;
		disp4.innerHTML = ccl;
	}

	strMmInfo= "Media (Title) : " + strTitle + " (CnSide MP:" + strType +")" + "\n"
	strMmInfo= strMmInfo + "Media (Author) : " + strAuthor + "\n"
        strMmInfo= strMmInfo + "Media (URL) : 媒体路径已被隐藏 \n";
	//strMmInfo= strMmInfo + "Media (URL) : " +strUrl + "\n"
	strMmInfo= strMmInfo + "Media (Copyright) : " + strCopy +"\n" 
	strMmInfo= strMmInfo + "Media (Duration) : " +strDur +"\n\n";
    strMmInfo= strMmInfo + "意念首页:http://www.cnside.com \n";
	strMmInfo= strMmInfo + "CnSide MP 2002-2003\n";
	if(blnShowMmInfo){alert(strMmInfo);}
 }
}


function evtPSChg(f){
// 0(Undefined) 1(Stopped) 2 (Paused) 3(Playing) 4(ScanFowrd) 5(ScanReverse)
// 6(Buffering) 7(Waitng) 8(MediaEnded) 9(Transitioning) 10(Redy)

 switch(f){
	case 1:
		evtStop();
		break;
	case 2:
		evtPause();
		break;
	case 3:
		evtPlay();
		break;
	case 8:
		setTimeout('playAuto()', intDelay);
		break;
 }
}


//evtWmpBuff()
function evtWmpBuff(f){
	 if(f){ disp2.innerHTML = "Buffering";
		var msg="Loading..." + cActTit;
		disp1.innerHTML = msg;
		if(blnStatusBar){window.status=(msg);}
	}
	else{
	disp1.innerHTML=cActTit;
	var ccl = objMmInfo[cActIdx].mmCl;
	disp4.innerHTML=ccl;
	showTLab();
	}
}


//evtWmpError()
function evtWmpError(){
 intErrCnt=intErrCnt+1;
 if(intErrCnt<=3){
	disp2.innerHTML="Error("+intErrCnt+")";
	var msg="(Error:" + intErrCnt +") " +cActTit;
	disp1.innerHTML="Error..." +cActTit;
	disp4.innerHTML='发生错误';
	if(blnStatusBar){window.status=(msg);}
	tidErr=setTimeout('retryPlay()',1000);
 }
 else{	clearTimeout(tidErr);
	intErrCnt=0;showTLab();
	var msg="发生错误";
	if(blnStatusBar){window.status=(msg);}	
	setTimeout('playAuto()',1000);}
}

function evtStop(){
	clearTimeout(tidErr);
	clearInterval(tidTLab);
	showTLab();
	intErrCnt=0;
	imgChange("pauzt",0);
	imgChange("playt",0);
	imgChange("scope",0);
	time.style.pixelLeft=3;
	disp1.innerHTML="CnSide MP Player";
	disp4.innerHTML="播放器已停止";
	if(blnStatusBar){window.status=('CnSide MP Player');return true;}
}

function evtPause(){
 imgChange("pauzt",1)
 imgChange("playt",0);
 imgChange("stopt",0);
 imgChange("scope",0);
 clearInterval(tidTLab);
 showTLab();
}

function evtPlay(){
 imgChange("pauzt",0)
 imgChange("playt",1);
 imgChange("stopt",0);
 imgChange("scope",1);
 tidTLab=setInterval('showTLab()',1000);
}

//showTLab()
function showTLab(){
 var ps=CnSideBud.playState;
 if(ps==2 || ps==3){
	var cp=CnSideBud.controls.currentPosition
	var cps=CnSideBud.controls.currentPositionString
	var dur=CnSideBud.currentMedia.duration;
	var durs=CnSideBud.currentMedia.durationString;
	if(blnElaps){disp2.innerHTML= cps+" | "+durs;
		var msg=cActTit + " ("+cps+" | "+durs+ ")";
		if(ps==2){msg="(CnSide MP) "+ msg;}
		if(blnStatusBar){window.status=(msg);return true;}
	}
	else{var laps= dur-cp; 
		var strLaps=wmpTime(laps);
		disp2.innerHTML= strLaps + " | "+durs;
		var msg= cActTit + " (" + strLaps + " | "+durs + ")";
		if(ps==2){msg="(CnSide MP) "+ msg;}
		if(blnStatusBar){window.status=(msg);return true;}
	}
//PrositionBar
	if (CnSideBud.controls.currentPosition>0){
		var now_postion=Math.floor(cp);
		var total_postion=Math.floor(dur);
		var postion_value=((now_postion * 200) / total_postion) +3;
		if (postion_value){
			document.all.time.style.pixelLeft=postion_value;
			}
		}
//

 }
 else{disp2.innerHTML="00:00 | 00:00";}
}


function chgTimeFmt(){
 var wmps=CnSideBud.playState;
 if(wmps == 3){clearInterval(tidTLab);}
 if(blnElaps){blnElaps=false; disp2.innerHTML="Laps";}
 else{blnElaps=true;disp2.innerHTML="ELaps";}
 tidMsg=setTimeout('rtnTLab()',1000); 
}

// rtnTLab()
function rtnTLab(){
clearTimeout(tidMsg);
var wmps=CnSideBud.playState;
if(wmps == 3){tidTLab=setInterval('showTLab()',1000);}
else{showTLab();}
}

function wmpTime(dur){
	var hh, min, sec, timeLabel
	hh = Math.floor(dur/3600);
	min = Math.floor(dur / 60)%60;
	sec = Math.floor(dur % 60);
	if (isNaN(min)){ return "00:00"; }
	if (isNaN(hh) || hh==0){timeLabel="";}
	else{
		if(hh >9){timeLabel = hh.toString()+":";}
		else{timeLabel="0"+hh.toString() +":";}
	}
  	if ( min > 9 ){  timeLabel = timeLabel + min.toString() + ":"; }
	else {timeLabel = timeLabel + "0" +min.toString() + ":";}
	if ( sec > 9 ){timeLabel = timeLabel + sec.toString();}
	else{timeLabel = timeLabel + "0" + sec.toString();}
	return timeLabel;
}

var time_startpoint=3;
var time_endpoint=200;
var chkEvent = 0;

function SetStatebar(){
		if(Math.floor(CnSideBud.controls.currentPosition)>0){
			positionSet=true;
			iex=event.clientX;
			tempx=time.style.pixelLeft;
			document.onmousemove=positionDragControl;
			if (document.all){document.onmouseup=playerSetPosition;}
		}
}

function positionDragControl(){
	if (positionSet){
		var mov = tempx+event.clientX-iex;
		if ((mov >= time_startpoint)  && (mov < time_endpoint)){
			time.style.pixelLeft=mov;
			if ( chkEvent != 3 ) { chkEvent++; } else { chkEvent = 0;	}
		} return false;
	}
}

function playerSetPosition(){
	if (positionSet){
		positionSet=false;
		CnSideBud.controls.CurrentPosition = Math.floor(CnSideBud.currentMedia.duration *((time.style.pixelLeft-4)/196));
	}
}

function drag_dropie(){
	if (setVolMove){
		var mov = Pos_Left+event.clientX-XX;
		if ((mov >= 100)  && (mov < 170)){
			cutpoint=170-sound.style.pixelLeft;
			sound.style.pixelLeft=Pos_Left+event.clientX-XX;
			CnSideBud.settings.Volume=100-(100*(cutpoint/60));
			disp2.innerHTML="Vol. " + CnSideBud.settings.Volume +"%";
			if (mov < 100) { CnSideBud.settings.Mute = true; } else { CnSideBud.settings.Mute=false; }
		}return false;
	}
}
function SetVolume(){
	XX=event.clientX;
	Pos_Left=sound.style.pixelLeft;
	setVolMove=true;
	document.onmousemove=drag_dropie;
	if (document.all){document.onmouseup=endVolume;}
}
function endVolume(){setVolMove=false;}


function waitMsg(){
 capText.innerHTML='<iframe name="ads" id="ads" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="width:100%;height:60;overflow:hidden;" allowtransparency src="ads.html"></iframe>';
 if(intCnSideBudStat ==1){disp1.innerHTML="CnSide MP Player";}
 if(intCnSideBudStat ==2){disp1.innerHTML="CnSide MP Player";}
 if(blnStatusBar){
	if(intCnSideBudStat ==1){window.status=('CnSide MP Player');return true;}
	if(intCnSideBudStat ==2){window.status=('CnSide MP Player'); return true;}
 }
}


function chkWmpState(){
// 0(Undefined) 1(Stopped) 2 (Paused) 3(Playing) 4(ScanFowrd) 5(ScanReverse)
// 6(Buffering) 7(Waitng) 8(MediaEnded) 9(Transitioning) 10(Redy)
 return CnSideBud.playState;
}

function chkWmpOState(){
// 0(Undefined) 8(MediaChanging) 9(MediaLocating) 10(MediaConnecting) 11(MediaLoading) 
// 12(MediaOpening) 13(MediaOpen) 20(MediaWaiting) 21(OpeningUnknownURL)
 return CnSideBud.openState;
}

function chkOnline(){
// true(Network Connected) false(Network Lost)
return CnSideBud.isOnline;
}

function vizCnSideBud(){
//CnSideBud.launchURL("http://www.cnside.com");
  window.open("http://www.cnside.com","vizCnSideBud");
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -