Setup for spotlight layout refactor

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

View file

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