jromero2 commited on
Commit
9f5c0c8
1 Parent(s): 0eb3046

Fix: add the allow_speaker function back

Browse files

Seems like in the last commit this function was deleted but was still being referenced later in the code and that is messing up the demo. I am not entirely sure if the goal of the last commit was to completely get rid of it, but it seems that the reference wasn't deleted so I just added it back.

Files changed (1) hide show
  1. seamless_server/app_pubsub.py +7 -0
seamless_server/app_pubsub.py CHANGED
@@ -558,6 +558,13 @@ async def join_room(sid, client_id, room_id_from_client, config_dict):
558
 
559
  return {"roomsJoined": sio.rooms(sid), "roomID": room_id}
560
 
 
 
 
 
 
 
 
561
  def check_and_lock_single_user(client_id, member):
562
  global server_lock
563
 
 
558
 
559
  return {"roomsJoined": sio.rooms(sid), "roomID": room_id}
560
 
561
+ def allow_speaker(room, client_id):
562
+ if MAX_SPEAKERS is not None and client_id in room.speakers:
563
+ room_statuses = {room_id: room.get_room_status_dict() for room_id, room in rooms.items()}
564
+ speakers = sum(room_status["activeTranscoders"] for room_status in room_statuses.values())
565
+ return speakers < int(MAX_SPEAKERS)
566
+ return True
567
+
568
  def check_and_lock_single_user(client_id, member):
569
  global server_lock
570