利用Javascript实现对Media Player的控制功能

时间:2010-03-29 19:12:12  来源:第二电脑网  作者:第二电脑网

  第二电脑网导读:setInterval("if(phx.playState==3){itcn.style.width=parseInt(245*(phx.controls.currentPosition/phx.currentMedia.duration))}",1000);function volup(){if (volv<100){volv+=5;phx.settings.volume=volv;time.innerText=volv;}else{time.innerText='最大';}}function voldown(){if (...
  正文:<script language=JavaScript defer>
var volv=phx.settings.volume;
setInterval("if(phx.playState==3){time.innerText=phx.controls.currentPositionString+'|'+
phx.currentMedia.durationString}",1000);
setInterval("if(phx.playState==3){itcn.style.width=parseInt(245*(phx.controls.currentPosition/phx.currentMedia.duration))}",1000);
function volup(){
if (volv<100){
volv+=5;
phx.settings.volume=volv;
time.innerText=volv;}
else{time.innerText='最大';}
}
function voldown(){
if (volv>0){
volv-=5;
phx.settings.volume=volv;
time.innerText=volv;}
else{time.innerText='最小';}
}
</script>
<p> 
  <object classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6" id="phx" width="245" height="240">
    <param name="URL" value="声音文件的位置/shengyin.wmv">
    <param name="rate" value="1">
    <param name="balance" value="0">
    <param name="currentPosition" value="0">
    <param name="defaultFrame" value>
    <param name="playCount" value="1">
    <param name="autoStart" value="-1">
    <param name="currentMarker" value="0">
    <param name="invokeURLs" value="-1">
    <param name="baseURL" value>
    <param name="volume" value="50">
    <param name="mute" value="0">
    <param name="uiMode" value="full">
    <param name="stretchToFit" value="0">
    <param name="windowlessVideo" value="0">
    <param name="enabled" value="-1">
    <param name="enableContextMenu" value="-1">
    <param name="fullScreen" value="0">
    <param name="SAMIStyle" value>
    <param name="SAMILang" value>
    <param name="SAMIFilename" value>
    <param name="captioningID" value>
    <param name="enableErrorDialogs" value="0">
    <param name="_cx" value="6482">
    <param name="_cy" value="6350">
  </object>
</p>
<input type=button value=mute onclick=phx.settings.mute=phx.settings.mute==true?false:true;time.innerText=phx.settings.mute==true?'静音':'关闭静音';>
<input type=button value=play onclick=phx.controls.play();time.innerText='播放';>
<input type=button value=pause onclick=phx.controls.pause();time.innerText='暂停';>
<input type=button value=stop onclick=phx.controls.stop();time.innerText='停止';>
<input type=button value=mode onclick=phx.settings.balance=phx.settings.balance=='100'?'-100':'100';time.innerText=phx.settings.balance=='100'?'右声道':'左声道';>
利用Javascript实现对Media Player的控制功能》由第二电脑网原创提供,转载请注明:http://www.002pc.com/master/College/Programming/JavaScript/13385.html


关键字:

关于《利用Javascript实现对Media Player的控制功能》文章的评论

站内搜索: 高级搜索

热门搜索: Windows style 系统 tr IP QQ CPU 安装 function 注册 if td