Skip to main content
Inspiring
December 3, 2007
Answered

Stream.notify Start/Stop serverside

  • December 3, 2007
  • 1 reply
  • 494 views
Hi to you all, you great flashers...(i know abit over the top)

Any one knows how to trigger on stream.publish.start & unpublish on the serverside?? Right now I'm triggering a server function by stream.publish.start on the client wich seams a bit stupid as the stream.publish.start comes from the server....

Thx again for any pointers to the right direction

/A
    This topic has been closed for replies.
    Correct answer zozew
    Hi again,

    Found out that you need to "subsribe" to the client Stream on the server side to get the onStatus events sent to the server itself, like this.

    statStream=Stream.get("anyname");
    statStream.play("livestream");
    statStream.onStatus = function (infoObj) {
    trace(" ------ onStatus: " + infoObj.code);
    };

    1 reply

    Participant
    December 3, 2007
    Creating a NetStream on Client side and attaching a Microphone/Camera to that NetStream, and then start publishing (by using NetStream.publish(), this should trigger the event u r looking for.
    zozewAuthor
    Inspiring
    December 3, 2007
    HI there,

    Well what you describe is precisely what I have up and running now. What I want though, is the event triggered from the serverside actionscript code. So for Ex:

    The client publishes his cam and is accepted by serverside
    When client recives NetStream.Publish.Start the serverside is triggerd but within the serverside actionscript not as a call from the client as it is now.

    There must be a way for the serverside actionscript to betriggerd on the same "NetStream.Publish.Start" as the client.....

    /A

    zozewAuthorCorrect answer
    Inspiring
    December 5, 2007
    Hi again,

    Found out that you need to "subsribe" to the client Stream on the server side to get the onStatus events sent to the server itself, like this.

    statStream=Stream.get("anyname");
    statStream.play("livestream");
    statStream.onStatus = function (infoObj) {
    trace(" ------ onStatus: " + infoObj.code);
    };