Setup for spotlight layout refactor

This commit is contained in:
Robert Long 2021-12-21 14:24:47 -08:00
commit fe724783ff

View file

@ -396,12 +396,12 @@ function InRoomView({
const [layout, setLayout] = useVideoGridLayout(); const [layout, setLayout] = useVideoGridLayout();
const items = useMemo(() => { const items = useMemo(() => {
const participants = []; const items = [];
for (const callFeed of userMediaFeeds) { for (const callFeed of userMediaFeeds) {
participants.push({ items.push({
id: callFeed.stream.id, id: callFeed.stream.id,
usermediaCallFeed: callFeed, callFeed,
isActiveSpeaker: isActiveSpeaker:
screenshareFeeds.length === 0 screenshareFeeds.length === 0
? callFeed.userId === activeSpeaker ? callFeed.userId === activeSpeaker
@ -410,16 +410,14 @@ function InRoomView({
} }
for (const callFeed of screenshareFeeds) { for (const callFeed of screenshareFeeds) {
const participant = participants.find( items.push({
(p) => p.usermediaCallFeed.userId === callFeed.userId id: callFeed.stream.id,
); callFeed,
isActiveSpeaker: true,
if (participant) { });
participant.screenshareCallFeed = callFeed;
}
} }
return participants; return items;
}, [userMediaFeeds, activeSpeaker, screenshareFeeds]); }, [userMediaFeeds, activeSpeaker, screenshareFeeds]);
const onFocusTile = useCallback( const onFocusTile = useCallback(