Focus screenshare tiles automatically

This commit is contained in:
Robert Long
2021-10-14 17:24:42 -07:00
parent fe053a11f2
commit 5bd0ae7133

View File

@@ -313,6 +313,12 @@ function InRoomView({
setVideoInput, setVideoInput,
} = useMediaHandler(client); } = useMediaHandler(client);
useEffect(() => {
if (screenshareFeeds.length > 0 && layout === "gallery") {
toggleLayout();
}
}, [screenshareFeeds]);
const items = useMemo(() => { const items = useMemo(() => {
const participants = []; const participants = [];
@@ -320,7 +326,10 @@ function InRoomView({
participants.push({ participants.push({
id: callFeed.userId, id: callFeed.userId,
callFeed, callFeed,
isActiveSpeaker: callFeed.userId === activeSpeaker, isActiveSpeaker:
screenshareFeeds.length === 0
? callFeed.userId === activeSpeaker
: false,
}); });
} }
@@ -328,7 +337,7 @@ function InRoomView({
participants.push({ participants.push({
id: callFeed.userId + "-screenshare", id: callFeed.userId + "-screenshare",
callFeed, callFeed,
isActiveSpeaker: callFeed.userId === activeSpeaker, isActiveSpeaker: true,
}); });
} }