Setup for spotlight layout refactor
This commit is contained in:
parent
658424efa0
commit
fe724783ff
1 changed files with 9 additions and 11 deletions
20
src/Room.jsx
20
src/Room.jsx
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue