发新话题
打印

音乐播放器代码

本主题由 寒江雪 于 2008-3-13 19:20 移动

音乐播放器代码

背景音乐(midi)

<embed autostart="true" loop="-1" controls="ControlPanel" width="0" height="0" src="http://guest.anyp.cn/uploads/01.mid">


背景音乐

<embed src="音乐地址" width=0 height=0 controls=imagewindow autostart=true loop=true console="huayue">


音乐播放器

<EMBED src="http://chinakongzi.net/2550/eng/music/music/hezou/caiyunzy.rm" width=150 height=25 type=audio/x-pn-realaudio-plugin controls="ControlPanel" autostart="true">


音乐播放器(全功能式)

<EMBED src=你要链接的mp3,rm,ra,ram网址 width=350 height=80 type=audio/x-pn-realaudio-plugin mime-types="mime.types" Initfn="load-types" controls="ControlPanel,StatusBar,TACCtrl" maintainaspect="true" loop="false" autostart="true">


WMA播放器代码
  
<DIV><EMBED style="WIDTH: 220px; HEIGHT: 68px" name=MediaPlayer pluginspage=http://www.microsoft.com/isapi/redir.dll?prd=windows&sbp=mediaplayer&ar=media&sba=plugin& align=baseline src=http://www.zgwho.com/12.mp3 width=220 height=68 type=application/x-mplayer2 border="0" showcontrols="1" showpositioncontrols="0" showaudiocontrols="1" showtracker="1" showdisplay="0" showstatusbar="1" autosize="0" showgotobar="0" showcaptioning="0" autostart="1" autorewind="0" animationatstart="0" transparentatstart="0" allowscan="1" enablecontextmenu="1" clicktoplay="0" defaultframe="datawindow" invokeurls="0"> </EMBED></DIV>


下拉菜单式自加歌播放器

<TABLE style="WIDTH: 204px; HEIGHT: 178px" align=left border=1>
<TBODY>
<TR>
<TD>
<P align=center><FONT color=#ff0000><STRONG>∷∷音乐在线试听∷∷</STRONG></FONT></P></TD></TR>
<TR>
<TD background="" bgColor=#00ccff>
<P>  <SELECT class=st3 style="WIDTH: 180px; HEIGHT: 23px" onchange=changefile() name=songlist> <OPTION value="" selected>☆===请选择歌曲==☆<OPTION value=http://www.nhxx.org/kelley/china/twins/06.mp3>twins-下一站天后<OPTION value=http://www.ibmp3.com/top/12345/020.mp3>黑龙 - 回心转意<OPTION value=http://www.szqj.com/music2/陈奕迅/Black,White%20&%20Grey/十年.mp3>陈亦迅 - 十年<OPTION value=http://202.99.168.198/mp3/gn2/group/s.h.e/05.mp3>S.H.E--Super Star<OPTION value=http://bbb.qitao.com/file8/013.mp3>容祖儿 - 挥着翅膀的女孩<OPTION value=http://pic888.com/music/jay/jay105.mp3>周杰伦 - 东风破<OPTION value=http://www.educast.cn/juniortest/kala/audio/90.mp3>水木年华 - 一生有你<OPTION value=http://www.yf163.com/music/mp3/834-1.mp3>卢巧音 - 好心分手<OPTION value=http://www.haoyy.com/top/mmuu/11.mp3>羽泉 - 奔跑<OPTION value=http://www.ibmp3.com/top/12345/073.mp3>当我再爱你的时候<OPTION value=http://bbb.qitao.com/file8/025.mp3>黄征 - 爱情诺曼底<OPTION value=http://bbb.qitao.com/file8/top200/137.mp3>柯受良 - 大哥<OPTION value=http://www.yf163.com/music/mp3/1812-1.mp3>唐磊 - 丁香花<OPTION value=http://www.ibmp3.com/top/12345/015.mp3>沙宝亮 - 暗香<OPTION value=http://fun.online.tj.cn/content/2002/huangpy/0103.mp3>黄品源 - 小薇<OPTION value=http://www.yf163.com/music/mp3/2724-1.mp3>庾澄庆 - 命中注定<OPTION value=http://live.cnnb.com.cn/k/光的深处_那些花儿_朴树_031127.mp3>朴树 - 那些花儿<OPTION value=http://www.nage.com.cn/mp3/nage1_tw.mp3>SHE-恋人未满<OPTION value=http://fun.online.tj.cn/content/2002/she/0106.mp3>s.h.e - 美丽新世界<OPTION value=http://www.mcyz.net.cn/web/ls/images/世纪情歌/刘若英-为爱痴狂.mp3>刘若英 - 为爱痴狂<OPTION value=http://fun.online.tj.cn/content/2002/caiyl/0102.MP3>蔡依琳 - 看我七十二变<OPTION value=http://www.ibmp3.com/top/12345/360.mp3>郭峰 - 让世界充满爱<OPTION value=http://61.55.139.9/movie/music/002/10.mp3>刘若英 - 一辈子的孤单<OPTION value=http://www.haoyy.com/top/mmuu/107.mp3>莫文蔚 - 广岛之恋<OPTION value=http://www.ibmp3.com/top/12345/206.mp3>江美琪 - 亲爱的你怎么不在我身边<OPTION value=http://www.ibmp3.com/top/12345/273.mp3>周华健 - 一起吃苦的幸福<OPTION value=http://www.ccssc.net/ih/男人不该让女人流泪.mp3>苏永康 - 男人不该让女人流泪<OPTION value=http://www.eyw.edu.cn/manage/racemusic/down/ancientsong/009.mp3>陈奕迅 - 十面埋伏<OPTION value=http://www.haoyy.com/top/mmuu/12.mp3>刘若英 - 后来<OPTION value=http://www.haoyy.com/top/mmuu/080.mp3>刘若英 - 原来你也在这里<OPTION value=http://popmusicmp3.kaiping.gd.ic/newyear/xnxyy.mp3>新年喜喜洋洋.mp3 <OPTION< OPTION></OPTION></SELECT></P>
<P>
<TABLE style="WIDTH: 197px; HEIGHT: 39px" cellPadding=0 width=197 align=center border=0>
<TBODY>
<TR align=middle>
<TD vAlign=center width=80 height=2>
<TABLE height=20 cellSpacing=0 cellPadding=0 width=80 align=center border=0>
<TBODY>
<TR>
<TD id=p1 style="WIDTH: 0px; BACKGROUND-COLOR: #a0a0a0" width=0 bgColor=#cc6699> </TD>
<TD id=p2 style="WIDTH: 80px; BACKGROUND-COLOR: #a0a0a0" width=80 bgColor=#0000ff></TD></TR></TBODY></TABLE></TD>
<TD width=0 height=2></TD>
<TD vAlign=center width=28 height=2>
<TABLE height=14 cellSpacing=1 cellPadding=0 width=30 align=center bgColor=#000000 border=0>
<TBODY>
<TR>
<TD id=stop style="CURSOR: hand; BACKGROUND-COLOR: #a0a0a0" onclick=stop() vAlign=center align=middle width=31 bgColor=#a9bdd9><FONT class=font style="FONT-SIZE: 9pt" color=#ffffff>停止</FONT></TD></TR></TBODY></TABLE></TD>
<TD width=0 height=2></TD>
<TD vAlign=center colSpan=2 height=2>
<TABLE height=14 cellSpacing=1 cellPadding=0 width=30 align=center bgColor=#000000 border=0>
<TBODY>
<TR>
<TD id=play style="CURSOR: hand; BACKGROUND-COLOR: #a0a0a0" onclick=play() vAlign=center align=middle width=30 bgColor=#a9bdd9><FONT class=font style="FONT-SIZE: 9pt" color=#ffffff>播放</FONT></TD></TR></TBODY></TABLE></TD>
<TD width=0 height=2></TD>
<TD vAlign=center width=28 height=2>
<TABLE height=14 cellSpacing=1 cellPadding=0 width=30 align=center bgColor=#000000 border=0>
<TBODY>
<TR>
<TD id=pause style="CURSOR: hand; BACKGROUND-COLOR: #a0a0a0" onclick=pause() vAlign=center align=middle width=32 bgColor=#a9bdd9><FONT class=font style="FONT-SIZE: 9pt" color=#ffffff>暂停</FONT></TD></TR></TBODY></TABLE></TD>
<TD width=12 height=2></TD></TR></TBODY></TABLE></P></TD></TR>
<TR>
<TD background="" bgColor=#00ccff>
<P align=center> <FONT color=#ff3300 size=2>如果播放不出请等待片刻,可能是网络速度的问题导致的</FONT></P></TD></TR></TBODY></TABLE>
<TABLE width=200 align=center border=0>
<TBODY>
<TR>
<TD>
<DIV align=center><FONT color=#ff0000></FONT> </DIV></TD></TR></TBODY></TABLE>
<SCRIPT language=JavaScript>
<!--
var bPlay,bStop,bPause;
bPlay = false;
bStop = false;
bPause = false;
document.all.stop.style.backgroundColor = "a0a0a0";
document.all.pause.style.backgroundColor = "a0a0a0";
document.all.play.style.backgroundColor = "a0a0a0";
function play()
{
if (bPlay)
{
document.MediaPlayer1.AutoStart = true;
document.MediaPlayer1.Play();
}
}

function stop()
{
if (bStop)
{
document.MediaPlayer1.AutoStart = false; document.MediaPlayer1.CurrentPosition=0
document.MediaPlayer1.Stop();
}
}
function pause()
{
if (bPause)
{
document.MediaPlayer1.AutoStart = false;
document.MediaPlayer1.Pause();
}
}
function changefile()
{
if (document.MediaPlayer1.PlayState == 2)
{
stop();
document.MediaPlayer1.AutoStart = true;
}

var url = document.all.songlist.options(document.all.songlist.selectedIndex).value;
if (url != "")
document.MediaPlayer1.Open(url);
}
function playbar()
{
var width;
if (document.MediaPlayer1 == null)
return;

if (document.MediaPlayer1.FileName == "" || document.MediaPlayer1.ReadyState == 0 || document.MediaPlayer1.ReadyState == 1)
{
document.all.p1.style.width = 0;
document.all.p2.style.width = 80;
document.all.p1.style.backgroundColor = "a0a0a0";
document.all.p2.style.backgroundColor = "a0a0a0";
}
else
{
document.all.p1.style.backgroundColor = "3067ca";
document.all.p2.style.backgroundColor = "a9bdd9";
width = document.MediaPlayer1.CurrentPosition*80/document.MediaPlayer1.Duration;
document.all.p1.style.width = width;
document.all.p2.style.width = 80-width;
}
}
function buttons()
{
if (document.MediaPlayer1 == null)
return;

switch(document.MediaPlayer1.PlayState)
{
case 0:
bStop = false;
bPause = false;
document.all.stop.style.backgroundColor = "3067ca";
document.all.pause.style.backgroundColor = "a9bdd9";

if (document.MediaPlayer1.FileName == "" || document.MediaPlayer1.ReadyState == 0 || document.MediaPlayer1.ReadyState == 1)
{
bPlay = false;
document.all.play.style.backgroundColor = "a0a0a0";
document.all.p2.innerHTML="<font color=#000000 style=font-size:9pt>连接中...</font>";
}
else
{
bPlay = true;
document.all.play.style.backgroundColor = "a9bdd9";
document.all.p2.innerHTML="<font color=#000000 style=font-size:9pt>请点击播放</font>";
}
break;
case 1:
bStop = true;
bPause = false;
bPlay = true;
document.all.play.style.backgroundColor = "a9bdd9";
document.all.stop.style.backgroundColor = "a9bdd9";
document.all.pause.style.backgroundColor = "3067ca";
document.all.p2.innerHTML="";
break;
case 2:
bStop = true;
bPause = true;
bPlay = false;
document.all.play.style.backgroundColor = "3067ca";
document.all.stop.style.backgroundColor = "a9bdd9";
document.all.pause.style.backgroundColor = "a9bdd9";
document.all.p2.innerHTML="";
break;
default:
bStop = false;
bPause = false;
bPlay = false;
document.all.play.style.backgroundColor = "a0a0a0";
document.all.stop.style.backgroundColor = "a0a0a0";
document.all.pause.style.backgroundColor = "a0a0a0";
var url = document.all.songlist.options(document.all.songlist.selectedIndex).value;
if (url != "")
document.all.p2.innerHTML="<font color=#000000 style=font-size:9pt>连接中...</font>";
else
document.all.p2.innerHTML="";
break;
}
}
setInterval("playbar();", 100);
setInterval("buttons();", 100);
document.MediaPlayer1.AutoStart = false;
changefile();
-->
</SCRIPT>
</TD></TR></TBODY></TABLE><IFRAME marginWidth=0 marginHeight=0 src="http://count.kaiping.gd.cn/count.asp?partname=popmusic" frameBorder=0 width=1 scrolling=no height=1></IFRAME>
<TABLE height=1 cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD align=middle height=1>
<DIV align=left>
<TABLE height=27 cellSpacing=0 cellPadding=0 width=350 border=0>
<TBODY>
<TR>
<TD vAlign=top align=middle height=27><SPAN id=Tmain></SPAN></TD></TR></TBODY></TABLE></DIV></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<P>
<OBJECT id=MediaPlayer1 height=0 width=0 classid=clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95 VIEWASTEXT><PARAM NAME="AudioStream" VALUE="-1"><PARAM NAME="AutoSize" VALUE="0"><PARAM NAME="AutoStart" VALUE="-1"><PARAM NAME="AnimationAtStart" VALUE="-1"><PARAM NAME="AllowScan" VALUE="-1"><PARAM NAME="AllowChangeDisplaySize" VALUE="-1"><PARAM NAME="AutoRewind" VALUE="0"><PARAM NAME="Balance" VALUE="0"><PARAM NAME="BaseURL" VALUE=""><PARAM NAME="BufferingTime" VALUE="5"><PARAM NAME="CaptioningID" VALUE=""><PARAM NAME="ClickToPlay" VALUE="-1"><PARAM NAME="CursorType" VALUE="0"><PARAM NAME="CurrentPosition" VALUE="-1"><PARAM NAME="CurrentMarker" VALUE="0"><PARAM NAME="DefaultFrame" VALUE=""><PARAM NAME="DisplayBackColor" VALUE="0"><PARAM NAME="DisplayForeColor" VALUE="16777215"><PARAM NAME="DisplayMode" VALUE="0"><PARAM NAME="DisplaySize" VALUE="4"><PARAM NAME="Enabled" VALUE="-1"><PARAM NAME="EnableContextMenu" VALUE="-1"><PARAM NAME="EnablePositionControls" VALUE="-1"><PARAM NAME="EnableFullScreenControls" VALUE="0"><PARAM NAME="EnableTracker" VALUE="-1"><PARAM NAME="Filename" VALUE=""><PARAM NAME="InvokeURLs" VALUE="-1"><PARAM NAME="Language" VALUE="-1"><PARAM NAME="Mute" VALUE="0"><PARAM NAME="PlayCount" VALUE="1"><PARAM NAME="PreviewMode" VALUE="0"><PARAM NAME="Rate" VALUE="1"><PARAM NAME="SAMILang" VALUE=""><PARAM NAME="SAMIStyle" VALUE=""><PARAM NAME="SAMIFileName" VALUE=""><PARAM NAME="SelectionStart" VALUE="-1"><PARAM NAME="SelectionEnd" VALUE="-1"><PARAM NAME="SendOpenStateChangeEvents" VALUE="-1"><PARAM NAME="SendWarningEvents" VALUE="-1"><PARAM NAME="SendErrorEvents" VALUE="-1"><PARAM NAME="SendKeyboardEvents" VALUE="0"><PARAM NAME="SendMouseClickEvents" VALUE="0"><PARAM NAME="SendMouseMoveEvents" VALUE="0"><PARAM NAME="SendPlayStateChangeEvents" VALUE="-1"><PARAM NAME="ShowCaptioning" VALUE="0"><PARAM NAME="ShowControls" VALUE="-1"><PARAM NAME="ShowAudioControls" VALUE="-1"><PARAM NAME="ShowDisplay" VALUE="0"><PARAM NAME="ShowGotoBar" VALUE="0"><PARAM NAME="ShowPositionControls" VALUE="-1"><PARAM NAME="ShowStatusBar" VALUE="0"><PARAM NAME="ShowTracker" VALUE="-1"><PARAM NAME="TransparentAtStart" VALUE="0"><PARAM NAME="VideoBorderWidth" VALUE="0"><PARAM NAME="VideoBorderColor" VALUE="0"><PARAM NAME="VideoBorder3D" VALUE="0"><PARAM NAME="Volume" VALUE="-600"><PARAM NAME="WindowlessVideo" VALUE="0">

控制进度</OBJECT></P></SPAN></TD></TR></TABLE>

TOP

发新话题