Expand my Community achievements bar.

Detect when a user connects to my WebcamPublisher

Avatar

Level 1

I couldn't find an event that gets fired when someone connects to my subscribed webcam publisher. I can use a sharedobject as a last resort but I'm looking for a clean event. Does anyone know of?

6 Replies

Avatar

Level 1

Hello? Did I not phrase my question adequately?

I have a webcam publisher and I'd like to know when someone subscribes to it

Avatar

Employee

I don't know the answer on the top of my head and our "resident expert" is out of town, back tomorrow. A little patience is appreciated.

Avatar

Level 1

Sorry I re-read my last statement and it did come off as rude. I'll wait...

Avatar

Employee

Hi,

You might have to use a shared Object to achieve the functionality you mentioned

Thanks

Arun

Avatar

Level 1

Aponnusa, are you the resident expert? There is no way to listen or to get the number of currently connected subscribers to a publisher? That's pretty basic funcitonality no?

Avatar

Employee

Hi,

I am a resident trying to be an expert

I agree it is a basic functionality (or may be not). Fundamentally publisher doesnt have to worry about its subscribers, or know the state of subscribers, as long as the subscriber is a valid user who is connected to the room. In other words, in our case, there are no incentives for the publisher to book-keep the number of subscribers it has.

Although not fool proof, one alternative would be using the API AudioPublisher.connectSession.userManager.userCollection.length(this could be buggy if the user is in the room, but is not subscribing to the audio) or controlling your subscribers by setting AudioPublisher.recepientIDs

The other thing you could do is, add a custom property to the UserManager, and update that property (like if he has muted, or listening or unsubscribed from the audio stream). Changing the customProperty would broadcast events, and would help you bookkeep.

Thanks

Arun