1 Reply Latest reply on Jul 13, 2009 7:03 AM by kglad

    Problems with flvplayback component

    PurpleArts

      How can i reset the state of my flvplayback component?

       

      for example, if i click a close button, my flvplayback component / player will be closed.

       

      my component will be reloaded to its original state everytime it is closed.

      i am having problems with my player whenever an invalid flv is passed to its parameter.

       

      its not reloading the variables and it is getting the previous url path that was passed.

       

      how will i reset all the values of my component before starting to play it again?

       

      basically,

      what i need is whenever a video/audio is invalid it will not load on the component. and make the buttons disabled.

      and i also need to remove the data from the previous transaction and reload the new data.

       

       

      i badly need help. Thanks.

       

      public function getVidURLFromJS(VidStr:String):Void
          {
              clear(_flvInterval);
              clear(_totalInterval);
             
              _podcastDownloadAudio._visible = false;
              _podcastDownloadVideo._visible = false;
             
              var vidURL:String = VidStr;
             
              if(vidURL.indexOf(".flv") == -1)
              {   
                  _isMediaValid = false;
                 
             
                  _CountBG._visible = true;
                  _progressText._visible = true;
                  _totalText._visible = true;
                  //_flvPlayBack.skin = "../Flash/skin.swf";
                  _flvPlayBack.gotoAndStop(1);
                 
                  _progressText._y = _flvPlayBack.height + 9;
                  _totalText._y = _flvPlayBack.height + 9;
                  _progressText._x =  _flvPlayBack.height - 20;
                  _totalText._x =  _flvPlayBack.height + 12;
                 
                  _progressText.text = "00:00";
                  _totalText.text = "00:00";
                 
                  _CountBG._width = 65;
                  _CountBG._height = 14;
                 
                  _CountBG._y =  _flvPlayBack.height + 9;
                  _CountBG._x =  _flvPlayBack.height - 15;
                 
                 
                 
                  _closeMovie.onRelease = Delegate.create(this,closeMovie);
                 
              }
             
              else
              {
              _isMediaValid = true;
              _CountBG._visible = true;
              //_flvPlayBack.skin = "../Flash/skin.swf";
              _flvPlayBack.autoSize = false;
              _flvPlayBack.contentPath = vidURL;
             
              //_flvPlayBack.maintainAspectRatio = false;
              _flvPlayBack.play();
              _flvInterval = setInterval(Delegate.create(this, updatePlayTime), 1000, _flvPlayBack);
              _totalInterval = setInterval(Delegate.create(this, setTotalTime), 1000, _flvPlayBack);
             
              _isPlaying = true;
              setTotalTime(_flvPlayBack);
             
              _closeMovie.onRelease = Delegate.create(this,fadeMovieOut);
                     
              }
             
          }