Skip to main content
Inspiring
February 6, 2014
Question

Multi-point publishing with MBR - Help!

  • February 6, 2014
  • 0 replies
  • 401 views

Hi,

I've been trying MPP for the last few days and it works fine for single stream but when I have 3 stream, at different bitrates, pnly the last one works, other work for short period and then they stop

Here is the code I am using. Please guide as to how I can change this code to republish more than one stream!

// Called when the client publishes

application.onPublish = function(client, myStream) {

    trace(myStream.name + " is publishing into application " + application.name);

    // This is an example of using the multi-point publish feature to republish

    // streams to another application instance on the local server.

    if (application.name == "live/_definst_"){

        trace("Republishing the stream " + myStream.name + "into /livepkgr2");

        nc = new NetConnection();

        nc.connect( "rtmp://localhost/livepkgr2" );

        ns = new NetStream(nc);

        // called when the server NetStream object has a status

        ns.onStatus = function(info) {

            trace("Stream Status: " + info.code)

            if (info.code == "NetStream.Publish.Start") {

                trace("The stream is now publishing");

            }         

        }

        ns.setBufferTime(2);

        ns.attach(myStream);

        ns.publish( myStream.name +"?adbe-live-event=liveevent", "live" );

    }

}

application.onUnpublish = function( client, myStream ) {

    trace(myStream.name + " is unpublishing"  );

}

    This topic has been closed for replies.