westonsoftware / vue-webrtc

WebRTC video component for Vue.js
MIT License
365 stars 127 forks source link

How to ban (make a specific user to leave from the room) a user...? #28

Closed KLA6 closed 4 years ago

KLA6 commented 4 years ago

First of all, I always appreciate for your great works.

I have a question that...

Is there any method which makes a user (not me) to leave from the connection...?

Something like...

this.$refs.webrtc.leave( [ videoList.key ] )

I've tried to analyse this.$refs.webrtc, but I couldn't find the way.

westonsoftware commented 4 years ago

There are no methods to manage users here.
I would look at this API ... https://www.rtcmulticonnection.org/docs to add that functionality.

KLA6 commented 4 years ago

Thank you for your response, and I'm leaving a memo for someone like me in the future.

I've just realized this.$refs.webrtc includes rtcmConnection object.

So, I've made "ban" as below.

this.$refs.webrtc.rtcmConnection.disconnectWith(
  this.$refs.webrtc.rtcmConnection.getAllParticipants()[ 0 ]
)

In the above, array index 0 means the index of the user. E.g. myself has no index, first comer has index as 0.

The original API guide is in here. >>> https://www.rtcmulticonnection.org/docs/disconnectWith/