mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-27 18:56:58 +00:00
✨(perf) hide main layout when pip is open
avoid rendering main video tiles while pip is active
This commit is contained in:
@@ -35,6 +35,7 @@ import { useVideoResolutionSubscription } from '../hooks/useVideoResolutionSubsc
|
|||||||
import { SettingsDialogProvider } from '@/features/settings/components/SettingsDialogProvider'
|
import { SettingsDialogProvider } from '@/features/settings/components/SettingsDialogProvider'
|
||||||
import { IsIdleDisconnectModal } from '../components/IsIdleDisconnectModal'
|
import { IsIdleDisconnectModal } from '../components/IsIdleDisconnectModal'
|
||||||
import { RoomPiP } from '@/features/pip/components/RoomPiP'
|
import { RoomPiP } from '@/features/pip/components/RoomPiP'
|
||||||
|
import { useRoomPiP } from '@/features/pip/hooks/useRoomPiP'
|
||||||
import { getParticipantName } from '@/features/rooms/utils/getParticipantName'
|
import { getParticipantName } from '@/features/rooms/utils/getParticipantName'
|
||||||
import { useScreenReaderAnnounce } from '@/hooks/useScreenReaderAnnounce'
|
import { useScreenReaderAnnounce } from '@/hooks/useScreenReaderAnnounce'
|
||||||
import { ReactionPortals } from '@/features/reactions/components/ReactionPortals'
|
import { ReactionPortals } from '@/features/reactions/components/ReactionPortals'
|
||||||
@@ -228,6 +229,9 @@ export function VideoConference({ ...props }: VideoConferenceProps) {
|
|||||||
])
|
])
|
||||||
/* eslint-enable react-hooks/exhaustive-deps */
|
/* eslint-enable react-hooks/exhaustive-deps */
|
||||||
|
|
||||||
|
const { isOpen: isPiPOpen } = useRoomPiP()
|
||||||
|
const shouldRenderMainLayout = !isPiPOpen
|
||||||
|
|
||||||
const [isShareErrorVisible, setIsShareErrorVisible] = useState(false)
|
const [isShareErrorVisible, setIsShareErrorVisible] = useState(false)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -249,32 +253,36 @@ export function VideoConference({ ...props }: VideoConferenceProps) {
|
|||||||
/>
|
/>
|
||||||
<IsIdleDisconnectModal />
|
<IsIdleDisconnectModal />
|
||||||
<RoomContentArea>
|
<RoomContentArea>
|
||||||
{!focusTrack ? (
|
{shouldRenderMainLayout && (
|
||||||
<div
|
<>
|
||||||
className="lk-grid-layout-wrapper"
|
{!focusTrack ? (
|
||||||
style={{ height: 'auto' }}
|
<div
|
||||||
>
|
className="lk-grid-layout-wrapper"
|
||||||
<GridLayout tracks={tracks} style={{ padding: 0 }}>
|
style={{ height: 'auto' }}
|
||||||
<ParticipantTile />
|
|
||||||
</GridLayout>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<div
|
|
||||||
className="lk-focus-layout-wrapper"
|
|
||||||
style={{ height: 'auto' }}
|
|
||||||
>
|
|
||||||
<FocusLayoutContainer style={{ padding: 0 }}>
|
|
||||||
<CarouselLayout
|
|
||||||
tracks={carouselTracks}
|
|
||||||
style={{
|
|
||||||
minWidth: '200px',
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<ParticipantTile />
|
<GridLayout tracks={tracks} style={{ padding: 0 }}>
|
||||||
</CarouselLayout>
|
<ParticipantTile />
|
||||||
{focusTrack && <FocusLayout trackRef={focusTrack} />}
|
</GridLayout>
|
||||||
</FocusLayoutContainer>
|
</div>
|
||||||
</div>
|
) : (
|
||||||
|
<div
|
||||||
|
className="lk-focus-layout-wrapper"
|
||||||
|
style={{ height: 'auto' }}
|
||||||
|
>
|
||||||
|
<FocusLayoutContainer style={{ padding: 0 }}>
|
||||||
|
<CarouselLayout
|
||||||
|
tracks={carouselTracks}
|
||||||
|
style={{
|
||||||
|
minWidth: '200px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<ParticipantTile />
|
||||||
|
</CarouselLayout>
|
||||||
|
{focusTrack && <FocusLayout trackRef={focusTrack} />}
|
||||||
|
</FocusLayoutContainer>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
</RoomContentArea>
|
</RoomContentArea>
|
||||||
<ControlBar
|
<ControlBar
|
||||||
|
|||||||
Reference in New Issue
Block a user