?? music_all.js
字號(hào):
var debugMode = false;function openMusicUrl(sUrl){//alert("顯示菜單");}//--------------------------qusic.js-----------//All Rights Reserved By Micoz.Zhong //Tencent.Crop.Limitedvar S_UNDEFINE= 0;var S_STOP = 1;var S_PAUSE = 2;var S_PLAYING = 3;var S_FORWORD = 4;var S_RESERVSE = 5;var S_BUFFERING = 6;var S_WAITING = 7;var S_MEDIAEND = 8;var S_TRANSITION = 9;var S_READY = 10;var S_RECONNECTION = 11;//播放列表最大個(gè)數(shù)var MAX_PLAYLIST_NUM = 200;var BRANDOMPLAY=false;//當(dāng)前播放器版本var CURRENT_WMP_VERSION = "7.0.0.0";var CURRENT_PLAYER_VERSION = "1.3.0.0";function PlayerListManager(){ this.mFull = false; this.mPosition = -1; this.mpList = new Array(); //獲取播放列表的長(zhǎng)度 this.getCount = function() { return this.mpList.length; } //獲取指定下標(biāo)的播放列表信息 this.getObject = function(n) { return this.mpList[n]; } //根據(jù)播放url查找播放列表的下標(biāo) this.getPos = function(strURL) { for(var i=0; i<this.getCount(); i++) { if(this.getObject(i).mPlayURL==strURL) return i ; } return -1 ; } //根據(jù)播放id查找播放列表的下標(biāo) this.getPosById = function(Id) { for(var i=0; i<this.getCount(); i++) { if(this.getObject(i).mId==Id) return i ; } return -1 ; } //根據(jù)播放id查找對(duì)應(yīng)播放列表內(nèi)容 this.findObjectById = function(iId) { var i = this.getPosById(iId) ; if(i!=-1) return this.getObject(i) ; return null; } //根據(jù)播放url查找對(duì)應(yīng)播放列表 this.findObject = function(strURL) { var i = this.getPos(strURL) ; if(i!=-1) return this.getObject(i) ; return null; } //添加指定內(nèi)容到播放列表 this.addObject = function(iId, strURL, strTorrentURL, iDuration, strSongName, strSingerName, strQzoneKey) { if (strURL=="") return; var obj, pos; if (iId>0) pos = this.getPosById(iId); else if (strURL!="") pos = this.getPos(strURL); if(pos!=-1) { } else if (this.getCount()>=MAX_PLAYLIST_NUM) { this.mFull = true; this.mPosition+=1; if (this.mPosition>=MAX_PLAYLIST_NUM) this.mPosition = 0; obj = this.getObject(this.mPosition); obj.mId = iId; obj.mPlayURL = strURL; obj.mTorrentURL = strTorrentURL; obj.mDuration = iDuration; obj.mSongName = strSongName; obj.mSingerName = strSingerName; obj.mQzoneKey = strQzoneKey; } else { obj = new Object() ; obj.mId = iId; obj.mPlayURL = strURL; obj.mTorrentURL = strTorrentURL; obj.mDuration = iDuration; obj.mSongName = strSongName; obj.mSingerName = strSingerName; obj.mQzoneKey = strQzoneKey; this.mpList[this.getCount()] = obj ; } return; } //根據(jù)播放url更新播放列表 this.updateObject = function(iId, strURL, strTorrentURL, iDuration, strSongName, strSingerName, strQzoneKey) { var n = this.getPos(strURL) ; if(n != -1) { this.mpList[n].mId = iId; this.mpList[n].mDuration = iDuration ; this.mpList[n].mTorrentURL = strTorrentURL; this.mpList[n].mSongName = strSongName; this.mpList[n].mSingerName = strSingerName; this.mpList[n].mQzoneKey = strQzoneKey; return true; } return false; } //根據(jù)id更新播放列表 this.updateObjectById = function(iId, strURL, strTorrentURL, iDuration, strSongName, strSingerName, strQzoneKey) { var n = this.getPosById(iId) ; if(n != -1) { this.mpList[n].mPlayURL = strURL; this.mpList[n].mTorrentURL = strTorrentURL; this.mpList[n].mDuration = iDuration ; this.mpList[n].mSongName = strSongName; this.mpList[n].mSingerName = strSingerName; this.mpList[n].mQzoneKey = strQzoneKey; return true; } return false; } //根據(jù)播放url從播放列表中刪除指定內(nèi)容 this.deleteObject = function(strURL) { var n = this.getPos(strURL) ; if(n!=-1) { delete this.mpList[n]; this.mpList.length-- ; return true; } return false; } //根據(jù)播放id從播放列表中刪除指定內(nèi)容 this.deleteObjectById = function(iId) { var n = this.getPosById(iId) ; if(n!=-1) { delete this.mpList[n]; this.mpList.length-- ; return true; } return false; } //清空播放列表 this.clearObject = function() { for(var i=0; i<this.getCount(); i++) delete this.mpList[i]; this.mpList.length = 0; }}function WMPlayer(){ this.mPlayerName = ""; this.mInitializeStatus = false; this.mMute = false; this.mPlayList = new PlayerListManager(); this.mPlayingPos = -1; this.mVisible = true; this.mInstall = true; this.mDLLink = ""; this.checkPlayer = function(strDLLink) { var objPlayer = document.all(this.mPlayerName); if (!objPlayer) return false; if (!objPlayer.Controls) return false; return true; } this.createActiveX = function(bVisible, bInstall, objName, objWidth, objHeight, strUinCookieName, strKeyCookieName, strDLLink) { if (objName=="") objName = "wmplayer"; this.mPlayerName = objName; var objStr = "<OBJECT id=\"" + objName + "\" width=\""+ objWidth + "\" height=\"" + objHeight + "\" CLASSID=\"CLSID:6BF52A52-394A-11D3-B153-00C04F79FAA6\">"; objStr = objStr + "<PARAM Name=\"autoStart\" value=\"true\">"; if (!bVisible) objStr = objStr + "<PARAM Name=\"uiMode\" value=\"invisible\">"; objStr = objStr + "</OBJECT>"; this.mVisible = bVisible; this.mInstall = bInstall; this.mDLLink = strDLLink; return objStr; } this.initialize = function() { if (!this.checkPlayer()) { if (this.mInstall) { alert("對(duì)不起,您現(xiàn)在的媒體播放器版本太低,請(qǐng)升級(jí)媒體播放器。"); //window.location = this.mDLLink; } return false; } this.mInitializeStatus = true; return true; } this.isInitialize = function() { return this.mInitializeStatus; } this.getStatus = function() { if (!this.mInitializeStatus) return -1; return document.all(this.mPlayerName).playState; } this.getCurrentMusic = function() { if (this.mPlayingPos<0) return null; return this.mPlayList.getObject(this.mPlayingPos); } this.runPlayer = function(strPlayURL) { if (!this.mInitializeStatus) return; if (this.isPause()) { } else if ( (strPlayURL!=null) && (strPlayURL!="") ) { document.all(this.mPlayerName).URL = strPlayURL; this.mPlayList.addObject(-1, strPlayURL, "", 0, "", ""); this.mPlayingPos = this.mPlayList.getPos(strPlayURL); } if ( (this.mPlayingPos<0) && (this.mPlayList.getCount()>0 ) ) { this.mPlayingPos = 0; document.all(this.mPlayerName).URL = this.mPlayList.getObject(0).mPlayURL; } try { if (document.all(this.mPlayerName).Controls.isAvailable('play')) document.all(this.mPlayerName).Controls.Play(); } catch(e) { if(debugMode) status = ("error 2 "+e.message) } return; }
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -