Control over single user's Mic by Moderator

Ask questions about the JavaScript API here

Control over single user's Mic by Moderator

Postby pratikraj » Wed Dec 28, 2011 3:06 am

Hi,
Can anyone tell me how to do control over single subscriber's mic system. Using Session.signal() method it goes to all user. I need for a specific user..
Was this post helpful? (0)
pratikraj
 
Posts: 21
Joined: Thu Dec 08, 2011 5:30 am
Thumbs Up: 0

Re: Control over single user's Mic by Moderator

Postby mumm » Wed Dec 28, 2011 11:44 am

Hi Pratikraj,

There's a few options for doing this.

1) On the client that you want muted, on their publisher object you call publisher.publishAudio(false). This will make it so that nobody can hear that persons audio. Documentation on the publisher here: http://www.tokbox.com/opentok/api/tools ... isher.html.

2) Alternatively, instead of cutting off the audio at the source (the publisher) you can cut off the audio on the receiving end (the subscriber). In that case, if you don't anybody to hear someone, call subscriber.subscribeToAudio(false) on the subscriber that you do not want to hear. Documentation on the subscriber here: http://www.tokbox.com/opentok/api/tools ... riber.html.

What you could do, is have the person you want muted send a signal() to everybody, then look up the connection id on the signal on all the other clients, find the subscriber for that connection, then call subscribeToAudio(false) on that subscriber.

Jon
Was this post helpful? (0)
mumm
 
Posts: 392
Joined: Wed May 18, 2011 12:10 am
Thumbs Up: 28

Re: Control over single user's Mic by Moderator

Postby pratikraj » Wed Dec 28, 2011 11:02 pm

Hi Jon,
Thanks for quick reply..
As described in session.signal there are 3 properties in it
1 fromconnectionId, 2 target, 3 type..
how to pass connection id via session.signal that we could identify the specific user to mute them..
Is there use of target .. If yes then how to use it..
Was this post helpful? (0)
pratikraj
 
Posts: 21
Joined: Thu Dec 08, 2011 5:30 am
Thumbs Up: 0

Re: Control over single user's Mic by Moderator

Postby adam » Thu Dec 29, 2011 4:40 pm

The SignalEvent has a fromConnection property. So you can use event.fromConnection in your signalHandler.

http://www.tokbox.com/opentok/api/tools ... Event.html
Was this post helpful? (0)
adam
 
Posts: 65
Joined: Thu May 05, 2011 8:35 pm
Thumbs Up: 3

Re: Control over single user's Mic by Moderator

Postby adam » Thu Dec 29, 2011 4:44 pm

So the signal method just tells you which user sent the signal. What exactly are you trying to do? Depending on what you are doing the StateManager may be more useful to you than the signal method.

http://www.tokbox.com/opentok/api/tools ... nager.html
Was this post helpful? (0)
adam
 
Posts: 65
Joined: Thu May 05, 2011 8:35 pm
Thumbs Up: 3

Re: Control over single user's Mic by Moderator

Postby pratikraj » Sun Jan 01, 2012 11:19 pm

Thanks Adam,
I have resolved it with db.
Happy new year... :)
Was this post helpful? (0)
pratikraj
 
Posts: 21
Joined: Thu Dec 08, 2011 5:30 am
Thumbs Up: 0


Return to JavaScript



Who is online

Users browsing this forum: No registered users and 1 guest

cron