From 0144aafee5639e19b85b607f1f24102b88a0b2cb Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 20 Nov 2023 13:33:45 -0500 Subject: [PATCH] Count people as speakers even if there is a presenter --- src/room/InCallView.tsx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index c1d1d164..5e90d2ba 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -489,8 +489,6 @@ function useParticipantTiles( }); const items = useMemo(() => { - const hasPresenter = - sfuParticipants.find((p) => p.isScreenShareEnabled) !== undefined; let allGhosts = true; const speakActiveTime = new Date(); @@ -498,10 +496,9 @@ function useParticipantTiles( // Iterate over SFU participants (those who actually are present from the SFU perspective) and create tiles for them. const tiles: TileDescriptor[] = sfuParticipants.flatMap( (sfuParticipant) => { - const hadSpokedInTime = - !hasPresenter && sfuParticipant.lastSpokeAt - ? sfuParticipant.lastSpokeAt > speakActiveTime - : false; + const spokeRecently = + sfuParticipant.lastSpokeAt !== undefined && + sfuParticipant.lastSpokeAt > speakActiveTime; const id = sfuParticipant.identity; const member = findMatrixMember(matrixRoom, id); @@ -519,7 +516,7 @@ function useParticipantTiles( focused: false, isPresenter: sfuParticipant.isScreenShareEnabled, isSpeaker: - (sfuParticipant.isSpeaking || hadSpokedInTime) && + (sfuParticipant.isSpeaking || spokeRecently) && !sfuParticipant.isLocal, hasVideo: sfuParticipant.isCameraEnabled, local: sfuParticipant.isLocal,