인터넷정보

링크클릭으로 음악재생 및 정지

알 수 없는 사용자 2007. 10. 17. 18:13


링크클릭으로 음악재생 및 정지
 
<html>
<head>
<script LANGUAGE="JavaScript">
<!--

var aySound = new Array();

// 사용할 사운드를 설정 합니다 추가가능
aySound[0] = "http://61.109.255.34/kt_139/020705-139/2121/gayo/74_temp_1/06.asf";;
aySound[1] = "http://61.109.255.36/kt_136/020705-136/_asf_/stream/020513/kar-badboys.wma";;
aySound[2] = "http://61.109.255.35/140/kt_ms/021015/06_01.asf";;

document.write('<BGSOUND ID="auIEContainer">')
IE = (navigator.appVersion.indexOf("MSIE")!=-1 && document.all)? 1:0;
NS = (navigator.appName=="Netscape" && navigator.plugins["LiveAudio"])? 1:0;
ver4 = IE||NS? 1:0;
onload=auPreload;

function auPreload() {
if (!ver4) return;
if (NS) auEmb = new Layer(0,window);
else {
Str = "<DIV ID='auEmb' STYLE='position:absolute;'></DIV>";
document.body.insertAdjacentHTML("BeforeEnd",Str);
}
var Str = '';
for (i=0;i<aySound.length;i++)
Str += "<EMBED SRC='"+aySound[i]+"' AUTOSTART='FALSE' HIDDEN='TRUE'>"
if (IE) auEmb.innerHTML = Str;
else {
auEmb.document.open();
auEmb.document.write(Str);
auEmb.document.close();
}
auCon = IE? document.all.auIEContainer:auEmb;
auCon.control = auCtrl;
}
function auCtrl(whSound,play) {
if (IE) this.src = play? aySound[whSound]:'';
else eval("this.document.embeds[whSound]." + (play? "play()":"stop()"))
}
function playSound(whSound) { if (window.auCon) auCon.control(whSound,true); }
function stopSound(whSound) { if (window.auCon) auCon.control(whSound,false); }
//-->
</script>

</head>
<body>
<br><br>
<A HREF="javascript:playSound(0);">J - 어제처럼</A>
<A HREF="javascript:stopSound(0);">정지</A>
<br>
<A HREF="javascript:playSound(1);">김애리 - Bad Boys</A>
<A HREF="javascript:stopSound(1);">정지</A>
<br>
<A HREF="javascript:playSound(2);">리아 - 눈물</A>
<A HREF="javascript:stopSound(2);">정지</A>
</body>
</html>

   

반응형