Home > Web Front-end > JS Tutorial > body text

javascript player control_javascript skills

WBOY
Release: 2016-05-16 19:20:15
Original
895 people have browsed it

详细参数可查询MSDN
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay/mmp_sdk/settingsobject.asp

nbsp;HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">








  
    
  
  
    
  
  
    
  

      
      
      
      
      
      
      
      
      
      
      
      
      
      
    

      










   

 

  
                             

             
             
       <script> <BR>var state; <br><br>//初始化 <BR>function playerinit() <BR>{ <BR> player.url="mp3.m3u"; <BR> player.settings.autoStart = false ; <BR>} <br><br>//播放 <BR>function play() <BR>{ <BR> if (player.controls.isavailable('play')) <BR> { <BR> player.controls.play(); <BR> state=setInterval("updatetime()",1000); <BR> playerinfo.innerHTML = "播放"; <BR> } <BR>} <br><br>//暂停 <BR>function pause() <BR>{ <BR> if (player.controls.isavailable('pause')) <BR> { <BR> player.controls.pause(); <BR> clearInterval(state); <BR> playerinfo.innerHTML = "暂停"; <BR> } <BR>} <br><br>//停止 <BR>function stop() <BR>{ <BR> if (player.controls.isavailable('stop')) <BR> { <BR> player.controls.stop(); <BR> clearInterval(state); <BR> playerinfo.innerHTML = "停止"; <BR> } <BR>} <br><br>//前首 <BR>function previous() <BR>{ <BR> if (player.controls.isavailable( 'previous' )) <BR> { <BR> player.controls.previous(); <BR> playerinfo.innerHTML = "前一首"; <BR> } <BR>} <br><br>//后首 <BR>function next() <BR>{ <BR> if (player.controls.isavailable( 'next' )) <BR> { <BR> player.controls.next(); <BR> playerinfo.innerHTML = "下一首"; <BR> } <BR>} <br><br>//? <BR>function step() <BR>{ <BR> if (player.controls.isavailable( 'step' )) <BR> player.controls.step( 1 ); <BR>} <br><br>//音量- <BR>function voldown() <BR>{ <BR> if ( player.settings.volume < 5 ) <BR> { <BR> player.settings.volume = 0; <BR> playerinfo.innerHTML = "0"; <BR> } <BR> else <BR> { <BR> player.settings.volume -= 5; <BR> playerinfo.innerHTML = player.settings.volume; <BR> } <BR>} <br><br>//音量+ <BR>function volup() <BR>{ <BR> if ( player.settings.volume > 95 ) <BR> { <BR> player.settings.volume = 100; <BR> playerinfo.innerHTML = "100"; <BR> } <BR> else <BR> { <BR> player.settings.volume += 5; <BR> playerinfo.innerHTML = player.settings.volume; <BR> } <BR>} <br><br>//静音 <BR>function mute() <BR>{ <BR> player.settings.mute = !player.settings.mute; <BR>} <br><br>//声道 <BR>function balance() <BR>{ <BR> switch (player.settings.balance) <BR> { <BR> case 0: <BR> player.settings.balance = 100; <BR> playerinfo.innerHTML = '左声道'; <BR> break; <BR> case 100: <BR> player.settings.balance = -100; <BR> playerinfo.innerHTML = '右声道'; <BR> break; <BR> case -100: <BR> player.settings.balance = 0; <BR> playerinfo.innerHTML = '全声道'; <BR> break; <BR> default : <BR> player.settings.balance = 0; <BR> playerinfo.innerHTML = '全声道'; <BR> break; <BR> } <BR>} <br><br>//更新时间 <BR>function updatetime() <BR>{ <BR> playerinfo.innerHTML = player.controls.currentPositionString + " | " + player.currentMedia.durationString; <BR>} <br><br></script>       <script> <BR>switch (newstate){ <BR> case 1: <BR> playerinfo.innerHTML = "停止"; <BR> break; <BR> case 2: <BR> playerinfo.innerHTML = "暂停"; <BR> break; <BR> case 3: <BR> playerinfo.innerHTML = "正在播放"; <BR> break; <BR> case 4: <BR> playerinfo.innerHTML = "4"; <BR> break; <BR> case 5: <BR> playerinfo.innerHTML = "5"; <BR> break; <BR> case 6: <BR> playerinfo.innerHTML = "正在缓冲..."; <BR> break; <BR> case 7: <BR> playerinfo.innerHTML = "7"; <BR> break; <BR> case 8: <BR> playerinfo.innerHTML = "8"; <BR> break; <BR> case 9: <BR> playerinfo.innerHTML = "正在连接..."; <BR> break; <BR> case 10: <BR> playerinfo.innerHTML = "准备就绪。欢迎光临<a href='http://mp3.asp2004.net'>http://mp3.asp2004.net"; <BR> break; <BR> case 11: <BR> playerinfo.innerHTML = "11"; <BR> break; <BR> default: <BR> playerinfo.innerHTML = ""; <BR>} <BR></script>                                                            
      
   
 
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template