播放器js控制realplayer(JS 视频播放器)

 
             
                         
                         
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                                     
                         
                         
             
             
                 
     
             
                       

function   loop() 

            WindowsMediaPlayer.playCount=2; 
}

function   openfile() 

            var   fstr=''; 
            FileBtn.click(); 
            if   (FileBtn.value=='') 
            return; 
            WindowsMediaPlayer.URL=FileBtn.value; 
            playerinfo1.innerHTML   =   '全声道   '; 
            playerinfo3.innerHTML="当前播放文件的路径和名称是:   "+FileBtn.value; 
}

function   playerinit() 

            WindowsMediaPlayer.url="unit10.wmv";             //定义你自己的文件 
            WindowsMediaPlayer.settings.autoStart   =   false   ; 
}

function   play() 

            //if(WindowsMediaPlayer.URL='')alert('请打开文件');return;   οnlοad="playerinit()" 
            if   (WindowsMediaPlayer.controls.isavailable('play')) 
            { 
                        WindowsMediaPlayer.controls.play(); 
                        state=setInterval("updatetime()",1000); 
                        playerinfo.innerHTML   =   "播放" 
                        varfullscreen=1; 
                        playerinfo2.innerHTML   =   '音量:'+WindowsMediaPlayer.settings.volume; 
            } 
}

function   voldown() 

            if   (   WindowsMediaPlayer.settings.volume   <   5   ) 
            { 
                        WindowsMediaPlayer.settings.volume   =   0; 
                        playerinfo2.innerHTML   =   "音量:0"; 
                        playerinfo1.innerHTML   =   '沉默中   '; 
            } 
            else 
            { 
                        WindowsMediaPlayer.settings.volume   -=   5; 
                        playerinfo2.innerHTML   =   '音量:'+WindowsMediaPlayer.settings.volume; 
                        playerinfo1.innerHTML   =   '非静音   '; 
            } 
}

function   volup() 

            if   (   WindowsMediaPlayer.settings.volume   >   95   ) 
            { 
                        WindowsMediaPlayer.settings.volume   =   100; 
                        playerinfo2.innerHTML   =   "音量:100"; 
                        playerinfo1.innerHTML   =   '最大音   '; 
            } 
            else 
            { 
                        WindowsMediaPlayer.settings.volume   +=   5; 
                        playerinfo2.innerHTML   =   '音量:'+WindowsMediaPlayer.settings.volume; 
                        playerinfo1.innerHTML   =   '非静音   '; 
            } 
}

function   pause() 

            if   (WindowsMediaPlayer.controls.isavailable('pause')) 
            { 
                        WindowsMediaPlayer.controls.pause(); 
                        clearInterval(state); 
                        playerinfo.innerHTML   =   "暂停"; 
                        varfullscreen=1; 
            } 
}

function   stop() 

            if   (WindowsMediaPlayer.controls.isavailable('stop')) 
            { 
                        WindowsMediaPlayer.controls.stop(); 
                        clearInterval(state); 
                        playerinfo.innerHTML   =   "停止" 
                        varfullscreen=0; 
            } 
}

function   mute() 

            WindowsMediaPlayer.settings.mute   =   !WindowsMediaPlayer.settings.mute; 
            if(varb!=1) 
            { 
                        playerinfo1.innerHTML   =   '静音中   '; 
                        document.all.volup.disabled=true; 
                        document.all.voldown.disabled=true; 
                        document.all.balance.disabled=true; 
                        varb=1; 
            } 
            else 
            { 
                        playerinfo1.innerHTML   =   '非静音   '; 
                        document.all.volup.disabled=false; 
                        document.all.voldown.disabled=false; 
                        document.all.balance.disabled=false; 
                        varb=0; 
            } 
}

function   balance() 

            switch   (WindowsMediaPlayer.settings.balance) 
            { 
            case   0: 
                        WindowsMediaPlayer.settings.balance   =   100; 
                        playerinfo1.innerHTML   =   '左声道   '; 
                        break; 
            case   100: 
                        WindowsMediaPlayer.settings.balance   =   -100; 
                        playerinfo1.innerHTML   =   '右声道   '; 
                        break; 
            case   -100: 
                        WindowsMediaPlayer.settings.balance   =   0; 
                        playerinfo1.innerHTML   =   '全声道   '; 
                        break; 
            default   : 
                        WindowsMediaPlayer.settings.balance   =   0; 
                        playerinfo1.innerHTML   =   '全声道   '; 
                        break; 
            } 
}

function   fullScreen() 

            if(varfullscreen) 
                        WindowsMediaPlayer.fullScreen='true'; 
            else 
                        WindowsMediaPlayer.fullScreen='0'; 
}


function   updatetime() 

            if(WindowsMediaPlayer.controls.currentPositionString=='') 
                        { 
                                    playerinfo.innerHTML   =   "00:00"   +   "   /   "   +   WindowsMediaPlayer.currentMedia.durationString; 
                                    varfullscreen=0; 
                        } 
            else 
                        playerinfo.innerHTML   =   WindowsMediaPlayer.controls.currentPositionString   +   "   /   "   +   WindowsMediaPlayer.currentMedia.durationString; 

 
 
switch   (newstate) 

            case   1: 
                        playerinfo.innerHTML   =   "停止"; 
                        break; 
            case   2: 
                        playerinfo.innerHTML   =   "暂停"; 
                        break; 
            case   3: 
                        playerinfo.innerHTML   =   "正在播放"; 
                        break; 
            case   4: 
                        playerinfo.innerHTML   =   "4"; 
                        break; 
            case   5: 
                        playerinfo.innerHTML   =   "5"; 
                        break; 
            case   6: 
                        playerinfo.innerHTML   =   "正在缓冲..."; 
                        break; 
            case   7: 
                        playerinfo.innerHTML   =   "7"; 
                        break; 
            case   8: 
                        playerinfo.innerHTML   =   "8"; 
                        break; 
            case   9: 
                        playerinfo.innerHTML   =   "正在连接..."; 
                        break; 
            case   10: 
                        playerinfo.innerHTML   =   "准备就绪"; 
                        break; 
            case   11: 
                        playerinfo.innerHTML   =   "11"; 
                        break; 
            default: 
                        playerinfo.innerHTML   =   ""; 

你可能感兴趣的:(javascript)