How can I kick a specific subscriber or all subscribers in a videoroom?

214 views
Skip to first unread message

Burak Senyuva

unread,
Mar 17, 2020, 9:06:45 PM3/17/20
to meetecho-janus
Hi,

I want to kick subscriber(s) (they are not publishers) remotely.
  1. I can't do that via forcing client side to call 'leave' due to possible browser javascript forgery.
  2. I don't prefer to make them report their sessionId/handleId (to call leave on behalf of them) on subscribe for same reason.
  3. I can't do that using kick because they don't have any unique id.
  4. I can't relate their sessionid, handleId with my users because there is no id, opaque_id in subscribed event.
What do you suggest?
Is it possible to add ids to subscribers as publishers to use kick on them?


Lorenzo Miniero

unread,
Mar 18, 2020, 5:30:39 AM3/18/20
to meetecho-janus
Configure rooms with require_pvtid=true: this will force subscribers to create a unique ID (join as publisher, without actually publishing media) in order to use a private_id to create subscriptions, meaning you'll be able to kick them.

L.

Burak Senyuva

unread,
Mar 18, 2020, 10:46:12 AM3/18/20
to meetecho-janus
In this case subscribers will be able to publish media if the tinker janus videoroom api via browser console?

Lorenzo Miniero

unread,
Mar 18, 2020, 12:48:29 PM3/18/20
to meetecho-janus
They would be able to do it anyway: nothing in the VideoRoom prevents people from creating a handle as a potential publisher.

L.

Lorenzo Miniero

unread,
Mar 18, 2020, 12:49:32 PM3/18/20
to meetecho-janus
If you need more control, you should implement a controller that talks to Janus on the server side, and exposes a different API to end users: this way you'd have complete control over who's who, and who can do what (since your server would be the only one sending messages to Janus).

Ju Ju

unread,
Mar 19, 2020, 5:43:09 AM3/19/20
to meetecho-janus
maybe you could use the streaming plugin instead to prevents viewer to share anything (depends why you wanna kick viewer at the beginning) ?


Burak Senyuva

unread,
Mar 19, 2020, 3:02:49 PM3/19/20
to meetecho-janus
@Lorenzo I agree it's the best solution when you have additional time to accomplish that :) Is it possible to add opaque_id to all videoroom events even if user is subscriber but not publisher?

@Ju Ju Actually my first solution was based on videoroom + streaming plugins. I've already created infrastructure for that. In my case there will be many rooms. I'm able to manage rtp forward ports using nodejs but I'm getting cannot bind errors for streaming plugin specially if those plugins works on same server. There is a port range setting for janus.jcfg, also for streaming plugin config but not for videoroom plugin. It would be great if I define different port ranges for different plugins.

Lorenzo Miniero

unread,
Mar 20, 2020, 4:03:42 AM3/20/20
to meetecho-janus
Why would the VideoRoom plugin need port ranges?

L.

Burak Senyuva

unread,
Mar 20, 2020, 5:02:34 AM3/20/20
to meetecho-janus
In my case, I'm forwarding videoroom stream to streaming plugin + ffmpeg (requires 8 udp ports per videoroom) which runs in the same instance of janus. I've full control on forwarders ports due to streaming plugin config + nodejs code. I can set same port range for my forwarder port generator code. But I've no control on videoroom ports, I don't now it's boundaries. Need to create more complex mechanism for choosing forwarder ports like decide first, check is in use, redecide if in use, check again and so on...
Reply all
Reply to author
Forward
0 new messages