Skip to main content
calmchessplayer
Inspiring
June 16, 2010
Answered

onStatus returns wrong codes??

  • June 16, 2010
  • 1 reply
  • 632 views

I'm using the following code to record a stream on the server side,,,,,,the problem is onStatus only reports NetStatus.data.start and no other codes i don't even know what the code it does returns means as it is undocumented .....how can i make onStatus report properly?

Client.prototype.RecStream = function(adName,insID){
this.recordStream = Stream.get(adName);
this.recordStream.onStatus = function(info) {
  trace(info.code);
  }
this.recordStream.record("record",30);
application.adminObj[adName].recStat="Recording";
}

    This topic has been closed for replies.
    Correct answer amit_kr

    Hi,

    I am publishing stream name "sample". You need to get the Stream instance on different name other than what you are publishing and also you need to play the live stream published to the application so that you can receive the status messages on server side, so you get the status messages in the following order:

    2010-06-17 11:50:03 2912 (s)2641173 Inside RecStream... -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Publish.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Play.Reset -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Play.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Data.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Record.Start

    Code Snippet

    ---------------------

    Client.prototype.RecStream = function(adName,insID)
    {
    this.recordStream = Stream.get("hello");
    this.recordStream.onStatus = function(info) {
            trace(info.code);
    }
    this.recordStream.play("sample");
    this.recordStream.record("record",30);

    application.adminObj[adName].recStat="Recording";
    }

    Regards,

    Amit

    1 reply

    amit_krCorrect answer
    Adobe Employee
    June 17, 2010

    Hi,

    I am publishing stream name "sample". You need to get the Stream instance on different name other than what you are publishing and also you need to play the live stream published to the application so that you can receive the status messages on server side, so you get the status messages in the following order:

    2010-06-17 11:50:03 2912 (s)2641173 Inside RecStream... -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Publish.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Play.Reset -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Play.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Data.Start -

    2010-06-17 11:50:03 2912 (s)2641173 NetStream.Record.Start

    Code Snippet

    ---------------------

    Client.prototype.RecStream = function(adName,insID)
    {
    this.recordStream = Stream.get("hello");
    this.recordStream.onStatus = function(info) {
            trace(info.code);
    }
    this.recordStream.play("sample");
    this.recordStream.record("record",30);

    application.adminObj[adName].recStat="Recording";
    }

    Regards,

    Amit

    calmchessplayer
    Inspiring
    June 17, 2010

    Thanks alot that worked awesome