";
function setPlayFile() {
try {
wmplayer.FileName = currentplayfile;
play();
initPro();
} catch( e ) {}
}
var mLen = 153; //进度条(背景图)长度,默认值100
var timeObj = null; //计时器对象
var mediaLen = 0; //素材长度
var canSeek = true;
// <逻辑变量> //
var isAfterPause = false;
var isPlaying = false;
var isItself = false;
var moveOver = false;
// 逻辑变量> //
function setProsLength( splen ) {
mLen = splen;
}
document.onmouseup = moveok;
function moveok() {
try {
if( isPlaying && moveOver && canSeek ) {
moveOver = false;
wmplayer.play();
setPosition( Math.floor( event.x * mediaLen / mLen ) );
}
} catch( e ) {}
return false;
}
document.ondragstart = doDragStart;
function doDragStart() {
event.returnValue = false;
}
//清除计时器对象
function clrTime() {
if( timeObj != null ) {
clearTimeout( timeObj );
timeObj = null;
}
}
//创建新的计时器
function openTime() {
clrTime();
timeObj = setTimeout( "showPros()", 500 );
}
function initPro() {
try {
isPlaying = true;
//alert(wmplayer.isAvailable("fastForward"));
openTime();
} catch( e ) {}
return false;
}
function setMbPos( pos ) {
try {
mblock.style.left = pos;
} catch( e ) {}
return false;
}
function setPosition( pos ) {
try {
wmplayer.currentPosition = pos;
} catch( e ) {}
return false;
}
function play() {
try {
if( !isItself ) {
if( !isAfterPause ) {
setPosition( 0 );
}
playorpause.innerHTML = pausebtnstr;
isAfterPause = false;
isPlaying = true;
isItself = true;
wmplayer.play();
openTime();
} else {
playorpause.innerHTML = pausebtnstr;
}
} catch( e ) {}
return false;
}
function pause() {
try {
if( isPlaying && wmplayer.PlayState != 3 ) {
isAfterPause = true;
isPlaying = false;
isItself = false;
playorpause.innerHTML = playbtnstr;
wmplayer.pause();
clrTime();
}
} catch( e ) {}
return false;
}
function stop() {
try {
if( isPlaying || isAfterPause ) {
isAfterPause = false;
isItself = false;
isPlaying = false;
setMbPos( 0 );
setPosition( 0 );
wmplayer.stop();
clrTime();
playorpause.innerHTML = playbtnstr;
}
} catch( e ) {}
return false;
}
function movego() {
try {
if( isPlaying && moveOver && canSeek ) {
if( event.x < mLen && event.x > -1 ) {
setMbPos( event.x );
}
}
} catch( e ) {}
return false;
}
function reachTo() {
try {
if( isPlaying && canSeek ) {
moveOver = true;
wmplayer.pause();
if( event.x < mLen && event.x > -1 ) {
setMbPos( event.x );
}
}
} catch( e ) {}
return false;
}
function moves() {
try {
if( isPlaying && canSeek ) {
moveOver = true;
wmplayer.pause();
}
} catch( e ) {}
return false;
}
function showPros() {
try {
if( isPlaying ) {
if( wmplayer.PlayState == 0 ) {
isAfterPause = false;
isItself = false;
isPlaying = false;
setMbPos( 0 );
setPosition( 0 );
clrTime();
playorpause.innerHTML = playbtnstr;
} else {
var curpos = wmplayer.currentPosition;
mediaLen = wmplayer.duration;
if( mediaLen == 0 ) {
setMbPos( 0 );
} else {
setMbPos( Math.round( ( curpos / mediaLen ) * mLen ) );
}
openTime();
}
}
} catch( e ) {}
return false;
}
function showFullscreen() {
try {
wmplayer.DisplaySize = 3;
} catch( e ) {}
return false;
}
function MoveTextDiv(obj,action){//上下移动层
function UpMove(){
if(TextScroll.offsetTop<0){
TextScroll.style.pixelTop+=1;
}
}
function DownMove(){
if(TextScroll.offsetTop>(TextScrollBox.offsetHeight-TextScroll.offsetHeight)){
TextScroll.style.pixelTop-=1;
}
}
scro=setInterval(action=="up"?UpMove:DownMove,10);
function obj.onmouseout(){
clearInterval(scro);
}
}
//-->