<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=euckr" />
<title></title>
<style type="text/css">
body, div, object, embed{margin:0px; padding:0px;}
</style>
<script type="text/javascript">
<!--
/**
* 기본생성자
* @param obj:Player 객체
*/
function WindowMediaPlayer(obj,url,autostart, showcontrols, uiMode)
{
this.player = obj;
this.player.url = url;
this.player.settings.autoStart = autostart;
this.player.showcontrols = showcontrols;
this.player.uiMode = uiMode;
this.player.settings.rate = 1;
if (autostart) player_play();
}
/**
* 미디어를 재생한다.
* @param mldom:mldom 객체
* @param autostart:자동 시작 여부
*/
function player_play()
{
if (this.player.url == '') return;
this.player.controls.play();
timer_id = setTimeout(start_prograss, 500);
}
/**
* 미디어를 정지한다.
*/
function player_stop()
{
if (this.player.url == '') return;
this.player.controls.stop();
}
/**
* 미디어를 일시정지한다.
*/
function player_pause()
{
if (this.player.url == '') return;
this.player.controls.pause();
}
/**
* 미디어를 빨리감기한다.
*/
function player_fastForward()
{
this.player.controls.fastForward();
}
/**
* 미디어를 되감기한다.
*/
function player_fastReverse()
{
this.player.controls.fastReverse();
}
/**
* 미디어의 재생 속도를 조정한다.
* @param no:재생 속도
*/
function player_setRate(no)
{
this.player.settings.rate = no;
this.player.controls.play();
}
/**
* 미디어의 소리를 증가한다.
* @param no:재생 속도
*/
function player_addVolume(no)
{
this.player.settings.volume += no;
}
/**
* 미디어의 소리를 조정한다.
* @param no:소리크기(0~100)
*/
function player_setVolume(no)
{
this.player.settings.volume = no;
}
/**
* 미디어의 소리를 없앤다.
* @param v:음소거 여부(boolean)
*/
function player_mute(v)
{
this.player.settings.mute = v;
}
/**
* 미디어의 크기를 조정한다.
* @param no:미디어 크기(0~4). 0:정상,1:절반,2:두배,3:전체화면
*/
function player_resize(no)
{
if (this.player.url == '') return;
var width = this.player.currentMedia.imageSourceWidth;
var height = this.player.currentMedia.imageSourceHeight;
var width_ctrl = 5;
var height_ctrl = 75;
if (this.player.uiMode == 'invisible') {
width_ctrl = 0;
height_ctrl = 0;
}
else if (this.player.uiMode == 'none') {
width_ctrl = 0;
height_ctrl = 0;
}
else if (this.player.uiMode == 'mini') {
width_ctrl = 5;
height_ctrl = 75;
}
else if (this.player.uiMode == 'full') {
width_ctrl = 5;
height_ctrl = 75;
}
this.player.stretchToFit = 'true';
switch (no) {
case 0:
this.player.width = width + width_ctrl;
this.player.height = height + height_ctrl;
break;
case 1:
this.player.width = 0.5 * width + width_ctrl;
this.player.height = 0.5 * height + height_ctrl;
break;
case 2:
this.player.width = 2 * width + width_ctrl;
this.player.height = 2 * height + height_ctrl;
break;
case 3:
if (this.player.playState == 3) this.player.fullScreen = 'true';
break;
}
}
/**
* 미디어의 위치를 처음으로 옮긴다.
*/
function player_setPosStart()
{
this.player.controls.currentPosition = 0;
}
/**
* 미디어의 위치를 마지막으로 옮긴다.
*/
function player_setPosEnd()
{
if (this.player.url == '') return;
this.player.controls.currentPosition = this.player.currentMedia.duration;
}
/**
* 미디어의 위치를 옮긴다
* @param no:옮길 위치(단위 초)
*/
function player_setPos(no)
{
this.player.controls.currentPosition = no;
}
/**
* 미디어의 위치를 해당 프레임으로 옮긴다
* @param no:옮길 위치(단위 프레임)
*/
function player_setPosFrame(no)
{
if (this.player.url == '') return;
var fps = this.player.network.encodedFrameRate;
if (fps > 0)
this.player.controls.currentPosition = no / fps;
}
/**
* 미디어의 위치를 증가시킨다
* @param no:옮길 위치(단위 초)
*/
function player_addPos(no)
{
this.player.controls.currentPosition += no;
}
/**
* 미디어의 위치를 해당 프레임만큼 증가시킨다
* @param no:옮길 위치(단위 프레임)
*/
function player_addPosFrame(no)
{
if (this.player.url == '') return;
var fps = this.player.network.encodedFrameRate;
if (fps > 0)
this.player.controls.currentPosition += no / fps;
}
/**
* 초기화
*/
function init_me()
{
var url = "http://www.ywhc.go.kr/hongbo/2011yw_movie.wmv"; //http://www.whitecane.or.kr/movie/test.wmv http://www.ywhc.go.kr/hongbo/2011yw_movie.wmv
var autostart = true;
var showcontrols = true;
var uiMode = "none";
// 플래이어 세팅
WindowMediaPlayer(Player,url,autostart, showcontrols, uiMode);
}
//-->
/*****************************************************************************/
/* 추가 시킨것 ******************************************************************/
/*****************************************************************************/
var timer_id;
var prograss_width = 195;
var prograss_thumb_width = 15;
var rate;
var totaltime;
function start_prograss()
{
/*
0 연주 상태가 정의되지 않은 경우 (Undefined)
1 연주 정지 (Stopped)
2 연주 잠깐 정지 (Paused)
3 연주중 (Playing)
4 앞으로 검색 (ScanForward)
5 뒤로 검색 (ScanReverse)
6 버퍼링 (Buffering)
7 접속이 끝나고 서버가 데이타를 보내주기를 기다리는 상태 (Waiting)
8 연주 끝남 (MediaEnded)
9 다음 곡 준비 (Transitioning)
10 연주 시작 준비 (Ready)
11 재접속중 (Reconnecting)
*/
if (this.player.PlayState == 3)
{
totaltime = this.player.currentMedia.duration;
rate = totaltime / (prograss_width-10);
var currenttime = this.player.controls.currentPosition;
if (totaltime > currenttime)
{
document.getElementById("prograssbar").style.left = ((prograss_width-10) / totaltime * currenttime);
timer_id = setTimeout(start_prograss, 500);
}
else if (totaltime <= currenttime)
{
document.getElementById("prograssbar").style.left = prograss_width-10;
clearTimeout(timer_id);
}
else
{
clearTimeout(timer_id);
}
}
else if (this.player.PlaySate == 1)
{
document.getElementById("prograssbar").style.left = prograss_width-10;
clearTimeout(timer_id);
}
else
{
//alert(this.player.PlayState);
timer_id = setTimeout(start_prograss, 500);
}
document.getElementById("totalpos_id").innerHTML = this.player.currentMedia.duration;
document.getElementById("currentpos_id").innerHTML = this.player.controls.currentPosition;
document.getElementById("totalprograss_id").innerHTML = prograss_width;
document.getElementById("currentprograss_id").innerHTML = document.getElementById("prograssbar").style.left;
}
var x, y;
var isbuttondown = false;
function mousedown(e)
{
if (event.button == 1)
{
x = event.screenX;
y = event.screenY;
isbuttondown = true;
clearInterval(timer_id);
}
}
function mouseup(e)
{
if (isbuttondown == true)
{
isbuttondown = false;
player_setPos(document.getElementById("prograssbar").style.pixelLeft * rate);
timer_id = setTimeout(start_prograss, 500);
}
}
function mouseout(e)
{
isbuttondown = false;
}
function mousemove(e)
{
if (isbuttondown)
{
var distX = event.screenX - x;
var distY = event.screenY - y;
document.getElementById("prograssbar").style.pixelLeft += distX;
if (document.getElementById("prograssbar").style.pixelLeft < 0)
{
document.getElementById("prograssbar").style.pixelLeft = 0;
}
if (document.getElementById("prograssbar").style.pixelLeft >= prograss_width-prograss_thumb_width)
{
document.getElementById("prograssbar").style.pixelLeft = prograss_width-prograss_thumb_width;
}
x = event.screenX;
y = event.screenY;
return false;
}
document.getElementById("prograssbar").style.left = window.event.screenX-16;
}
document.getElementById("prograssbar").onmousedown = mousedown;
document.onmouseup = mouseup;
document.onmousemove = mousemove;
</script>
</head>
<body onLoad="init_me()">
<div style="position:absolute; z-index:-1"><a href="http://www.ywtour.com/kor/CMSView.php?pid=45" target="_parent"><img src="/img/movieplayer.jpg" alt="" border="0" /></a></div>
<div id="movie">
<object name="Player" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" width="227" height="130" onLoad="init_me()" style="margin:30px 0px 0px 6px;">
<param name="Autostart" value="false" />
<param name="displaymode" value="0" />
<param name="showcontrols" value="false" />
<param name="uiMode" value="none">
<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="showcaptioning" value="0" />
<param name="transparentatstart" value="0" />
<param name="AllowChangeDisplaySize" value="true" />
<param name="AudioStream" value="-1" />
<param name="CurrentPosition" value="-1" />
<param name="CurrentMarker" value="-1" />
<param name="Mute" value="false" />
<param name="Volume" value="100" />
<param name="CurrentPosition" value="10" />
</object>
<!-- Hixie method -->
<!--[if !IE]> <-->
<object type="video/x-ms-asf-plugin" data="http://www.ywhc.go.kr/hongbo/2011yw_movie.wmv" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715" width="227" height="130" id="ffmedia">
<p>지금 사용하고 계시는 브라우저는 이 동영상 재생을 지원하지 않습니다.</p>
<param name="Autostart" value="false" />
<param name="displaymode" value="0" />
<param name="showcontrols" value="false" />
<param name="uiMode" value="none" />
<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="showcaptioning" value="0" />
<param name="transparentatstart" value="0" />
<param name="AllowChangeDisplaySize" value="true" />
<param name="AudioStream" value="-1" />
<param name="CurrentPosition" value="-1" />
<param name="CurrentMarker" value="-1" />
<param name="Mute" value="false" />
<param name="Volume" value="100" />
<param name="CurrentPosition" value="10" />
</object>
<!--> <![endif]-->
</object>
<div id="movie_control">
<div style="float:left;margin:4px 0px 0px 7px;">
<a href="javascript:player_play();"><img src="/img/play_btn1.gif" border="0" alt="시작"></a>
<a href="javascript:player_stop();"><img src="/img/stop_btn1.gif" border="0" alt="정지"></a> </div>
<div style="position: relative; margin-left:40px;">
<div style="position:absolute;border-bottom: solid 1px #cccccc; width:195px; height:10px; margin-left:0px; margin-top:-5"></div>
<div id="prograssbar" style="position: absolute; width:5px; height:2px; top:9px; left:0px;" onMouseOver="this.style.cursor = 'pointer' "><img src="/img/bar.gif" alt=""></div>
</div>
</div>
</div>
</body>
</html>