Pulling a stream from external FMS and publishing in Multicast
Hi. I'm developping a FMS 4 application that read an external stream, and then, republish it in multicast:
1.- So, first of all I open a NetConnection to the remote application. And I associate it to a new Stream created in the application. Then I have the stream available in my application.
nc = new NetConnection();
nc.connect(REMOTE_APPLICATION);
nc.onStatus = function(info)
{
trace("REMOTE_APPLICATION->NetConnection> code: " + info.code);
if (info.code == "NetConnection.Connect.Success")
{
rebroadcast_s = new Stream.get("tempStream");
rebroadcast_s.onStatus = function(info)
{
trace("Stream> code: " + info.code);
trace("Stream> details: " + info.details);
if (info.code == "NetStream.Publish.Start")
{
trace("REMOTE_STREAM->The stream is now publishing");
}
};
rebroadcast_s.play(REMOTE_STREAM, -1, -1, true, nc);
}
};
2.- I would like to use the same methods of native multicast.as application, for managing the multicast publishing: registerStream, openMulticastConnection, ...
var MULTICAST_PARAMETERS = "fms.multicast.type=2&fms.multicast.groupspec=G%3A0101210558cc3408e77326e2fa1c53c52697d73e1b02182c358c57075cd9a58ed1a25241010d160e666d732e6d756c7469636173742e6578616d706c65210e8555a813f0c73cd8f5384e0fba657163ab87e76c25b6f82be9b94777b2d52cfe00070aefff00fe7530051576706f64&fms.multicast.address=239.255.0.254%3A30000";
var params = parseQueryString(MULTICAST_PARAMETERS);
var streamContext = registerStream(CLIENT??????, MULTICAST_STREAM_NAME, params);
openMulticastConnection(streamContext);
But, I don't know who would be the client in the registerStream method. Which reference should I add there? Is it possible in this way?
I made another different script that republish that stream in localhost using NetConnection.publish(localhost/sameapplication). It works properly. But I would like to be able of managing it in the other way.
Thank you,
Iván
