views:

429

answers:

2

Have a Flex/FMS web meeting app that has multiple custom components - live streaming camera, chat, slide dec.

Each component does its share of communicating through the FMS server. Should all three of those things share one NetConnection object in the application or will the live video stream suffer when users chat or the meeting presenter advances slides and such?

A: 

I think they will suffer but I think you need to build logic to make it as pleasant as possible. E.g. always make sure that the audio steam has the highest priority. There is nothing worse than listening to audio that keeps dropping out. Then give priority to the video. I'm not sure what FMS you're using but you could use a bandwidth meter to detect the current band width and reduce the quality of the video based on that. I think that most people rather see the quality of the video drop than really slow updated frames. I think the slides are the least of your worry. Just make sure than the next slide is loading in the background while you're watching the current one so you don't have to wait long when moving to the next slide.

Luke
A: 

Hmmm... Thanks for the response, but it leaves open the central concern of the post which is more architectural. It's kind of a best practices question.

How many NetConnection objects in the app? Should my camera, slide dec, and chat components (which are separate mxml files linked to the main app file) each have their own NC or should there be one, singleton instance for the app that gets passed to each of those objects? And what are the logistics of passing that NC instance around to the various components. Pass it into constructors? Or call a "setNetConnection(nc)" method on each of the application's individual modules, like this:

chatModule.setNetConnection(nc); slideDecModule.setNetConnection(nc); videoPod.setNetConnection(nc);

Or maybe make the NetConnection object a singleton class and have each application sub module ask it to create one of one doesn't exist or return an instance if one does. Problem with that is where would you make the connection after creating the NC instance. If you make it from, say, the chat component, the connection won't get slide dec, and video pod specific connection initialization actions required by each.

It's really a question of what what to do when you have more than one component that's pushing commands and data to the FMS in an app. Most FMS examples have FMS talking to the main application file in an app. I need the FMS to talk to individual components in my app. Should the communication go directly to the components or should it come back to the main application file and then be distributed to the components from there - kind of acting like a proxy for the individual app sub objects?

As I've thought About it I think the main application file is supposed to create the one NetConnection object for the entire application and all of the application's sub modules are supposed to get a singleton instance of it somehow. Just not sure of the exact coding logistics of that yet.