较为费劲的地区是drop到播放列表,查MSDN查了n久,也有Window Media Player 6.x软件的play一些怪异,所以我的编码也一些怪异........

摆脱诸位多测一测,有Bug您讲话,看着我做的也挺不易的,感觉好的您也多捧捧场祝贺。
My HTML Player body { overflow:auto; font-size:12px; cursor:default; } #table01 { font-size:12px; background-Color:black; color:white; text-align:center; } #playListTitle { background-Color:#001122; color:white; font-size:12px; font-weight:bold; width:100%; height:16px; padding:2px; } #playList { width:150px; height:225px; margin:1080x; font-size:12px; background-Color:black; color:white; } #musicList { width:201080x; border:buttonface 4px groove; height:80px; position:absolute; right:5px; top:5px; } #musicListTitle { font-size:13px; width:100%; height:20px; background-Color:#C5FFC5; padding:3px; font-weight:bold; } #musicList a { text-decoration:none; width:100%; height:20px; line-height:20px; font-szie:20px; line-height:20px; padding-top:5px; padding-left:10px; } #musicList a:hover { background-Color:#E5FFE5; } function playList_dragOver(){ event.returnValue=false; } function playList_dragEnter(){ event.returnValue=false; event.dataTransfer.dropEffect='link'; } function addMusic(){ if(event.srcElement.tagName=='A'){ strTxt=event.srcElement.innerText; strURL=event.srcElement.href; playList.innerHTML=""; playList.options[0]=new Option(strTxt,strURL); playList.options[0].selected=true; } event.returnValue=false; playList_dblClick(); return(false); } function playList_drop(){ strTxt=unescape(event.dataTransfer.getData('Text').split(":")[0]); strURL=unescape(event.dataTransfer.getData('Text').split(":")[1]); playList.options[playList.options.length]=new Option(strTxt,strURL); } function playList_keyDown(){ if(event.keyCode==46){ try{ playList.options[playList.options.selectedIndex].outerHTML=""; }catch(e){} return(false); } if(event.keyCode==13){ playList_dblClick(); return(false); } } function playList_dblClick(){ MediaPlayer1.detachEvent("PlayStateChange",checkPlayStatus); MediaPlayer1.fileName=playList.value; MediaPlayer1.play(); setTimeout('MediaPlayer1.play();MediaPlayer1.attachEvent("PlayStateChange",checkPlayStatus);',1000); } function musicList_dragStart(){ if(event.srcElement.tagName=='A'){ event.dataTransfer.setData('Text',escape(event.srcElement.innerText) ":" escape(event.srcElement.href)); }else{ return(false); } } function init(){ MediaPlayer1.AutoRewind=false; MediaPlayer1.AutoStart=true; MediaPlayer1.SendPlayStateChangeEvents=true; MediaPlayer1.attachEvent("PlayStateChange",checkPlayStatus); } function checkPlayStatus(oldState,newState){ try{ if(MediaPlayer1.PlayState==0){ MediaPlayer1.detachEvent("PlayStateChange",checkPlayStatus); MediaPlayer1.stop(); if(playList.options.selectedIndex Play List: All Music 夜曲 - 周董 手记 - 周笔畅 不得不爱 - 潘玮柏 发如雪 - 周董
Tips: 把音乐拖进播放列表
[Ctrl A 选中 注:引入外界Js需再更新一下网页页面才可以实行]