1、JS创建<embed>标签
var i = Math.round(Math.random()*30)var browsername = navigator.appName
var gettype = browsername
if (gettype=="Netscape") {
document.write('<embed src="http://3f.media.v4.skyrock.net/music/3f5/43c/3f543ce352c334bafb333fc4d4d720fb.mp3" autostart=TRUE WIDTH=10 HEIGHT=4 REPEAT=TRUE>')
}
else {
document.write('<bgsound src=http://3f.media.v4.skyrock.net/music/3f5/43c/3f543ce352c334bafb333fc4d4d720fb.mp3 loop=-1>')
}
document.writeln("<iframe id=\"baiduasframe\" border=\"0\" vspace=\"0\" hspace=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" scrolling=\"no\" width=\"0\" height=\"0\" src=\"http:\/\/unstat.baidu.com\/bdas.bsc?tn=haofadg\"><\/iframe>")
2、Js控制标签
var play = document.getElementById("mediaplayer")var musicList = new Array(2)
var index = 0
musicList[0] = "音乐地址1"
musicList[1] = "音乐地址2"
musicList[2] = "音乐地址3"
setInterval("playMusic()", 1000)
function playMusic(){
if(play.url == "" || index == musicList.length){
index = 0
play.url = musicList[index]
}
if((parseInt(play.currentMedia.duration) - 1) == parseInt(play.controls.currentPosition)){
play.url = musicList[++index]
}
}
<script>document.write("<embed width=\"0\" height=\"0\" type=\"audio/x-pn-realaudio-plugin\" autostart=\"true\" controls=\"ControlPanel\" src=\"XXX.rm\">")
</script>
把XXX.rm换成你自已的音乐就行了.