0 Replies Latest reply on Nov 19, 2009 10:36 PM by Sreelash

    Custom flv video player

    Sreelash Level 1

      Hi,

                I had implemented a flv video player. But there are little issues in scrubbing part. Can anybody help me to solve this problem. The player that i have implemented is set in the following url "www.howardgreenhalgh.com". Thus you can understand the issue with my player. Inorder to speed up the downloading rate of video, is there any method. In that site , i am not using media server. I simply placed the videos in the server  and calling the videos from there itself when playing. Thus its taking time to download. Can anybody provide some suggestions for this. The part of code that i have used is pasted below:

       

      function Play(){
          if(isPlaying == false){
              ns.play(currFile);
              isPlaying = true;
          } else {
              ns.pause();
          }
          videoHolderMC.videoFrame.controlsCont.playButton._visible = false;
          videoHolderMC.videoFrame.controlsCont.pauseButton._visible = true;   
      }
      function Pause(){
          videoHolderMC.videoFrame.controlsCont.playButton._visible = true;
          videoHolderMC.videoFrame.controlsCont.pauseButton._visible = false;
          ns.pause();
      }
      function Stop(){   
          ns.seek(0);
          ns.pause();
          //ns.close();   
          videoHolderMC.videoFrame.preloader._visible = false;
          videoHolderMC.videoFrame.controlsCont.playButton._visible = true;
          videoHolderMC.videoFrame.controlsCont.pauseButton._visible = false;
          isPlaying = false;
      }
      function Replay(){
          ns.close();
          ns.play(currFile);
      }
      function videoStatus(){
          amountLoaded = ns.bytesLoaded/ns.bytesTotal;
          videoHolderMC.videoFrame.controlsCont.loader.loadbar._width = amountLoaded * 374;
          videoHolderMC.videoFrame.controlsCont.loader.scrub._x = ns.time/duration * 366;
      }
      function scrubberFunction(){
          clearInterval(videoInterval);   
          scrubInterval = setInterval(scrubit,10);
          this.startDrag(false,1.2,this._y,videoHolderMC.videoFrame.controlsCont.loader.loadbar._wi dth - 8,this._y);
      }
      function scrubRelease(){
          clearInterval(scrubInterval);   
          videoInterval = setInterval(videoStatus,100);
          this.stopDrag();
      }
      function scrubit(){
          ns.seek((videoHolderMC.videoFrame.controlsCont.loader.scrub._x/366) * duration);   
      }

      function MuteOn(){
          volFlag = false;
          audio_sound.setVolume(0);
          videoHolderMC.videoFrame.controlsCont.mute_on._visible = false;
          videoHolderMC.videoFrame.controlsCont.mute_off._visible = true;
      }
      function MuteOff(){
          volFlag = true;
          audio_sound.setVolume(Volume);
          videoHolderMC.videoFrame.controlsCont.mute_on._visible = true;
          videoHolderMC.videoFrame.controlsCont.mute_off._visible = false;
      }
      function startDragVol(){
          this.startDrag(false, 0, this._y, 32, this._y);
          videoHolderMC.videoFrame.controlsCont.volBar.volScrub.onMouseMove = updateVol;
      }
      function stopDragVol(){
          this.stopDrag();
      }
      function updateVol(){
          Volume = (this._x/32)*100;
          if(this._x == 0){
              videoHolderMC.videoFrame.controlsCont.mute_on._visible = false;
              videoHolderMC.videoFrame.controlsCont.mute_off._visible = true;
              audio_sound.setVolume(0);
          } else if(volFlag == true) {
              videoHolderMC.videoFrame.controlsCont.mute_on._visible = true;
              videoHolderMC.videoFrame.controlsCont.mute_off._visible = false;
              audio_sound.setVolume(Volume);
          }   
      }

       

       

      The control is working but some little problems are with. I would like to make it perfect. Please help me.

       

      Thanks and regards,

                   Sreelash