diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 431d8b0..8f8dc6c 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -246,22 +246,23 @@ export function InCallView({ return tileDescriptors; }, [client, participants, userMediaFeeds, activeSpeaker, screenshareFeeds]); + const reducedControls = boundsValid && bounds.width <= 400; + const noControls = reducedControls && bounds.height <= 400; + // The maximised participant: either the participant that the user has // manually put in fullscreen, or the focused (active) participant if the // window is too small to show everyone const maximisedParticipant = useMemo( () => fullscreenParticipant ?? - (boundsValid && bounds.height <= 400 && bounds.width <= 400 + (noControls ? items.find((item) => item.focused) ?? items.find((item) => item.callFeed) ?? null : null), - [fullscreenParticipant, boundsValid, bounds, items] + [fullscreenParticipant, noControls, items] ); - const reducedControls = boundsValid && bounds.width <= 400; - const renderAvatar = useCallback( (roomMember: RoomMember, width: number, height: number) => { const avatarUrl = roomMember.getMxcAvatarUrl(); @@ -347,6 +348,42 @@ export function InCallView({ [styles.maximised]: maximisedParticipant, }); + let footer: JSX.Element | null; + + if (noControls) { + footer = null; + } else if (reducedControls) { + footer = ( +