Hide controls completely in picture-in-picture view
This is to prepare for upcoming design changes to the picture-in-picture view in Element Web.
This commit is contained in:
parent
f9845617b3
commit
102ce87bb0
1 changed files with 42 additions and 28 deletions
|
@ -246,22 +246,23 @@ export function InCallView({
|
||||||
return tileDescriptors;
|
return tileDescriptors;
|
||||||
}, [client, participants, userMediaFeeds, activeSpeaker, screenshareFeeds]);
|
}, [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
|
// The maximised participant: either the participant that the user has
|
||||||
// manually put in fullscreen, or the focused (active) participant if the
|
// manually put in fullscreen, or the focused (active) participant if the
|
||||||
// window is too small to show everyone
|
// window is too small to show everyone
|
||||||
const maximisedParticipant = useMemo(
|
const maximisedParticipant = useMemo(
|
||||||
() =>
|
() =>
|
||||||
fullscreenParticipant ??
|
fullscreenParticipant ??
|
||||||
(boundsValid && bounds.height <= 400 && bounds.width <= 400
|
(noControls
|
||||||
? items.find((item) => item.focused) ??
|
? items.find((item) => item.focused) ??
|
||||||
items.find((item) => item.callFeed) ??
|
items.find((item) => item.callFeed) ??
|
||||||
null
|
null
|
||||||
: null),
|
: null),
|
||||||
[fullscreenParticipant, boundsValid, bounds, items]
|
[fullscreenParticipant, noControls, items]
|
||||||
);
|
);
|
||||||
|
|
||||||
const reducedControls = boundsValid && bounds.width <= 400;
|
|
||||||
|
|
||||||
const renderAvatar = useCallback(
|
const renderAvatar = useCallback(
|
||||||
(roomMember: RoomMember, width: number, height: number) => {
|
(roomMember: RoomMember, width: number, height: number) => {
|
||||||
const avatarUrl = roomMember.getMxcAvatarUrl();
|
const avatarUrl = roomMember.getMxcAvatarUrl();
|
||||||
|
@ -347,6 +348,42 @@ export function InCallView({
|
||||||
[styles.maximised]: maximisedParticipant,
|
[styles.maximised]: maximisedParticipant,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let footer: JSX.Element | null;
|
||||||
|
|
||||||
|
if (noControls) {
|
||||||
|
footer = null;
|
||||||
|
} else if (reducedControls) {
|
||||||
|
footer = (
|
||||||
|
<div className={styles.footer}>
|
||||||
|
<MicButton muted={microphoneMuted} onPress={toggleMicrophoneMuted} />
|
||||||
|
<VideoButton muted={localVideoMuted} onPress={toggleLocalVideoMuted} />
|
||||||
|
<HangupButton onPress={onLeave} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
footer = (
|
||||||
|
<div className={styles.footer}>
|
||||||
|
<MicButton muted={microphoneMuted} onPress={toggleMicrophoneMuted} />
|
||||||
|
<VideoButton muted={localVideoMuted} onPress={toggleLocalVideoMuted} />
|
||||||
|
{canScreenshare && !hideScreensharing && !isSafari && (
|
||||||
|
<ScreenshareButton
|
||||||
|
enabled={isScreensharing}
|
||||||
|
onPress={toggleScreensharing}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
<OverflowMenu
|
||||||
|
inCall
|
||||||
|
roomIdOrAlias={roomIdOrAlias}
|
||||||
|
groupCall={groupCall}
|
||||||
|
showInvite={joinRule === JoinRule.Public}
|
||||||
|
feedbackModalState={feedbackModalState}
|
||||||
|
feedbackModalProps={feedbackModalProps}
|
||||||
|
/>
|
||||||
|
<HangupButton onPress={onLeave} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={containerClasses} ref={containerRef}>
|
<div className={containerClasses} ref={containerRef}>
|
||||||
<audio ref={audioRef} />
|
<audio ref={audioRef} />
|
||||||
|
@ -373,30 +410,7 @@ export function InCallView({
|
||||||
</Header>
|
</Header>
|
||||||
)}
|
)}
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
<div className={styles.footer}>
|
{footer}
|
||||||
<MicButton muted={microphoneMuted} onPress={toggleMicrophoneMuted} />
|
|
||||||
<VideoButton muted={localVideoMuted} onPress={toggleLocalVideoMuted} />
|
|
||||||
{canScreenshare &&
|
|
||||||
!hideScreensharing &&
|
|
||||||
!isSafari &&
|
|
||||||
!reducedControls && (
|
|
||||||
<ScreenshareButton
|
|
||||||
enabled={isScreensharing}
|
|
||||||
onPress={toggleScreensharing}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{!reducedControls && (
|
|
||||||
<OverflowMenu
|
|
||||||
inCall
|
|
||||||
roomIdOrAlias={roomIdOrAlias}
|
|
||||||
groupCall={groupCall}
|
|
||||||
showInvite={joinRule === JoinRule.Public}
|
|
||||||
feedbackModalState={feedbackModalState}
|
|
||||||
feedbackModalProps={feedbackModalProps}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
<HangupButton onPress={onLeave} />
|
|
||||||
</div>
|
|
||||||
<GroupCallInspector
|
<GroupCallInspector
|
||||||
client={client}
|
client={client}
|
||||||
groupCall={groupCall}
|
groupCall={groupCall}
|
||||||
|
|
Loading…
Add table
Reference in a new issue