哥哥:
如何实现播放mp3啊!
我在这里这是受益非浅啊
http://qjhwqs.home4u.china.com/other/gxwj/yanshi/p1-1.html
演示地址 网上的...
代码..仅供参考..不知道好不好用..
里面的.js可以到他的网站上去下...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>华仔娱乐网 - MP3在线播放器</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</SCRIPT>
</head>
<body>
<script language=jscript>
document.writeln("<html>");
document.writeln("<HEAD>");
document.writeln("<TITLE>华仔娱乐网—播放器<\/TITLE>");
document.writeln("<META name=\"Description\" content=\"mp3,asf,wav,mid,网上媒体播放\">");
document.writeln("<META http-equiv=\"Content-Type\" content=\"text\/html; charset=gb2312
\">");
document.writeln("<script language=JScript src=\"js\/u.js\"><\/script>");
document.writeln("<STYLE TYPE=\"text\/css\">");
document.writeln("<!--");
document.writeln(".TITLE,.TIME{FONT-FAMILY: \"ARIAL\", \"HELVETICA\", \"SANS-
SERIF\";COLOR:#a20056;}");
document.writeln(".shad {cursor:hand;color:white;width:135px;height:18px;line-
height:18px;overflow:hidden;}");
document.writeln("td,font,span{font-size: 12px;}");
document.writeln("a:link,a:visited{color:red;}");
document.writeln("a:hover,a:active{color:yellow;}");
document.writeln(".had,input,span {cursor:hand;color:white}");
document.writeln("body{margin-top:0px;margin-left:0px;}");
document.writeln(".mmlist td{background:#999999;height:24px;behavior:url
(colorfade.htc);fade-mode:backgroundColor;from-color:rgb(118,118,118);to-color:rgb
(255,153,0);fade-speed:3;}");
document.writeln(".playban td{white-space:nowrap;}");
document.writeln("-->");
document.writeln("<\/STYLE>");
document.writeln("<SCRIPT Language=\"JavaScript\" src=\"js\/cnsidebudl.js\"><\/SCRIPT>");
document.writeln("<SCRIPT Language=\"JavaScript\" src=\"js\/cnsidebudset.js\"><\/SCRIPT>");
document.writeln("<script language=JScript src=\"js\/list1.js\"><\/script>");
document.writeln("<SCRIPT Language =\"JScript\" FOR=Exobud EVENT=openStateChange(sf)>
evtOSChg(sf); <\/SCRIPT>");
document.writeln("<SCRIPT Language =\"JScript\" FOR=Exobud EVENT=playStateChange(ns)>
evtPSChg(ns); <\/SCRIPT>");
document.writeln("<SCRIPT Language =\"JScript\" FOR=Exobud EVENT=error()> evtWmpError();
<\/SCRIPT>");
document.writeln("<SCRIPT Language =\"JScript\" FOR=Exobud EVENT=Buffering(bf)> evtWmpBuff
(bf); <\/SCRIPT>");
document.writeln("<SCRIPT Language =\"JavaScript\" src=\"js\/imgchg.js\"><\/SCRIPT>");
document.writeln("<SCRIPT Language =\"JavaScript\" src=\"js\/clearevents.js\"><\/SCRIPT>");
document.writeln("<\/HEAD>");
document.writeln("<BODY onload=\"initExobud();show5();dspList();\">");
document.writeln(" <!-- 调用Windows Media 7.0播放器 -->");
document.writeln("<OBJECT ID=Exobud CLASSID=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6
\"");
document.writeln(" type=\"application\/x-oleobject\" width=\"0\" height=\"0\" ");
document.writeln(" style=\"position:relative;left:0px;
top:0px;width:0px;height:0px;\">");
document.writeln(" <param name=\"autoStart\" value=\"true\">");
document.writeln(" <param name=\"balance\" value=\"0\">");
document.writeln(" <param name=\"currentPosition\" value=\"0\">");
document.writeln(" <param name=\"currentMarker\" value=\"0\">");
document.writeln(" <param name=\"enableContextMenu\" value=\"false\">");
document.writeln(" <param name=\"enableErrorDialogs\" value=\"false\">");
document.writeln(" <param name=\"enabled\" value=\"true\">");
document.writeln(" <param name=\"fullScreen\" value=\"false\">");
document.writeln(" <param name=\"invokeURLs\" value=\"false\">");
document.writeln(" <param name=\"mute\" value=\"false\">");
document.writeln(" <param name=\"playCount\" value=\"1\">");
document.writeln(" <param name=\"rate\" value=\"1\">");
document.writeln(" <param name=\"uiMode\" value=\"none\">");
document.writeln(" <param name=\"volume\" value=\"100\">");
document.writeln("<\/OBJECT>");
document.writeln("<TABLE border=0 cellpadding=0 cellspacing=0 width=650>");
document.writeln(" <TR><TD bgcolor=\"#999999\" height=300 id=\"mmList\"
valign=top><\/TD><\/TR>");
document.writeln(" <TR><TD height=25 bgcolor=\"#172434\"
id=\"pageList\"><\/TD><\/TR><\/TABLE>");
document.writeln("");
document.writeln(" <TABLE border=0 cellpadding=0 cellspacing=0 width=650 height=25>");
document.writeln(" <TR>");
document.writeln(" <TD height=\"25\" bgcolor=\"#fcfcfc\" width=\"*\" align=center
valign=middle id=\"pageInfo\" style=\"color:black\"><\/td>");
document.writeln(" <TD height=25 width=200 bgcolor=\"#fcfcfc\" align=center
valign=middle>");
document.writeln("");
document.writeln(" <img onClick=\"chkAllSel();dspList(cblock);\" class=had title=\"全选
\" src=\"img\/allsel.gif\" width=\"45\" height=\"25\" border=\"0\">");
document.writeln(" <img onClick=\"chkAllDesel();dspList(cblock);\" class=had title=\"
清除\" src=\"img\/alldesel.gif\" width=\"45\" height=\"25\" border=\"0\">");
document.writeln(" <img onClick=\"wmpStop();startExobud();this.blur();\" class=had
title=\"播放\" src=\"img\/play.gif\" width=\"45\" height=\"25\" border=\"0\">");
document.writeln(" <\/TD>");
document.writeln(" <\/TR>");
document.writeln(" <\/TABLE>");
document.writeln("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border-
collapse: collapse\" width=\"650\" background=\"img\/back.gif\">");
document.writeln(" <tr>");
document.writeln(" <td>");
document.writeln(" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"
style=\"border-collapse: collapse\">");
document.writeln(" <tr>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"scope\" border=\"0\" src=\"img\/scope_off.gif\"
onClick=\"vizExobud();\" style=\"cursor:help;\" width=\"35\" height=\"27\"><\/td>");
document.writeln(" <td NOWRAP><img border=\"0\" src=\"img\/bg1.gif\" width=\"15\"
height=\"27\"><\/td>");
document.writeln(" <td background=\"img\/bg2.gif\" width=\"182\" align=\"center\"
NOWRAP>");
document.writeln(" <marquee behavior=\"scroll\" scrolldelay=70 scrollamount=2
width=167 height=12> <span id=\"disp1\" width=100 class=\"title\"
align=left>在线MP3试听<\/span>  <span id=liveclock
width=150 class=\"time\"><\/span><\/marquee><\/td>");
document.writeln(" <td NOWRAP width=><img border=\"0\" src=\"img\/bg3.gif\"
width=\"19\" height=\"27\"><\/td>");
document.writeln(" <td background=\"img\/bg4.gif\" align=center width=\"79\" NOWRAP
onClick=\"chgTimeFmt();this.blur();\"><span id=\"disp2\" width=83 class=\"time\"
align=\"center\" title =\"时间显示(T)\" style=\"cursor:hand;\">00:00 |
00:00<\/span><\/td>");
document.writeln(" <td NOWRAP><img border=\"0\" src=\"img\/bg5.gif\" width=\"14\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"vup\" border=\"0\" src=\"img\/btn_vup.gif\"
onClick=\"wmpVolUp();this.blur();\" onMouseOver=\"imgtog(\'vup\',2);\" onMouseOut=\"imgtog
(\'vup\',3)\" style=\"cursor:hand;\" title=\"增音(↑)\" width=\"22\" height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"vmute\" border=\"0\" src=\"img\/btn_mute_off.gif\"
onClick=\"wmpMute();this.blur();\" onMouseOver=\"imgtog(\'vmute\',2);\" onMouseOut=\"imgtog
(\'vmute\',3);\" style=\"cursor:hand;\" title=\"静音(A)\" width=\"12\" height=\"27
\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"vdn\" border=\"0\" src=\"img\/btn_vdn.gif\"
onClick=\"wmpVolDn();this.blur();\" onMouseOver=\"imgtog(\'vdn\',2);\" onMouseOut=\"imgtog
(\'vdn\',3)\" style=\"cursor:hand;\" title=\"降音(↓)\" width=\"22\" height=\"27\"><\/td>");
document.writeln(" <td NOWRAP><img border=\"0\" src=\"img\/bg6.gif\" width=\"10\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"pmode\" border=\"0\" src=\"img\/btn_rndmode_off.gif\"
onClick=\"chgPMode();this.blur();\" onMouseOver=\"imgtog(\'pmode\',2);\"
onMouseOut=\"imgtog(\'pmode\',3)\" style=\"cursor:hand;\" title=\"模式(S\/R)\" width=\"46\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP><img border=\"0\" src=\"img\/bg7.gif\" width=\"9\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"rept\" border=\"0\" src=\"img\/btn_rept_off.gif\"
onClick=\"chkRept();this.blur();\" onMouseOver=\"imgtog(\'rept\',2);\" onMouseOut=\"imgtog
(\'rept\',3)\" style=\"cursor:hand;\" title=\"循环(L)\" width=\"27\" height=\"27\"><\/td>");
document.writeln(" <td NOWRAP><img border=\"0\" src=\"img\/bg8.gif\" width=\"12\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"prevt\" border=\"0\" src=\"img\/btn_prev.gif\"
onClick=\"playPrev();this.blur();\" onMouseOver=\"imgtog(\'prevt\',2);\"
onMouseOut=\"imgtog(\'prevt\',3)\" style=\"cursor:hand;\" title=\"上一首(←)\" width=\"21\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"pauzt\" border=\"0\" src=\"img\/btn_pauz_off.gif\"
onClick=\"wmpPP();this.blur();\" onMouseOver=\"imgtog(\'pauzt\',2);\" onMouseOut=\"imgtog
(\'pauzt\',3)\" style=\"cursor:hand;\" title=\"暂停\/继续(X)\" width=\"18\" height=\"27
\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"stopt\" border=\"0\" src=\"img\/btn_stop.gif\"
onClick=\"wmpStop();this.blur();\" onMouseOver=\"imgtog(\'stopt\',2);\" onMouseOut=\"imgtog
(\'stopt\',3)\" style=\"cursor:hand;\" title=\"停止(C)\" width=\"19\" height=\"27
\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"playt\" border=\"0\" src=\"img\/btn_play.gif\"
onClick=\"startExobud();this.blur();\" onMouseOver=\"imgtog(\'playt\',2);\"
onMouseOut=\"imgtog(\'playt\',3)\" style=\"cursor:hand;\" title=\"播放(P\/V)\" width=\"19\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP>");
document.writeln(" <img name=\"nextt\" border=\"0\" src=\"img\/btn_next.gif\"
onClick=\"playNext();this.blur();\" onMouseOver=\"imgtog(\'nextt\',2);\"
onMouseOut=\"imgtog(\'nextt\',3)\" style=\"cursor:hand;\" title=\"下一首(→)\" width=\"17\"
height=\"27\"><\/td>");
document.writeln(" <td NOWRAP><\/td>");
document.writeln(" <td><img border=\"0\" src=\"img\/btn_min2.gif\" width=\"22\"
height=\"27\"><\/td>");
document.writeln(" <td><img border=\"0\" src=\"img\/btn_fullscreen2.gif\" width=\"31
\" height=\"27\"><\/td>");
document.writeln(" <\/tr>");
document.writeln(" <\/table>");
document.writeln(" <\/td>");
document.writeln(" <\/tr>");
document.writeln("<\/table>");
document.writeln(" <script> ");
document.writeln(" initExobud(); ");
document.writeln(" <\/script> ");
document.writeln("<script language=JScript src=..\/bdstat\/count.js><\/script>");
document.writeln("<\/BODY> ");
document.writeln("<\/HTML>")
</script>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><script src="/other/gxwj/tool/tj1.js"></script></p>
</body>
</html>