⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 player_class.js

📁 学校网站管理系统
💻 JS
字号:
function m_r_sj(zsj)	
{
  var min, sec, str;
  min = Math.floor(zsj/60);
  sec = Math.floor(zsj%60);
  if (isNaN(min))
    return "0:00";
  str = min.toString()+":";
  if (sec>9)
    str += sec.toString()
  else
    str += "0"+sec.toString()
  return str;
}

function flash_sj(zsj)	
{
  return zsj+1;
}


////////////////////////////////////////////

function mediaClass()		
{
  
  this.obj = mediaPlayerObj;	
  this.gotov = 5;		
  this.setss = 0.5;		
 

  this.open = function(url)	
  {
    this.obj.URL = url;
    try {
      this.play();
    } catch(hh){}
  }
  this.txtzm = function(url)	
  {
    mtxtboxtr.style.display = "block";
    this.obj.closedCaption.SAMIFileName = url;
  }
  
  this.play = function()	
  {
    this.obj.controls.play();
  }
  this.pause = function()	
  {
    this.obj.controls.pause();
  }
  this.stop = function()	
  {
   try {
    this.obj.controls.stop();
    this.obj.controls.currentPosition = 0;
   } catch(hh){}
  }
  this.go = function(s)		
  {
    this.obj.controls.currentPosition = s;
  }
  this.pos = function()		
  {
    return this.obj.controls.currentPosition;
  }
  this.length = function()		
  {
    return this.obj.currentMedia.duration;
  }
  this.state = function()		
  {
    var ps = this.obj.PlayState;
    return ps!=0 && ps!=1 && ps!=8;
  }
  this.statedp = function()		
  {
  }
  this.volume = function(s)		
  {
    try { realPlayerObj.SetVolume(100);  } catch(hh){}
    this.obj.settings.volume = s;
  }
  this.mute = function(s)		
  {
    try { realPlayerObj.SetMute(s);  } catch(hh){}
    this.obj.settings.mute = s;
  }
  this.fullscreen = function()		
  {
    if(this.obj.PlayState!=3)
      return 2;
    try {
      this.obj.fullscreen=1;
    } catch(hh){}
    return 1;
  }

  this.sjxs = m_r_sj;	

  this.closed = function()	
  {
    this.obj.closedCaption.SAMIFileName = "";
    this.stop();
  }

  this.ifending = function()	
  {
  }
}


///////////////////////////////////////////////////////////////////////////////////////////////


function realClass()		
{

  this.obj = realPlayerObj;	
  this.gotov = 5;		
  this.setss = 1;		
 

  this.open = function(url)	
  {
    this.obj.setSource(url);
    setTimeout("oop.play();",1000);
  }
  this.txtzm = function(url)	
  {
  }

  this.play = function()	
  {
    if(this.obj.CanPlay())
      this.obj.DoPlay();
  }
  this.pause = function()	
  {
    this.obj.DoPause();
  }
  this.stop = function()	
  {
    if(this.obj.CanStop())
    {
      this.obj.DoStop();
      this.obj.SetPosition(0);
    }
  }
  this.go = function(s)		
  {
    this.obj.SetPosition(s*1000);
  }
  this.pos = function()		
  {
    return this.obj.GetPosition()/1000;
  }
  this.length = function()		
  {
    return this.obj.GetLength()/1000;
  }
  this.state = function()		
  {
    var ps = this.obj.GetPlayState();
    return ps!=0 && ps!=4;
  }
  this.statedp = function()		
  {
  }
  this.volume = function(s)		
  {
     this.obj.SetVolume(s)
  }
  this.mute = function(s)		
  {
     this.obj.SetMute(s)
  }
  this.fullscreen = function()		
  {
    if(this.obj.GetPlayState()!=3)
      return 2;
    try {
      this.obj.SetFullScreen();
    } catch(hh){}
    
    return 1;
  }

  this.sjxs = m_r_sj;	

  this.closed = function()	
  {
    this.stop();
  }

  this.ifending = function()	
  {
    if(this.length()<=1) return;
    if(this.length()-this.pos()<=this.setss) 
      gonext();
  }
}





/////////////////////////////////////////////////////////////////////////////////////////////////

function flashClass()		
{

  this.obj;			
  this.gotov = 70;		
  this.Rstate = Word.flaos.split(",");
  this.setss = 20;		
  

  this.open = function(url)	
  {
    var nin = '\n';
    var temp = '';
temp+='<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" ID="flashPlayerObj" width="100%" height="100%">'+nin;
temp+=' <PARAM NAME="Play" VALUE="-1">'+nin;
temp+=' <PARAM NAME="Loop" VALUE="0">'+nin;
temp+=' <PARAM NAME="Movie" VALUE="'+url+'">'+nin;
temp+=' <PARAM NAME="Src" VALUE="'+url+'">'+nin;
temp+=' <PARAM NAME="WMode" VALUE="Opaque">'+nin;
temp+=' <PARAM NAME="Quality" VALUE="AutoHigh">'+nin;
temp+=' <PARAM NAME="Menu" VALUE="0">'+nin;
temp+=' <PARAM NAME="Scale" VALUE="ShowAll">'+nin;
temp+=' <PARAM NAME="DeviceFont" VALUE="0">'+nin;
temp+=' <PARAM NAME="EmbedMovie" VALUE="0">'+nin;
temp+='</OBJECT>';
     sspx.style.display = "block";	
     flashPlayerBox.innerHTML = temp;
     this.obj = flashPlayerObj;

     window.focus();	
     if(spzt==0)	
       sspx.style.display = "none";	

  }
  this.txtzm = function(url)	
  {
  }

  this.play = function()	
  {
    this.obj.Play();
  }
  this.pause = function()	
  {
    loopx=2; lomd();
    this.obj.Stop();
  }
  this.stop = function()	
  {
    loopx=2; lomd();
    this.obj.Rewind();
  }
  this.go = function(s)		
  {
    if(this.obj.PercentLoaded()<100) return;
    var oi = this.obj.IsPlaying();
    this.obj.GotoFrame(s);
    if(oi) this.obj.Play();
  }
  this.pos = function()		
  {
    return this.obj.currentframe();
  }
  this.length = function()		
  {
    return this.obj.TotalFrames-1;
  }
  this.state = function()		
  {
    var ps = this.obj.IsPlaying();
    return ps;
  }
  this.statedp = function()		
  {
    var s=(this.obj.PercentLoaded()==100)?this.Rstate[this.obj.IsPlaying()?1:0]:Word.flaozr+this.obj.PercentLoaded()+"%"
    if(rtxt1.innerText!=s)
      rtxt1.innerText = s;
  }
  this.volume = function(s)		
  {
    try {   realPlayerObj.SetVolume(s);  } catch(hh){}
  }
  this.mute = function(s)		
  {
    try { realPlayerObj.SetMute(s);  } catch(hh){}
  }
  this.fullscreen = function()		
  {
    return 0;
  }

  this.sjxs = flash_sj;	

  this.closed = function()	
  {
    flashPlayerBox.innerHTML = "";
  }

  this.ifending = function()	
  {
    if(this.length()<=100) return;
    if(this.length()-this.pos()<=this.setss) 
    {
      gonext();
      return;
    }
    if(!this.state() && loopx!=0)
      this.play();
  }
}


/////////////////////////////////////////////////////////////////////////////////////////////////

function imgClass()		
{

  this.obj = imgframe.imgPlayerObj;			
  this.Rstate = Word.imgszt.split(",");
  this.gotov = 0;		
  this.setss = 0;		


  this.open = function(url)	
  {
    this.obj.src = url;
    rtxt1.innerText = this.Rstate[0];
    imgframe.reimg();

  }
  this.txtzm = function(url)	
  {
  }

  this.play = function()	
  {
    var z = this.obj.src;
    this.obj.removeAttribute("src");
    this.obj.src = z;
  }
  this.pause = function()	
  {
  }
  this.stop = function()	
  {
  }
  this.go = function(s)		
  {
  }
  this.pos = function()		
  {
    return 0;
  }
  this.length = function()		
  {
    return 0;
  }
  this.state = function()		
  {
    return true;
  }
  this.statedp = function()		
  {
  }
  this.volume = function(s)		
  {
  }
  this.mute = function(s)	
  {
  }
  this.fullscreen = function()		
  {
    return 0;
  }

  this.closed = function()	
  {
    this.obj.onload = null;
    this.obj.removeAttribute("src");
  }
  this.ifending = function()	
  {
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -