Close room and kick all participants?

What is the best approach in closing a room and kick all the participants?

There is currently no API to close a room and kick all participants. There is however an ongoing discussion about how to achieve something similar in another thread:

1 Like

While waiting for this, I make a temporary “close conference” function by kicking all the participant first in a loop then I route to home page.

1 Like

I asked a somewhat related question recently. I took the suggestion in that thread and simply sent a command to all participants to leave the conference. I didn’t necessarily want to disconnect them, but that could be done just as easily. I don’t know if it will suit your needs, but I thought I’d mention it.

Can you please share your function here, specially how to remove a participant? Thanks

I would imagine you simply loop through the participants and invoke the kickParticipant() method for each.

I already revised my code and use room.sendCommandOnce in conference.js
room.addCommandListener for the command listener