I want to retranslate the stream from my FMS to number of fms servers.
I want to use example of the Multipoint publishing from the ADOBE®FLASHMEDIA SERVER 4.5® Developer’s Guide:
application.onPublish = function(client, myStream) {
trace(myStream.name + " is publishing into application " + application.name);
if (application.name == "livestreams/_definst_"){
trace("Republishing the stream into livestreams/anotherinstance");
nc = new NetConnection();
nc.connect( "rtmp://remoteserver1/live" );
ns = new NetStream(nc);
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( livestream1, "live" );
}
}
ns.onStatus = function(info) {
trace("Stream Status: " + info.code)
if (info.code == "NetStream.Publish.Start") {
trace("The stream is now publishing");
}
}
application.onUnpublish = function( client, myStream ) {
trace(myStream.name + " is unpublishing" );
}
But here is discribed only redirecting stream from one server to another one.
Retranslating for one to one server works good, but it don`t work when I try modify it for two retranslations and add to this script next strings:
nc1 = new NetConnection();
nc1.connect( "rtmp://remoteserver2/live" );
ns1 = new NetStream(nc1);
...
ns1.setBufferTime(2);
ns1.attach(myStream);
ns1.publish(livestream2, "live" );
What I do wrong?
North America
Europe, Middle East and Africa
Asia Pacific