Skip to main content
Known Participant
January 30, 2007
Question

2 issue's with FCS

  • January 30, 2007
  • 7 replies
  • 570 views
Hi guys,

I am doing some work with FCS for the first time. I did run inot a couple of issue's but found ways around then or at least i thought :S

First issue:

When a user records a stream he/she is promted to save it at wich point i have a php script moving it to an open web directory.
Now when i try to call this flv for playing i get a file not found error(404)
i know that the flv is there and that the content path is correct.
I have evet went as far as to put a simple swf in the same directory as the flv file.
I tried with both video and flv player

/---------------------------------------------/
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
vid2.attachVideo(stream_ns);
stream_ns.play("profile.flv");
vid1.contentPath = "profile.flv";
/---------------------------------------------/

Now here's my second issue.

The files that have been recorded to FCS. How on earth do i delete them without having to shutdown FCS and manually delete them?

Thanks
Paul
:frown;
    This topic has been closed for replies.

    7 replies

    Known Participant
    February 2, 2007
    I have the book here and will listen to your advise.
    Am still going to post for help though :P
    February 1, 2007
    Not sure why the forum isn't more robust. I just post here, I'm not an admin.

    The application object has nothing to do with the .swf. It refers to the application running on the server. You'r really going to need to understand the client and application objects and how they work before you're going to grasp all of the programming concepts surrounding them.

    I know a lot of people aren't so keen on book learning these days, but FMS is fairly complicated and introduces a lot of new concepts to people who are familiar only with client side flash. My advice, pick up a copy of "Programming Flash Communication Server", and read it cover to cover. Once you get through it (and the wealth of examples it comes with), all of the little bits and pieces will fall right into place.
    Known Participant
    February 1, 2007
    quote:

    pick up a copy of "Programming Flash Communication Server",

    Would that be the O'Reilly book?
    February 2, 2007
    quote:

    Originally posted by: [djdomain]
    quote:

    pick up a copy of "Programming Flash Communication Server",

    Would that be the O'Reilly book?


    That's the one:

    http://flash-communications.net

    Even though it's a couple of years old, I still find it to be the best book out there.


    Known Participant
    February 1, 2007
    Yes the stream has just been recorded and i wish to give the user the option after playback to keep it or bin it.

    Is the above code correct?
    how would i flash the stream before clearing it?


    thanks
    February 1, 2007
    The reason your result handler isn't getting fired off is because the server function is applied to the application, not to the client object. Try replacing this:

    application.deleteStream = function(streamName){
    s = Stream.get(streamName);
    if (s){
    s.clear();
    return true;
    }else{
    return false;
    }
    }

    with this:

    application.handleDeleteStream = function(streamName){
    s = Stream.get(streamName);
    if (s){
    s.flush();
    s.clear();
    return true;
    }else{
    return false;
    }
    }

    Client.prototype.deleteStream = function(stream){
    d = application.handleDeleteStream(stream);
    if (d){
    return true;
    }else{
    // handle errors here
    }
    }

    Now, FMS can auto-resolve back to the client, and your result handler should get fired off.

    Also, you should close the stream on the client side before clearing if you haven't already. I don't know how FMS reacts if you try to delete a stream that is in use.

    Known Participant
    February 1, 2007
    I am catching on uickly but still a bit of a nob

    application?
    What is the application?
    is that main.asc
    does applcation in turn hold the name of my swf to link it with FCS/FMS
    so when i say application.blah i am actually say myswf.blah?

    And why is there no bbcode tagging?

    You have 800+ post surely you know why???

    February 1, 2007
    Is it a stream that was previously in use? I had a problem like that once before, and I seem to remember fixing it by flushing the stream before clearing.
    Known Participant
    February 1, 2007
    Why are ther no tags on the forum??
    Known Participant
    February 1, 2007
    Benn there already
    i have this in flash

    butDelete.onRelease = function() {
    deleteArchive();
    };
    function deleteArchive() {
    // calls the function on the ASC called deleteStream, send over the name of the flv
    client_nc.call("deleteStream", new DeleteStreamHandler(), archiveView_tx.text);
    }
    function DeleteStreamHandler() {
    tx.text = "success";
    editList(archiveView_tx.text, "removeOne");
    this.onResult = function(res) {
    tx.text = res;
    archiveView_tx.text = "";
    };
    }

    Then in the server side main.asc i have

    application.deleteStream = function(streamName){
    s = Stream.get(streamName);
    if (s){
    s.clear();
    return true;
    }else{
    return false;
    }
    }

    It returns true but yet the file does not get deleted not does this.onResult trigger.
    Known Participant
    February 1, 2007
    Issue one has been resolved but still cant figure issue 2.

    Anyone???
    February 1, 2007
    About #2 ... see the FMS docs (server side actionscript) for stream.clear() . That's what you're looking for.