처음 블로그 시작할 때 bgm을 깔고 싶어서 찾아냈던..
하얀현자님(http://snowsage.tistory.com) 블로그에서 설명을 가져온 것인데,
다시 들어가보니 10년이후로 글을 안쓰셨네..
블로그에서 페이지 이동에 상관없이 bgm을 깔아주는 기능..
뭔가 많은 함수들이 있으나, 변경할 건 몇개 안되니.. 자세히 한번만 읽어보면.. 누구나 적용 가능 할 듯..
올리기 전에 파일 2개를 메모장으로 열어서 자신에 맞게 수정해 줌.
1. playerControl.html 에서는,
window.onload = function(){
//top.bgm.ssp_randomToggle(); // 기본적으로 랜덤 재생
if(top.changeTitle) top.changeTitle("수많은 사람들의 상상력, Tistory.com");
}
여기에서, "수많은 사람들의 상상력, Tistory.com" 부분을 수정하셔야합니다.
이 내용은 여러분의 블로그에 접속했을때, 브라우저 상단 제목표시줄에 나타나는 내용입니다^^
처음부터 Shuffle 모드로 플레이어를 돌리고 싶으실때, 앞의 "//" 두글자를 삭제해주시면 됩니다.
2. list.js 에서는, 실제로 여러분들의 노래가 들어가게 됩니다.
addsong("음악파일주소", "음악파일제목"); 과 같은 형식으로 입력해 주시면 됩니다.
addSong("http://neotv81.tistory.com/attachment/ik240000000004.mp3","2AM_이노래_원본개사합체");
이런식은데용.
비공개로 글쓰시고용. 첩부파일로 해서 업로드한 mp3파일 주소 이용하면 됩니다.
--------------------------------------------------------------------------------------
<script language="javascript" type="text/javascript">
///////////////////////// Snowsage Player Control Script 시작! /////////////////////
// Snowsage Player Ver 1.16 (2006.12.14)
// Made By 하얀현자 (http://snowsage.tistory.com)
///////////////////////////////////////////////////////////////////////
// 만일, 자신의 블로그로 접속되지 않을 경우, http://자기주소/owner/entry 로 접속,
// 스킨 편집으로 와서 isUsed 값을 0 으로 변경하고, 자기 블로그로 접속 된다면
// http://snowsage.tistory.com 에 해당 사항을 알려주시기 바랍니다.
//////////////////////////////////////////////////////////////////////
var isUsed = 1; // SnowsagePlayer 적용여부 (적용: 1 / 미적용: 0)
var isCenter = 0; // 스킨이 가운데 정렬이면 1 아니면 0
var test = 1; // 플레이어 위치 조정시에만 1, 평상시엔 0
var leftPixel = 411; // Controller 왼쪽(가운데)으로부터 떨어진 pixel
var topPixel = 163; // Controller 상단으로부터 떨어진 pixel
//////////////////////////////////////////////////////////////////////
var widthPixel = 240; // Controller 가로 크기 (필요시에만 변경)
var heightPixel = 132; // Controller 세로 크기 (필요시에만 변경)
//////////////////////////////////////////////////////////////////////
function bgmFrameLoad(){
if(top.window.location.href.indexOf("frame.html") == -1){
var frameURL = "./images/frame.html";
top.window.location.href = frameURL + "?" + window.location.href;
}
else if(top.window.location.href.indexOf("./images") == -1)
top.bgm.location.href = "./images/player.html";
}
var isToolBarResized = 0;
function toolBarWidthResize(){
var tistoryTB = document.getElementById("tistorytoolbarid");
if(tistoryTB != null && !isToolBarResized) {
isToolBarResized = 1;
tistoryTB.style.pixelWidth -= 18;
clearInterval(toolBarResizeInterval);
}
return true;
}
if(isCenter) leftPixel += document.documentElement.offsetWidth/2;
iframeCode = "<iframe src=\"./images/playerControl.html\" name=\"sspcontrol\" style=\"position: absolute; left: " + leftPixel + "px; top: "+ topPixel +"px; width: "+ widthPixel +"px; height: "+ heightPixel +"px; z-index: 100\" scrolling=\"no\" allowTransparency frameborder=\"0\"></iframe>";
if(isUsed) document.writeln(iframeCode);
if(top.bgm == null && window.location.href.indexOf("preview") > 0) isUsed = 0;
if(top.bgm == null && isUsed) bgmFrameLoad();
toolBarResizeInterval = setInterval(toolBarWidthResize, 100);
setTimeout("clearInterval(toolBarResizeInterval)", 5000);
window.onresize = toolBarWidthResize;
document.onmousedown = function(){
if(test && event.button == 2 && isCenter) alert("leftPixel: " + (event.x - document.documentElement.offsetWidth/2) + "\ntopPixel: " + (event.y - 93));
else if(test && event.button == 2 && !isCenter) alert("leftPixel: " + event.x + "\ntopPixel: " + (event.y - 93));
}
document.body.onkeydown = function(){
if(event.keyCode == 113) document.location.href = "/owner/skin?layout=up";
return true;
}
///////////////////////// Snowsage Player Control Script 끝! /////////////////////
</script>
--------------------------------------------------------------------------------------