Skip to main content
Participant
March 7, 2008
Question

Multipoint Publishing with FME and 2 FMS servers

  • March 7, 2008
  • 2 replies
  • 687 views
Hello,

I am trying to setup Multipoint Publishing using FME and a couple of FMS servers. Can you take a look at the below code and let me know if I should be doing something different.

- FME streams to FMS 1 (on SERVER_1)
- FMS1 publishes to FMS2 (on SERVER_2) using the below actionscript in main.asc file on FMS1

I have put the code under FCPublish because the comments in main.asc state that FME calls FCPublish when it publishes a new stream.

Client.prototype.FCPublish = function( streamname )
{
if ( true) // do some validation here
{
this.call("onFCPublish", null, {code:"NetStream.Publish.Start", description:streamname});
nc = new NetConnection();
nc.connect("rtmp://SERVER_2/test_HighBW/");
ns = new NetStream(nc);
ns.publish(streamname);
}
else
{
this.call("onFCPublish", null, {code:"NetStream.Publish.BadName", description:streamname});
}
}


Thanks in advance,
Sai

    This topic has been closed for replies.

    2 replies

    Participating Frequently
    April 29, 2010

    Try this code:

    var nc;

    var ns;

    application.onAppStart = function(){

         nc = new NetConnection();

         nc.onStatus = function(info){

                   trace(info.code);

         }

         nc.connect("rtmp://SERVER_2/test_HighBW");

    }

    application.onPublish = function(c,s){

         ns = new NetStream(nc);

         retVal =ns.attach(s);

         if(retVal)

              ns.publish(s.name);

         else

              trace("Cannot publish as attach failed");

    }

    let me know if you need any help.

    Participant
    March 14, 2008
    Need to add:

    ns.attach(streamname);

    That sends the incoming stream out the new NetStream. The name passed in the ns.publish method is the stream name on the OTHER server. It can be the same, if you want. But it has nothing to do with the streamname parameter of the FCPublish function.