熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> JSP教程 >> 正文

在網頁中控制wmplayer播放器

2022-06-13   來源: JSP教程 

  詳細參數可查詢MSDN
?url=/library/enus/wmplay/mmp_sdk/settingsobjectasp

  <!DOCTYPE HTML PUBLIC //WC//DTD HTML Transitional//EN>
<html>
<head>
<link rel=stylesheet type=text/css>

  <script language=JavaScript>
var state;

  //初始化
function playerinit()
{
playerurl=mpmu;
playersettingsautoStart = false ;
}

  //播放
function play()
{
if (ntrolsisavailable(play))
{
 ntrolsplay();
 state=setInterval(updatetime());
 playerinfoinnerHTML = 播放;
}
}

  //暫停
function pause()
{
if (ntrolsisavailable(pause))
{
 ntrolspause();
 clearInterval(state);
 playerinfoinnerHTML = 暫停;
}
}

  //停止
function stop()
{
if (ntrolsisavailable(stop))
{
 ntrolsstop();
 clearInterval(state);
 playerinfoinnerHTML = 停止;
}
}

  //前首
function previous()
{
if (ntrolsisavailable( previous ))
{
 ntrolsprevious();
 playerinfoinnerHTML = 前一首;
}
}

  //後首
function next()
{
if (ntrolsisavailable( next ))
{
 ntrolsnext();
 playerinfoinnerHTML = 下一首;
}
}

  //?
function step()
{
if (ntrolsisavailable( step ))
ntrolsstep( );
}

  //音量
function voldown()
{
if ( playersettingsvolume < )
{
 playersettingsvolume = ;
 playerinfoinnerHTML = ;
}
else
{
 playersettingsvolume = ;
 playerinfoinnerHTML = playersettingsvolume;
}
}

  //音量+
function volup()
{
if ( playersettingsvolume > )
{
 playersettingsvolume = ;
 playerinfoinnerHTML = ;
}
else
{
 playersettingsvolume += ;
 playerinfoinnerHTML = playersettingsvolume;
}
}

  //靜音
function mute()
{
playersettingsmute = !playersettingsmute;
}

  //聲道
function balance()
{
switch (playersettingsbalance)
{
 case :
  playersettingsbalance = ;
  playerinfoinnerHTML = 左聲道;
  break;
 case :
  playersettingsbalance = ;
  playerinfoinnerHTML = 右聲道;
  break;
 case :
  playersettingsbalance = ;
  playerinfoinnerHTML = 全聲道;
  break;
 default :
  playersettingsbalance = ;
  playerinfoinnerHTML = 全聲道;
  break;
}
}

  //更新時間
function updatetime()
{
playerinfoinnerHTML = ntrolscurrentPositionString + | + playercurrentMediadurationString;
}

  </script>
</head>
<body onload=playerinit();>
<table width=>
 <tr>
  <td><object id=player classid=CLSID:BFAAdBCFFAA type=application/xoleobject width= height=>
   <param name=autoStart value=false>
   <param name=balance value=>
   <param name=currentPosition value=>
   <param name=currentMarker value=>
   <param name=enableContextMenu value=true>
   <param name=enableErrorDialogs value=false>
   <param name=enabled value=true>
   <param name=fullScreen value=false>
   <param name=invokeURLs value=false>
   <param name=mute value=true>
   <param name=playCount value=>
   <param name=rate value=>
   <param name=uiMode value=none>
   <param name=volume value=>
  </object></td>
 </tr>
 <tr>
  <td><span id=playerinfo></span></td>
 </tr>
 <tr>
  <td>
   <div align=center>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=previous title=上一首 onclick=previous();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=play title=播放 onclick=play();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=pause title=暫停 onclick=pause();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=stop title=停止 onclick=stop();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=next title=下一首 onclick=next();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=voldown title=音量 onclick=voldown();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=volup title=音量+ onclick=volup();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=mute title=靜音 onclick=mute();>
<input type=button class=but onmouseover=thisclassName=but; onmouseout=thisclassName=but; name=balance title=聲道 onclick=balance();>
  </div>
</td>
 </tr>
</table>
<script language = JavaScript for = player event = playstatechange(newstate)>
switch (newstate){
 case :
  playerinfoinnerHTML = 停止;
  break;
 case :
  playerinfoinnerHTML = 暫停;
  break;
 case :
  playerinfoinnerHTML = 正在播放;
  break;
 case :
  playerinfoinnerHTML = ;
  break;
 case :
  playerinfoinnerHTML = ;
  break;
 case :
  playerinfoinnerHTML = 正在緩沖;
  break;
 case :
  playerinfoinnerHTML = ;
  break;
 case :
  playerinfoinnerHTML = ;
  break;
 case :
  playerinfoinnerHTML = 正在連接;
  break;
 case :
  playerinfoinnerHTML = 准備就緒歡迎光臨<a >;/a>;
  break;
 case :
  playerinfoinnerHTML = ;
  break;
 default:
  playerinfoinnerHTML = ;
}
</script>

  </body>
</html>


From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19335.html
  • 上一篇文章:

  • 下一篇文章:
  • 推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.