1 Reply Latest reply on Jun 13, 2007 10:21 AM by frankosaurus

    How to recover from FLVPlayback connectionError

    frankosaurus
      I'm using an FLVPlayback object to play .flv files stored on various servers.
      It works fine when I pass in a valid FLV URL that is accessible:

      myFLVPlayer.play(validFLVURL);

      Occasionally, these servers are down and there's a connection error.
      I've caught this error using the following code:

      myFLVPlayer.addEventListener("stateChange", doStateChange);
      function doStateChange(eventObj:Object):Void {
      switch (eventObj.state) {
      case "connectionError":
      msgArea.text = "Unable to load video";
      break;
      }
      }

      However, I don't know how to recover from the error. If I call the play() function with a valid .flv URL, it doesn't work after the connectionError has occured. I need to reload my webpage to get it working again.

      So, this is the sequence that's causing problems:

      myFLVPlayer.play("some valid URL"); //ok
      ...
      myFLVPlayer.play("some invalid URL"); //causes connectionError
      ...
      myFLVPlayer.play("some valid URL"); //doesn't work!

      Any suggestions would be greatly appeciated. Thanks!