mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Focus in presentation mode
This commit is contained in:
parent
d5a1952dfb
commit
fe053a11f2
27
src/Room.jsx
27
src/Room.jsx
@ -335,6 +335,31 @@ function InRoomView({
|
||||
return participants;
|
||||
}, [userMediaFeeds, activeSpeaker, screenshareFeeds]);
|
||||
|
||||
const onFocusTile = useCallback(
|
||||
(tiles, focusedTile) => {
|
||||
if (layout === "gallery") {
|
||||
return tiles.map((tile) => {
|
||||
if (tile === focusedTile) {
|
||||
return { ...tile, presenter: !tile.presenter };
|
||||
}
|
||||
|
||||
return tile;
|
||||
});
|
||||
} else {
|
||||
toggleLayout();
|
||||
|
||||
return tiles.map((tile) => {
|
||||
if (tile === focusedTile) {
|
||||
return { ...tile, presenter: true };
|
||||
}
|
||||
|
||||
return { ...tile, presenter: false };
|
||||
});
|
||||
}
|
||||
},
|
||||
[layout, toggleLayout]
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Header>
|
||||
@ -355,7 +380,7 @@ function InRoomView({
|
||||
<p>Waiting for other participants...</p>
|
||||
</div>
|
||||
) : (
|
||||
<VideoGrid items={items} layout={layout} />
|
||||
<VideoGrid items={items} layout={layout} onFocusTile={onFocusTile} />
|
||||
)}
|
||||
<div className={styles.footer}>
|
||||
<DropdownButton
|
||||
|
Loading…
Reference in New Issue
Block a user