mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
Large video was being updated through scheduleLargeVideoUpdate even when the large video container was hidden via CSS. This occurred in multiple layout modes: tile view, stage filmstrip (with 2+ participants), and etherpad editing. These updates caused expensive operations including setting video streams, managing track listeners, updating avatars, and running show/hide animations - all wasted CPU cycles since the container wasn't visible. The fix introduces a centralized shouldHideLargeVideo() function that checks all cases where the large video container is hidden. This function is used in selectParticipantInLargeVideo() to guard to not update the participant id. A state listener monitors transitions from hidden to visible states and ensures the large video participant id is properly updated when the container becomes visible again and set to undefined when large video is hidden. This improves performance by eliminating unnecessary video element manipulation and handler execution across all layout modes where large video is not displayed.