當前位置:編程學習大全網 - 源碼下載 - 求壹網頁MP3播放器代碼

求壹網頁MP3播放器代碼

<html>

<head>

<title>aboutplayer</title>

<style>

body {

overflow:auto;

font-size:12px;

cursor:default;

background-color: #977E4A;

}

#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:0px;

font-size:12px;

background-Color:black;

color:white;

}

#musicList {

width:200px;

border:buttonface 4px groove;

height:80px;

position:absolute;

right:5px;

top:23px;

left: -1px;

}

#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;

}

.style1 {

color: #006699;

font-weight: bold;

}

.style2 {font-size: 12px}

a:link {

text-decoration: none;

}

a:visited {

text-decoration: none;

}

a:hover {

text-decoration: none;

}

a:active {

text-decoration: none;

}

.style4 {font-size: 12px; color: #FFFF33; }

.style7 {font-family: "Times New Roman", Times, serif}

</style>

<script>

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<playList.options.length-1){

playList.options[playList.options.selectedIndex+1].selected=true;

}else{

playList.options[0].selected=true;

}

MediaPlayer1.fileName=playList.value;

MediaPlayer1.play();

setTimeout('MediaPlayer1.play();MediaPlayer1.attachEvent("PlayStateChange",checkPlayStatus);',1000);

}

}catch(e){}

}

</script>

<script>

function doFull()

{

var objId = "MediaPlayer1";

var funcStr = objId + ".displaySize = 3";

eval(funcStr);

}

</script>

<meta /~kkyhm/music/3.wma" onclick="addMusic();">發如雪 - 周傑倫</a></span><br>

<hr>

<span class="style4">Tips: 把歌曲拖入播放列表<br>

</span>

<input type="button" class="style2" onclick="doFull();" value="全屏/ESC返回">

</div>

</td>

</tr>

</table>

</td>

</tr>

</table>

</div>

<div id=info></div>

<body>

</html>

各種網頁播放器代碼大全/htmldata/2005-03-02/1109746478.html

  • 上一篇:最終網頁設計源代碼
  • 下一篇:Socket編程
  • copyright 2024編程學習大全網