From 5bd0ae7133c8598d41edc5a3bd8f726afd1c4e37 Mon Sep 17 00:00:00 2001 From: Robert Long Date: Thu, 14 Oct 2021 17:24:42 -0700 Subject: [PATCH] Focus screenshare tiles automatically --- src/Room.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Room.jsx b/src/Room.jsx index e935841e..dc663894 100644 --- a/src/Room.jsx +++ b/src/Room.jsx @@ -313,6 +313,12 @@ function InRoomView({ setVideoInput, } = useMediaHandler(client); + useEffect(() => { + if (screenshareFeeds.length > 0 && layout === "gallery") { + toggleLayout(); + } + }, [screenshareFeeds]); + const items = useMemo(() => { const participants = []; @@ -320,7 +326,10 @@ function InRoomView({ participants.push({ id: callFeed.userId, callFeed, - isActiveSpeaker: callFeed.userId === activeSpeaker, + isActiveSpeaker: + screenshareFeeds.length === 0 + ? callFeed.userId === activeSpeaker + : false, }); } @@ -328,7 +337,7 @@ function InRoomView({ participants.push({ id: callFeed.userId + "-screenshare", callFeed, - isActiveSpeaker: callFeed.userId === activeSpeaker, + isActiveSpeaker: true, }); }