Macromedia Flash Server - Trouble with doGetLiveStreams on server side

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > July 2005 > Trouble with doGetLiveStreams on server side





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Trouble with doGetLiveStreams on server side
Dragonspirit

2005-07-06, 5:45 pm

Hello all,

I'm trying to get all the active live streams on the flash communication
server.
(the function must be invoked on the server side as the username/password of
the fcs admin is in the code) and return a random one.
But I'm experiencing troubles to have it work.
My code works on the client side but won't work on the server side.
Here it is:

application.onConnect = function (clientObj) {
function doGetLiveStreams() {
function onGetLiveStreams() {
this.onResult = function (info) {
if (info.code != "NetConnection.Call.Success")
trace ("Call failed: " + info.description);
else
trace ("Stream: " +
info["data"][Math.round(Math.random()*(info["data"].length-1))]);
}
}
nc = new NetConnection();
nc.connect ("rtmp://www.hoobys-dev.com:1111/admin", "username",
"password");
nc.call("getLiveStreams", new onGetLiveStreams(), "webcam/_definst_");
}
doGetLiveStreams();
}

I have none of the "trace" output, so I assume the onResult event is never
called.
Any help would be REALLY appreciated

Thanks

--
Jean-Luc




=-----------------------------------------------------------
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

Dragonspirit

2005-07-09, 8:45 pm

I really need some help (even if it is just a direction to look for !)

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de =
Dragonspirit
Envoy=E9 : mercredi 6 juillet 2005 22:53
=C0 : flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Objet : [FlashComm] Trouble with doGetLiveStreams on server side

Hello all,

I'm trying to get all the active live streams on the flash communication
server.
(the function must be invoked on the server side as the =
username/password of
the fcs admin is in the code) and return a random one.
But I'm experiencing troubles to have it work.=20
My code works on the client side but won't work on the server side.=20
Here it is:=20

application.onConnect =3D function (clientObj) {
function doGetLiveStreams() {=20
function onGetLiveStreams() {=20
this.onResult =3D function (info) {=20
if (info.code !=3D "NetConnection.Call.Success")=20
trace ("Call failed: " + info.description);=20
else=20
trace ("Stream: " +
info["data"][Math.round(Math.random()*(info["data"].length-1))]);=20
}=20
}
nc =3D new NetConnection();
nc.connect ("rtmp://www.hoobys-dev.com:1111/admin", "username",
"password");
nc.call("getLiveStreams", new onGetLiveStreams(), "webcam/_definst_");
}
doGetLiveStreams();
}=20

I have none of the "trace" output, so I assume the onResult event is =
never
called.
Any help would be REALLY appreciated

Thanks

--
Jean-Luc=09




=3D-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
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

Dragonspirit

2005-07-12, 7:45 am

Is it impossible?=20

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de =
Dragonspirit
Envoy=E9 : dimanche 10 juillet 2005 02:59
=C0 : 'FlashComm Mailing List'
Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side

I really need some help (even if it is just a direction to look for !)

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de =
Dragonspirit
Envoy=E9 : mercredi 6 juillet 2005 22:53 =C0 : =
flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Objet : [FlashComm] Trouble with doGetLiveStreams on server side

Hello all,

I'm trying to get all the active live streams on the flash communication
server.
(the function must be invoked on the server side as the =
username/password of
the fcs admin is in the code) and return a random one.
But I'm experiencing troubles to have it work.=20
My code works on the client side but won't work on the server side.=20
Here it is:=20

application.onConnect =3D function (clientObj) {
function doGetLiveStreams() {=20
function onGetLiveStreams() {=20
this.onResult =3D function (info) {=20
if (info.code !=3D "NetConnection.Call.Success")=20
trace ("Call failed: " + info.description);=20
else=20
trace ("Stream: " +
info["data"][Math.round(Math.random()*(info["data"].length-1))]);=20
}=20
}
nc =3D new NetConnection();
nc.connect ("rtmp://www.hoobys-dev.com:1111/admin", "username",
"password");
nc.call("getLiveStreams", new onGetLiveStreams(), "webcam/_definst_");
}
doGetLiveStreams();
}=20

I have none of the "trace" output, so I assume the onResult event is =
never
called.
Any help would be REALLY appreciated

Thanks

--
Jean-Luc=09




=3D-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=3D---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
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

Edward Chan

2005-07-12, 5:45 pm

Try calling nc.call() after you get a NetConnection.Connect.Success =
status back from the connect().

Also, I'm not sure if you intended to do this, but you are not calling =
application.acceptConnection() from your application.onConnect handler.

And you might want to make sure you get something back in the array =
before you try to index it. In other words, make sure =
info["data"].length > 0. Just curious, have you tried just iterating =
the array?

streams =3D info["data"];
for (i=3D0; i<streams.length; i++)
{
trace("stream: " + streams[i]);
}

=20

> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org=20
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of=20
> Dragonspirit
> Sent: Tuesday, July 12, 2005 5:10 AM
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> Is it impossible?=20
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part=20
> de Dragonspirit Envoy=E9 : dimanche 10 juillet 2005 02:59 =C0 :=20
> 'FlashComm Mailing List'
> Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> I really need some help (even if it is just a direction to=20
> look for !)
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part=20
> de Dragonspirit Envoy=E9 : mercredi 6 juillet 2005 22:53 =C0 :=20
> flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org Objet : [FlashComm] Trouble=20
> with doGetLiveStreams on server side
>=20
> Hello all,
>=20
> I'm trying to get all the active live streams on the flash=20
> communication server.
> (the function must be invoked on the server side as the=20
> username/password of the fcs admin is in the code) and return=20
> a random one.
> But I'm experiencing troubles to have it work.=20
> My code works on the client side but won't work on the server side.=20
> Here it is:=20
>=20
> application.onConnect =3D function (clientObj) {
> function doGetLiveStreams() {=20
> function onGetLiveStreams() {=20
> this.onResult =3D function (info) {=20
> if (info.code !=3D "NetConnection.Call.Success")=20
> trace ("Call failed: " + info.description);=20
> else=20
> trace ("Stream: " +
> info["data"][Math.round(Math.random()*(info["data"].length-1))]);=20
> }=20
> }
> nc =3D new NetConnection();
> nc.connect ("rtmp://www.hoobys-dev.com:1111/admin",=20
> "username", "password");
> nc.call("getLiveStreams", new onGetLiveStreams(),=20
> "webcam/_definst_");
> }
> doGetLiveStreams();
> }=20
>=20
> I have none of the "trace" output, so I assume the onResult=20
> event is never called.
> Any help would be REALLY appreciated
>=20
> Thanks
>=20
> --
> Jean-Luc=09
>=20
>=20
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20


=-----------------------------------------------------------
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

Jean-Luc NGUYEN

2005-07-13, 7:45 am

Thanks for your answer.
I added the nc.call and the application.acceptConnection() but it is =
still
the same.
The onResult or onStatus is never called.
Here's the new code:

Server side:
------------
load("components.asc");
application.onConnect =3D function(clientObj){
application.acceptConnection(clientObj);
clientObj.doGetLiveStreams =3D function () {
function onGetLiveStreams() {
this.onResult =3D function (info) {
trace("Entering onResult");
}
this.onStatus =3D function (info) {
trace("Entering onStatus");
}
}
nc =3D new NetConnection();
nc.onStatus =3D function (info) {
trace ("info: " + info.level + " " + info.code);
}
nc.connect ("rtmp://192.168.0.151:1111/admin", "admin",
"admin"); =09
nc.call("getLiveStreams", new onGetLiveStreams(),
"webcam/_definst_"); =09
}
}

Client side:
------------
nc =3D new NetConnection();
nc.connect("rtmp://192.168.0.151/randomstream");
nc.onStatus =3D function (info) {
trace ("info: " + info.level + info.code);
}

nc.call("doGetLiveStreams", null);



I think I must misunderstand how to use the nc.call function on the =
server
side as it doesn't work the same way than on the client-side. If I do =
the
same on the client-side, the doGetLiveStreams.onResult event will be =
called.
Here, I neither have the "Entering onResult" or "Entering onStatus" =
trace.
Did i forget something?

=20

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de Edward =
Chan
Envoy=E9 : mardi 12 juillet 2005 16:43
=C0 : FlashComm Mailing List
Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side

Try calling nc.call() after you get a NetConnection.Connect.Success =
status
back from the connect().

Also, I'm not sure if you intended to do this, but you are not calling
application.acceptConnection() from your application.onConnect handler.

And you might want to make sure you get something back in the array =
before
you try to index it. In other words, make sure info["data"].length > 0.
Just curious, have you tried just iterating the array?

streams =3D info["data"];
for (i=3D0; i<streams.length; i++)
{
trace("stream: " + streams[i]);
}

=20

> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of=20
> Dragonspirit
> Sent: Tuesday, July 12, 2005 5:10 AM
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> Is it impossible?=20
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de=20
> Dragonspirit Envoy=E9 : dimanche 10 juillet 2005 02:59 =C0 :
> 'FlashComm Mailing List'
> Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> I really need some help (even if it is just a direction to look for=20
> !)
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de=20
> Dragonspirit Envoy=E9 : mercredi 6 juillet 2005 22:53 =C0 :
> flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org Objet : [FlashComm] Trouble with=20
> doGetLiveStreams on server side
>=20
> Hello all,
>=20
> I'm trying to get all the active live streams on the flash=20
> communication server.
> (the function must be invoked on the server side as the=20
> username/password of the fcs admin is in the code) and return a random =


> one.
> But I'm experiencing troubles to have it work.=20
> My code works on the client side but won't work on the server side.=20
> Here it is:=20
>=20
> application.onConnect =3D function (clientObj) {
> function doGetLiveStreams() {=20
> function onGetLiveStreams() {=20
> this.onResult =3D function (info) {=20
> if (info.code !=3D "NetConnection.Call.Success")=20
> trace ("Call failed: " + info.description);=20
> else=20
> trace ("Stream: " +
> info["data"][Math.round(Math.random()*(info["data"].length-1))]);=20
> }=20
> }
> nc =3D new NetConnection();
> nc.connect ("rtmp://www.hoobys-dev.com:1111/admin",
> "username", "password");
> nc.call("getLiveStreams", new onGetLiveStreams(),=20
> "webcam/_definst_");
> }
> doGetLiveStreams();
> }
>=20
> I have none of the "trace" output, so I assume the onResult event is=20
> never called.
> Any help would be REALLY appreciated
>=20
> Thanks
>=20
> --
> Jean-Luc=09
>=20
>=20
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20


=3D---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
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

Jean-Luc NGUYEN

2005-07-14, 2:45 am

Maybe, do I have to use the addListener method on the server-side?=20

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de Jean-Luc
NGUYEN
Envoy=E9 : mercredi 13 juillet 2005 13:38
=C0 : 'FlashComm Mailing List'
Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side

Thanks for your answer.
I added the nc.call and the application.acceptConnection() but it is =
still
the same.
The onResult or onStatus is never called.
Here's the new code:

Server side:
------------
load("components.asc");
application.onConnect =3D function(clientObj){
application.acceptConnection(clientObj);
clientObj.doGetLiveStreams =3D function () {
function onGetLiveStreams() {
this.onResult =3D function (info) {
trace("Entering onResult");
}
this.onStatus =3D function (info) {
trace("Entering onStatus");
}
}
nc =3D new NetConnection();
nc.onStatus =3D function (info) {
trace ("info: " + info.level + " " + info.code);
}
nc.connect ("rtmp://192.168.0.151:1111/admin", "admin",
"admin"); =09
nc.call("getLiveStreams", new onGetLiveStreams(),
"webcam/_definst_"); =09
}
}

Client side:
------------
nc =3D new NetConnection();
nc.connect("rtmp://192.168.0.151/randomstream");
nc.onStatus =3D function (info) {
trace ("info: " + info.level + info.code); }

nc.call("doGetLiveStreams", null);



I think I must misunderstand how to use the nc.call function on the =
server
side as it doesn't work the same way than on the client-side. If I do =
the
same on the client-side, the doGetLiveStreams.onResult event will be =
called.
Here, I neither have the "Entering onResult" or "Entering onStatus" =
trace.
Did i forget something?

=20

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de Edward =
Chan
Envoy=E9 : mardi 12 juillet 2005 16:43 =C0 : FlashComm Mailing List =
Objet : RE:
[FlashComm] Trouble with doGetLiveStreams on server side

Try calling nc.call() after you get a NetConnection.Connect.Success =
status
back from the connect().

Also, I'm not sure if you intended to do this, but you are not calling
application.acceptConnection() from your application.onConnect handler.

And you might want to make sure you get something back in the array =
before
you try to index it. In other words, make sure info["data"].length > 0.
Just curious, have you tried just iterating the array?

streams =3D info["data"];
for (i=3D0; i<streams.length; i++)
{
trace("stream: " + streams[i]);
}

=20

> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of=20
> Dragonspirit
> Sent: Tuesday, July 12, 2005 5:10 AM
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> Is it impossible?=20
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de=20
> Dragonspirit Envoy=E9 : dimanche 10 juillet 2005 02:59 =C0 :
> 'FlashComm Mailing List'
> Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> I really need some help (even if it is just a direction to look for
> !)
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de=20
> Dragonspirit Envoy=E9 : mercredi 6 juillet 2005 22:53 =C0 :
> flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org Objet : [FlashComm] Trouble with=20
> doGetLiveStreams on server side
>=20
> Hello all,
>=20
> I'm trying to get all the active live streams on the flash=20
> communication server.
> (the function must be invoked on the server side as the=20
> username/password of the fcs admin is in the code) and return a random =


> one.
> But I'm experiencing troubles to have it work.=20
> My code works on the client side but won't work on the server side.=20
> Here it is:=20
>=20
> application.onConnect =3D function (clientObj) {
> function doGetLiveStreams() {=20
> function onGetLiveStreams() {=20
> this.onResult =3D function (info) {=20
> if (info.code !=3D "NetConnection.Call.Success")=20
> trace ("Call failed: " + info.description);=20
> else=20
> trace ("Stream: " +
> info["data"][Math.round(Math.random()*(info["data"].length-1))]);=20
> }=20
> }
> nc =3D new NetConnection();
> nc.connect ("rtmp://www.hoobys-dev.com:1111/admin",
> "username", "password");
> nc.call("getLiveStreams", new onGetLiveStreams(),=20
> "webcam/_definst_");
> }
> doGetLiveStreams();
> }
>=20
> I have none of the "trace" output, so I assume the onResult event is=20
> never called.
> Any help would be REALLY appreciated
>=20
> Thanks
>=20
> --
> Jean-Luc=09
>=20
>=20
>=20
>=20
> =3D-----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D-----------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20


=3D---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=3D---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
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

Edward Chan

2005-07-14, 2:45 am

Try this:

function onGetLiveStreams()
{
this.onResult =3D function(info)
{
trace(info.code);
if (info.code =3D=3D "NetConnection.Call.Success")
{
for (i=3D0; i<info.data.length; i++)
{
trace("stream: " + info.data[i]);
}
}
}
}

function doGetLiveStreams()
{
application.nc =3D new NetConnection();
application.nc.onStatus =3D function(info)
{
trace(info.code);
if (info.code =3D=3D "NetConnection.Connect.Success")
{
// wait until we're connected to admin before issuing command
application.nc.call("getLiveStreams", new onGetLiveStreams(), =
"webcam/_definst_");
}
}
application.nc.connect("rtmp://192.168.0.151:1111/admin", "admin", =
"admin");
}

application.onConnect =3D function(client)
{
application.acceptConnection(client);
doGetLiveStreams();
}=20

> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org=20
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of=20
> Jean-Luc NGUYEN
> Sent: Wednesday, July 13, 2005 4:38 AM
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> Thanks for your answer.
> I added the nc.call and the application.acceptConnection()=20
> but it is still the same.
> The onResult or onStatus is never called.
> Here's the new code:
>=20
> Server side:
> ------------
> load("components.asc");
> application.onConnect =3D function(clientObj){
> application.acceptConnection(clientObj);
> clientObj.doGetLiveStreams =3D function () {
> function onGetLiveStreams() {
> this.onResult =3D function (info) {
> trace("Entering onResult");
> }
> this.onStatus =3D function (info) {
> trace("Entering onStatus");
> }
> }
> nc =3D new NetConnection();
> nc.onStatus =3D function (info) {
> trace ("info: " + info.level + " " + info.code);
> }
> nc.connect ("rtmp://192.168.0.151:1111/admin", "admin",
> "admin"); =09
> nc.call("getLiveStreams", new onGetLiveStreams(),
> "webcam/_definst_"); =09
> }
> }
>=20
> Client side:
> ------------
> nc =3D new NetConnection();
> nc.connect("rtmp://192.168.0.151/randomstream");
> nc.onStatus =3D function (info) {
> trace ("info: " + info.level + info.code); }
>=20
> nc.call("doGetLiveStreams", null);
>=20
>=20
>=20
> I think I must misunderstand how to use the nc.call function=20
> on the server side as it doesn't work the same way than on=20
> the client-side. If I do the same on the client-side, the=20
> doGetLiveStreams.onResult event will be called.
> Here, I neither have the "Entering onResult" or "Entering=20
> onStatus" trace.
> Did i forget something?
>=20
> =20
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part=20
> de Edward Chan Envoy=E9 : mardi 12 juillet 2005 16:43 =C0 :=20
> FlashComm Mailing List Objet : RE: [FlashComm] Trouble with=20
> doGetLiveStreams on server side
>=20
> Try calling nc.call() after you get a=20
> NetConnection.Connect.Success status back from the connect().
>=20
> Also, I'm not sure if you intended to do this, but you are not calling
> application.acceptConnection() from your=20
> application.onConnect handler.
>=20
> And you might want to make sure you get something back in the=20
> array before you try to index it. In other words, make sure=20
> info["data"].length > 0.
> Just curious, have you tried just iterating the array?
>=20
> streams =3D info["data"];
> for (i=3D0; i<streams.length; i++)
> {
> trace("stream: " + streams[i]);
> }
>=20
> =20
>=20
> server side
> return a random=20
> event is=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20


=-----------------------------------------------------------
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

Jean-Luc NGUYEN

2005-07-15, 5:45 pm

Thanks a lot !
That is exactly what I was trying to do !=20

-----Message d'origine-----
De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de Edward =
Chan
Envoy=E9 : mercredi 13 juillet 2005 17:35
=C0 : FlashComm Mailing List
Objet : RE: [FlashComm] Trouble with doGetLiveStreams on server side

Try this:

function onGetLiveStreams()
{
this.onResult =3D function(info)
{
trace(info.code);
if (info.code =3D=3D "NetConnection.Call.Success")
{
for (i=3D0; i<info.data.length; i++)
{
trace("stream: " + info.data[i]);
}
}
}
}

function doGetLiveStreams()
{
application.nc =3D new NetConnection();
application.nc.onStatus =3D function(info)
{
trace(info.code);
if (info.code =3D=3D "NetConnection.Connect.Success")
{
// wait until we're connected to admin before
issuing command
application.nc.call("getLiveStreams", new
onGetLiveStreams(), "webcam/_definst_");
}
}
application.nc.connect("rtmp://192.168.0.151:1111/admin", "admin",
"admin"); }

application.onConnect =3D function(client) {
application.acceptConnection(client);
doGetLiveStreams();
}=20

> -----Original Message-----
> From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of Jean-Luc =


> NGUYEN
> Sent: Wednesday, July 13, 2005 4:38 AM
> To: 'FlashComm Mailing List'
> Subject: RE: [FlashComm] Trouble with doGetLiveStreams on server side
>=20
> Thanks for your answer.
> I added the nc.call and the application.acceptConnection() but it is=20
> still the same.
> The onResult or onStatus is never called.
> Here's the new code:
>=20
> Server side:
> ------------
> load("components.asc");
> application.onConnect =3D function(clientObj){
> application.acceptConnection(clientObj);
> clientObj.doGetLiveStreams =3D function () {
> function onGetLiveStreams() {
> this.onResult =3D function (info) {
> trace("Entering onResult");
> }
> this.onStatus =3D function (info) {
> trace("Entering onStatus");
> }
> }
> nc =3D new NetConnection();
> nc.onStatus =3D function (info) {
> trace ("info: " + info.level + " " + info.code);
> }
> nc.connect ("rtmp://192.168.0.151:1111/admin", "admin",
> "admin"); =09
> nc.call("getLiveStreams", new onGetLiveStreams(),
> "webcam/_definst_"); =09
> }
> }
>=20
> Client side:
> ------------
> nc =3D new NetConnection();
> nc.connect("rtmp://192.168.0.151/randomstream");
> nc.onStatus =3D function (info) {
> trace ("info: " + info.level + info.code); }
>=20
> nc.call("doGetLiveStreams", null);
>=20
>=20
>=20
> I think I must misunderstand how to use the nc.call function on the=20
> server side as it doesn't work the same way than on the client-side.=20
> If I do the same on the client-side, the doGetLiveStreams.onResult=20
> event will be called.
> Here, I neither have the "Entering onResult" or "Entering onStatus"=20
> trace.
> Did i forget something?
>=20
> =20
>=20
> -----Message d'origine-----
> De : flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
> [mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] De la part de Edward=20
> Chan Envoy=E9 : mardi 12 juillet 2005 16:43 =C0 :
> FlashComm Mailing List Objet : RE: [FlashComm] Trouble with=20
> doGetLiveStreams on server side
>=20
> Try calling nc.call() after you get a NetConnection.Connect.Success=20
> status back from the connect().
>=20
> Also, I'm not sure if you intended to do this, but you are not calling
> application.acceptConnection() from your application.onConnect=20
> handler.
>=20
> And you might want to make sure you get something back in the array=20
> before you try to index it. In other words, make sure=20
> info["data"].length > 0.
> Just curious, have you tried just iterating the array?
>=20
> streams =3D info["data"];
> for (i=3D0; i<streams.length; i++)
> {
> trace("stream: " + streams[i]);
> }
>=20
> =20
>=20
> server side
> return a random
> event is
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20
>=20
>=20
> =3D---------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> =3D---------------------------------------------------------
>=20
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>=20


=3D---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=3D---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm



=-----------------------------------------------------------
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

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com