This message was deleted.
# helpdesk
s
This message was deleted.
b
Are rooms specific to a number of participants? Or rooms can all have different number of participants when "locked"?
You could always keep the state within the metadata of the room, and simply use the Server SDK to look if the room being requested is in a locked state, to not issue a token and return an error or something. And you could also have a very small TTL to reduce the chances of someone joining if the room is locked with a previous generated token.
f
initially the room starts out with ~2-8 participants, but when it gets into that “lock state”, it becomes just 2 participants. the rest are “kicked” (initially via a friendly data message to the client, but also enforced with a RemoveParticipant) if it’s possible to change the max_participants after room creation, that would definitely work for us! I like the idea of using room metadata but initially wrote it off because there weren’t webhooks for metadata updates and no GetRoom function. but just now reviewing the docs I see ListRooms allows me to pass an array of IDs, so I think that could work as well. we’ll also definitely do short expiry time on the tokens… kind of a no brainer with the refresh mechanism already built-in
b
So right, you can update the room metadata with
updateroommetadata
(https://docs.livekit.io/server/room-management/#updateroommetadata) and that's correct,
ListRooms
allows you to fetch a specific room if you pass it its ID. As for updating the max_participants once the room has been created, I don't think that's possible. One of the LiveKit Team member could probably confirm this.
As a workaround for a webhook for MetaData, you could always have your app listening to data messages and have the Server SDK send a message for your app to act on. These are just ideas, based on the fact that I have no clue how your app is built & used.
f
awesome, thanks Pat! much appreciated. looking at the code I think it’s immutable but could be mistaken, I’m a go newbie I saw setTrackSubscriptionPermissions mentioned in a thread above and think that may be the path to success here. need to do some testing, but if I can get the 2 clients to make their tracks only subscribable by each other, it sort of becomes irrelevant who else is in the room