javascript 播放器 控制_javascript技巧_脚本之家

作者:官方彩票手机投注网站-服务器运维

详细参数可查询MSDN -//W3C//DTDHTML4.0Transitional//EN">

varstate; //初始化 functionplayerinit() { player.url="mp3.m3u"; player.settings.autoStart=false; } //播放 functionplay() { if(player.controls.isavailable { player.controls.play(); state=setInterval; playerinfo.innerHTML="播放"; } } //暂停 functionpause() { if(player.controls.isavailable { player.controls.pause(); clearInterval; playerinfo.innerHTML="暂停"; } } //停止 functionstop() { if(player.controls.isavailable { player.controls.stop(); clearInterval; playerinfo.innerHTML="停止"; } } //前首 functionprevious() { if(player.controls.isavailable { player.controls.previous(); playerinfo.innerHTML="前一首"; } } //后首 functionnext() { if(player.controls.isavailable { player.controls.next(); playerinfo.innerHTML="下一首"; } } //? functionstep() { if(player.controls.isavailable player.controls.step; } //音量- functionvoldown() { if(player.settings.volume<5) { player.settings.volume=0; playerinfo.innerHTML="0"; } else { player.settings.volume-=5; playerinfo.innerHTML=player.settings.volume; } } //音量+ functionvolup() { if(player.settings.volume>95) { player.settings.volume=100; playerinfo.innerHTML="100"; } else { player.settings.volume+=5; playerinfo.innerHTML=player.settings.volume; } } //静音 functionmute() { player.settings.mute=!player.settings.mute; } //声道 functionbalance() { switch(player.settings.balance) { case0: player.settings.balance=100; playerinfo.innerHTML='左声道'; break; case100: player.settings.balance=-100; playerinfo.innerHTML='右声道'; break; case-100: player.settings.balance=0; playerinfo.innerHTML='全声道'; break; default: player.settings.balance=0; playerinfo.innerHTML='全声道'; break; } } //更新时间 functionupdatetime() { playerinfo.innerHTML=player.controls.currentPositionString+"|"+player.currentMedia.durationString; }

switch{ case1: playerinfo.innerHTML="停止"; break; case2: playerinfo.innerHTML="暂停"; break; case3: playerinfo.innerHTML="正在播放"; break; case4: playerinfo.innerHTML="4"; break; case5: playerinfo.innerHTML="5"; break; case6: playerinfo.innerHTML="正在缓冲..."; break; case7: playerinfo.innerHTML="7"; break; case8: playerinfo.innerHTML="8"; break; case9: playerinfo.innerHTML="正在连接..."; break; case10: playerinfo.innerHTML="准备就绪。欢迎光临"; break; case11: playerinfo.innerHTML="11"; break; default: playerinfo.innerHTML=""; }

本文由彩票投注软件发布,转载请注明来源

关键词: