| Jean-Luc NGUYEN 2005-07-16, 7:45 am |
| Hello,
The getLiveStreams method (in the Server Management ActionScript Dictionary)
is supposed to return all the live streams that are currently publishing on
an application instance.
But I noticed that the getLiveStreams method does not work correctly as it
returns ghost connection.
Here is how I did my test:
1) Publish a live stream named "test"
2) Call the getLiveStreams method: it returns an array with the "test"
stream
3) Publish a second live stream named "test2"
4) Call the getLiveStreams method: it returns an array with the "test" and
"test2" stream
5) Close the window with the "test" stream
6) Call the getLiveStreams method: it still returns an array with the "test"
and "test2" stream (I checked on the Administration Console->Communication
App Inspector->Streams, the "test" stream is not displayed).
7) Publish a third live stream named "test3"
8) Call the getLiveStreams method: it returns an array with the "test",
"test2" and "test3" stream
So I think that on the server side, every new stream is added to a variable
but when a stream stop publishing, it forgets to delete it.
What do you think about that?
(what is suspicious is that on the administration console, the publishing
streams are well listed, so maybe did I badly used the getLiveStreams
method? If anybody has the admin.fla file reserved for the Flash
Communication Server Registered User, could he sends it to me so I would be
able to see how the method was used)
Here's the code I used:
The check_stream.fla (connect to the admin application and trace the live
streams):
--------------------
function onGetLivestreams()
{
this.onResult = function (info) {
for (var i = 0; i < info["data"].length; i++)
trace ("stream " + [i] + ": " + info["data"][i]);
}
}
nc = new NetConnection();
nc.onStatus = function (info) {
trace(info.code);
nc.call("getLiveStreams", new onGetLivestreams(), "chat/_definst_");
}
nc.connect("rtmp://myurl:1111/admin", "username", "password");
The publish_stream.fla (publish a "test[1-2-3]" stream):
----------------------
myCam = Camera.get();
nc = new NetConnection();
nc.connect("rtmp://siteurl/chat");
ns = new NetStream(nc);
ns.attachVideo(myCam);
ns.publish("test"); //change this with desired publish name
video.attachVideo(myCam);
}
=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
|