PDA

View Full Version : set variable during onAppStart


Alt-Ox
09-19-2009, 08:23 AM
hello guys

I have a Video On Demand application named MoviesApp with some instances: humor and terror.

In the main.asc file I need to pass a variable (which will be either "humor" or "terror") in order to start playing the videos on that category once the application starts.

application.onAppStart = function(category){
trace (category);
this.clientStream = Stream.get("videoOnDemand");
this.clientStream.play(category, 0, -1);
}


However, itīs not recognizing "category".

But it DOES work when using:

application.onConnect = function(category)

on the client-side, I'm using:
movieNC.connect("rtmp:/MoviesApp/"+category, category);

Any idea on how get it working?
I believe I have to start playing those videos when the application starts cos I want to have the videos playing continuously (like a tv station) and not start from the beginning whenever a user connect.

thanks!

IFZen
09-28-2009, 10:25 AM
Hi Alt-Ox,

I am just a FMS-beginner so I might be completely wrong here.

When you say you want to play the videos continuously it looks like you want to furnish a "live" service where clients subscribe on the fly. So somehow you have to get other clients (may be your server itself) publishing your live streams before other clients can look at them.

If I am right here, it is on your Application.onConnect() that you can decide whether you have a publishing or viewing client coming-in and, in that last case, what type of category it want to stream.

Hope this help,
IFZen