Welcome, Guest
  • Author Topic: Hell after connection error with FLVPlayback component  (Read 3869 times)

    winxalex

    • Server what's that
    • *
    • Posts: 26
      • View Profile
    Everything is fine when .flv file exists but what a hell if u hit not existing file. => connectionErorr and there is no way to set and play new .flv even its url is correct. contentPath property stays empty on and on....

    import mx.video.*;
    import mx.video.VideoError.code
    my_FLVPlybk.autoPlay = false;
    var listenerObject:Object = new Object();
    listenerObject.ready = function(eventObject:Object):Void {
       trace(eventObject.toString());
       // my_FLVPlybk.seekSeconds(4);
       trace("Ready:"+my_FLVPlybk.state);
        my_FLVPlybk.play();
       
    };



    listenerObject.stateChange = function(eventObject:Object):Void {
        if(my_FLVPlybk.state == "connectionError")//FLVPlayback.CONNECTION_ERROR)
          {
            trace("State: " + FLVPlayback.CONNECTION_ERROR);
          //What to do here
          //my_FLVPlybk.stop();
          //my_FLVPlybk.close();
          //delete my_FLVPlybk.contentPath;
          }
          else
          trace("State: "+my_FLVPlybk.state);
    };
    my_FLVPlybk.addEventListener("ready", listenerObject);
    my_FLVPlybk.addEventListener("stateChange", listenerObject);




    var listenerObject:Object = new Object();
    listenerObject.click = function(eventObj:Object){
       trace("In Click:"+my_FLVPlybk.state);
       try {
      _root.my_FLVPlybk.contentPath = _root.tb_URL.text;//"Ali_ali_ali_ali_dal_se_ovaj_Ahmeti_shali.flv";
    } catch (err:VideoError) {
    // TODO: skip to next video, that one caused an error
    trace("Error cateched: "+my_FLVPlybk.state);
    }

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    You can check for the existence of a file using LoadVars, just use LoadVars.load(watheverKindOfFile) and you will get true or false in the onLoad handler.

    Jorge

    winxalex

    • Server what's that
    • *
    • Posts: 26
      • View Profile
    It's  not a solution that I like but it is a solution despite of that i don't know what is happening when u try to load .flv file and can fell lag even locally probably cos of loading  ??? Didn't know what will happen online. THX

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    That's an usual problem when using components: if all goes fine, then ok. If something fails, probably you don't know what happens. Lately I have builded many players (I'm working on www.vpod.tv) Monitoring NetStream.onStatus is the only way of having a feedback (buffertime, playing, buffer empty, stream not found, etc) Aditionally some back-end script to deliver something when no content is there is an add.

    Jorge