쥬크박스
컨텐츠 정보
- 20,236 조회
- 5 추천
- 목록
본문
http://nbloger.com/blog/skin/default/jukebox.asp?now_blog=iendev
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euc-kr">
<meta http-equiv="Cache-Control" content="no-cache, must-revalidate, no-store">
<meta http-equiv="Pragma" content="no-cache">
<style>
body, td, input,marquee { font-size:8pt;font-family:돋움,tahoma; color:#666666;}
a:link { color:#666666; text-decoration:none; }
a:visited { color:#666666; text-decoration:none; }
a:hover { color:#666666; text-decoration:underline; }
</style>
<div id="juke_list_div" style='position:absolute;visibility:hidden;left:4;top:63;width=150px;height=30px;z-index:-1'>
<select name="juke_list" onchange="selector(this.value);" style="font-family:돋움; font-size:8pt;"></select>
</div>
<script>
function post_view(blogid,b_idx)
{
var view_location = '../../xbb_main.asp?blogid='+blogid+'&action=view&b_idx='+b_idx;
parent.blog_main.location= view_location;
}
</script>
<script language="JavaScript">
play_flag = 1;
canvas=new Array();
canvas_counter=0;
function play_by_bidx(bidx)
{
for (i=1; i<=canvas.length/3; i++) {
if (canvas[i*3-1]==bidx) selector(i);
}
}
function playlist() {
if (juke_list_div.style.visibility == "hidden")
{
juke_list_div.style.visibility ="visible" ;
juke_watch_div.style.visibility ="hidden" ;
list_button.src = "images/sound_list2.gif";
}
else
{
juke_list_div.style.visibility ="hidden" ;
juke_watch_div.style.visibility ="visible" ;
list_button.src = "images/sound_list.gif";
}
}
function ini() {
kanzaki=setInterval("display()", 200);
total=eval(canvas.length)/3;
if (startat==0 || startat>total) track=Math.ceil(Math.random()*total);
else {track=startat;}
mode(); setting();
}
function setting() {
track_data();
Ayame.open(file);
if (!playstatus) Ayame.stop();
}
function mode() {
switch(mode.arguments[0]) {
case "shuffle": shuffle=(shuffle == 0)?1:0;break;
case "repeat": repeat=(repeat == 0)?1:0; break;
case "timer": if (playstatus) {timer=(timer == 3)?1:timer+1;} break;
default:
}
if (shuffle) shuffle_button.src="images/sound_random2.gif";
else shuffle_button.src="images/sound_random.gif";
if (repeat) repeat_button.src="images/sound_repeat2.gif";
else repeat_button.src="images/sound_repeat.gif";
}
function play() {
if (typeof(kikyou)=="number") clearTimeout(kikyou);
Ayame.open(file); playstatus = 1;
}
function stop() {
if(typeof(kikyou)=="number") clearTimeout(kikyou);
playstatus = 0; Ayame.stop();
}
function selector(akane) {
if(typeof(kikyou)=="number") clearTimeout(kikyou);
if (!(selector.arguments[1]*repeat)) {
if (akane == "next" || akane == "prev") {track=nexttrack(akane);}
else if (akane > total || akane <= 0) {track=Math.ceil(Math.random()*total);}
else {track=akane;}
if (akane != "next" && akane != "prev") {playstatus=1;}
}
setting();
}
function nexttrack() {
if (total==1) return 1;
else {
if (!shuffle) {
switch(nexttrack.arguments[0]) {
case "next": kirishima=(track==total)?1:track+1; break;
case "prev": kirishima=(track==1)?total:track-1; break;
default:
}
}
else kirishima=Math.ceil(Math.random()*total);
if (kirishima == track) nexttrack();
return kirishima;
}
}
function track_data() {
number=(track<10)?"0"+track:track;
file = canvas[(track*3)-3];
name = canvas[(track*3)-2];
singer = canvas[(track*3)-1];
if (singer == "" || singer == null) singer = unknown_singer;
imascroller("<span style='cursor:hand' onclick=\\"javascript:post_view('iendev',"+singer+");\\">"+name+"</span>");
}
function timer_data() {
ayane = Ayame.Duration
kasumi = Ayame.currentPosition
switch(timer) {
case 1: min = Math.floor(ayane/60); sec = (ayane%60<10)? "0"+Math.floor((ayane)%60) : Math.floor((ayane)%60); break;
case 2: min = "- "+Math.floor((ayane-kasumi)/60); sec = ((ayane-kasumi)%60<10)? "0"+Math.floor((ayane-kasumi)%60) : Math.floor((ayane-kasumi)%60); break;
case 3: min = "+ "+Math.floor(kasumi/60); sec = (kasumi%60<10)? "0"+Math.floor(kasumi%60) : Math.floor(kasumi%60); break;
default:
}
}
function display() {
if (playstatus) {timer_data();watch.value=min+":"+sec;}
else watch.value="재생중이지 않습니다.";
if (watch.value == "" || watch.value == "+ -1:0-1" || watch.value == "0:00" || watch.value == "- 0:01") watch.value="파일 연결중입니다.";
}
function kana(bResult) {
if (kana.arguments[0] == 0) {
if(Ayame.PlayCount==1) kikyou = setTimeout("selector('next', 1);", blank*1000);
}
}
playstatus = 0; // 초기재생여부 (1=재생, 0=정지)
shuffle = 1; // 초기 랜덤모드 여부 (1=랜덤, 0=시퀀스)
repeat = 0; // 초기 리피트모드 여부 (1=리피트)
blank = 2; // 곡 사이의 시간 (단위=초)
timer = 3; // 초기 타이머 모드 (1=총시간, 2=남은시간, 3=재생시간)
startat = 0; // 처음 시작할 트랙 (0=랜덤, #=트랙번호)
listclose = 1; // 리스트창에서 곡을 선택할때 리스트창 자동으로 닫기 (1=닫음, 0=닫지않음)
unknown_singer = "UNKNOWN"; // 가수이름을 적지 않았을때 표시될 내용.
// 파일이름, 곡제목, 가수이름의 세가지가 순서대로 들어가야 합니다.
// 형식 list("파일의 URL","곡제목","글번호");
list_array = new Array();
list("http://iendev.com/sound/always.mp3","[Studio EIM] 언제나 그대를 (2001) 노래: 양정화","648");
juke_list.options[0]=new Option("[Studio EIM] 언제..",1)
function list() {
for (heroin=0; heroin<list.arguments.length; heroin++) {
canvas[canvas_counter] = list.arguments[heroin]; canvas_counter++;
}
}
function imascroller(string) {
info.innerHTML = string;
}
</script>
<script for="Ayame" event="EndOfStream(bResult)" language="JavaScript">
kana(bResult);
</script>
</head>
<body onLoad="ini();" topmargin=0 leftmargin=0 marginwidth=0 marginheight=0 bgcolor="#f7f7f7" oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
<br>
<table border=0 cellpadding=0 cellspacing=0 id="AutoNumber1" border=0 width=93% align=center >
<tr>
<td align=top >
<img src="images/sound_random.gif" onfocus="this.blur()" onClick="mode('shuffle')" border=0 name=shuffle_button style="cursor:hand" title="무작위재생">
<img src="images/sound_repeat.gif" border=0 name=repeat_button onfocus="this.blur()" onClick="mode('repeat')" style="cursor:hand" title="반복재생"></a>
<img src="images/sound_list.gif" border=0 name=list_button onfocus="this.blur()" onClick="playlist()" style="cursor:hand" title="음악목록"></a>
<img src="images/sound_prev.gif" style="cursor:hand" onfocus="this.blur()" title="이전곡" onClick="selector('prev')"> <img src="images/sound_play.gif" style="cursor:hand" onfocus="this.blur()" title="재생" onClick="play()" > <img src="images/sound_stop.gif" style="cursor:hand" onfocus="this.blur()" title="정지" onClick="stop()"> <img src="images/sound_next.gif" style="cursor:hand" border=0 onfocus="this.blur()" title="다음곡" onClick="selector('next')">
</td>
</tr>
<tr>
<td align=left height=35>
<marquee id=info direction="right" width="150" height="15" scrollamount="1" loop="0"></marquee>
</td>
</tr>
<tr>
<td id="juke_stat">
</td>
</tr>
</table>
<embed type='application/x-mplayer2' id="Ayame" autostart=1 Volume=0 style="display:none" width="128" height="128" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" ></embed>
<div id="juke_watch_div" style='position:absolute;;left:4;top:63;width=150px;height=30px;z-index:-1'>
<input type=text onfocus="this.blur()" name=watch size="17" onClick="mode('timer')" style="background-color:#f7f7f7;border:1px; color=#999999" onmouseover="this.style.color='#000000';this.style.cursor='hand'" onMouseOut="this.style.color='#999999'">
</div>
</body>
</html>
관련자료
-
링크
댓글 0
등록된 댓글이 없습니다.