Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Revert "fix(large-video): Prevents unnecessary updates when container is hidden"
Hristo Terezovdad4fb9e0692
diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex 6e75816dee..143be3df78 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -158,11 +158,10 @@ const VideoLayout = {return;}-- const state = APP.store.getState();const currentContainer = largeVideo.getCurrentContainer();const currentContainerType = largeVideo.getCurrentContainerType();const isOnLarge = this.isCurrentlyOnLarge(id);+ const state = APP.store.getState();const participant = getParticipantById(state, id);const videoTrack = getVideoTrackByParticipant(state, participant);const videoStream = videoTrack?.jitsiTrack;diff --git a/react/features/large-video/actions.any.ts b/react/features/large-video/actions.any.tsindex 9df86ad595..0c0a2d04c2 100644--- a/react/features/large-video/actions.any.ts+++ b/react/features/large-video/actions.any.ts@@ -11,6 +11,7 @@ import {getVirtualScreenshareParticipantByOwnerId} from '../base/participants/functions';import { toState } from '../base/redux/functions';+import { isStageFilmstripAvailable } from '../filmstrip/functions';import { getAutoPinSetting } from '../video-layout/functions';import {@@ -18,7 +19,6 @@ import {SET_LARGE_VIDEO_DIMENSIONS,UPDATE_KNOWN_LARGE_VIDEO_RESOLUTION} from './actionTypes';-import { shouldHideLargeVideo } from './functions';/*** Action to select the participant to be displayed in LargeVideo based on the@@ -34,8 +34,12 @@ export function selectParticipantInLargeVideo(participant?: string) {return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {const state = getState();- // Skip large video updates when the large video container is hidden.- if (shouldHideLargeVideo(state)) {+ if (isStageFilmstripAvailable(state, 2)) {+ return;+ }++ // Keep Etherpad open.+ if (state['features/etherpad'].editing) {return;}diff --git a/react/features/large-video/functions.ts b/react/features/large-video/functions.tsindex 391bc961af..e326585111 100644--- a/react/features/large-video/functions.ts+++ b/react/features/large-video/functions.ts@@ -1,7 +1,5 @@import { IReduxState } from '../app/types';import { getParticipantById } from '../base/participants/functions';-import { isStageFilmstripAvailable } from '../filmstrip/functions';-import { shouldDisplayTileView } from '../video-layout/functions.any';/*** Selector for the participant currently displaying on the large video.@@ -14,17 +12,3 @@ export function getLargeVideoParticipant(state: IReduxState) {return getParticipantById(state, participantId ?? '');}--/**- * Determines whether the large video container should be hidden.- * Large video is hidden in tile view, stage filmstrip mode (with multiple participants),- * or when editing etherpad.- *- * @param {IReduxState} state - The Redux state.- * @returns {boolean} True if large video should be hidden, false otherwise.- */-export function shouldHideLargeVideo(state: IReduxState): boolean {- return shouldDisplayTileView(state)- || isStageFilmstripAvailable(state, 2)- || Boolean(state['features/etherpad']?.editing);-}diff --git a/react/features/large-video/subscriber.any.ts b/react/features/large-video/subscriber.any.tsdeleted file mode 100644index 75145f527a..0000000000--- a/react/features/large-video/subscriber.any.ts+++ /dev/null@@ -1,26 +0,0 @@-import StateListenerRegistry from '../base/redux/StateListenerRegistry';--import { SELECT_LARGE_VIDEO_PARTICIPANT } from './actionTypes';-import { selectParticipantInLargeVideo } from './actions.any';-import { shouldHideLargeVideo } from './functions';--/**- * Updates the large video when transitioning from a hidden state to visible state.- * This ensures the large video is properly updated when exiting tile view, stage filmstrip,- * whiteboard, or etherpad editing modes.- */-StateListenerRegistry.register(- /* selector */ state => shouldHideLargeVideo(state),- /* listener */ (isHidden, { dispatch }) => {- // When transitioning from hidden to visible state, select participant (because currently it is undefined).- // Otherwise set it to undefined because we don't show the large video.- if (!isHidden) {- dispatch(selectParticipantInLargeVideo());- } else {- dispatch({- type: SELECT_LARGE_VIDEO_PARTICIPANT,- participantId: undefined- });- }- }-);diff --git a/react/features/large-video/subscriber.native.ts b/react/features/large-video/subscriber.native.tsindex 42c4cc5107..e69de29bb2 100644--- a/react/features/large-video/subscriber.native.ts+++ b/react/features/large-video/subscriber.native.ts@@ -1 +0,0 @@-import './subscriber.any';diff --git a/react/features/large-video/subscriber.web.ts b/react/features/large-video/subscriber.web.tsindex 9fdf1006fe..f165b7cbdd 100644--- a/react/features/large-video/subscriber.web.ts+++ b/react/features/large-video/subscriber.web.ts@@ -4,7 +4,6 @@ import StateListenerRegistry from '../base/redux/StateListenerRegistry';import { getVideoTrackByParticipant } from '../base/tracks/functions.web';import { getLargeVideoParticipant } from './functions';-import './subscriber.any';/*** Updates the on stage participant video.diff --git a/tests/pageobjects/Filmstrip.ts b/tests/pageobjects/Filmstrip.tsindex 1760ed5a9f..252936c76a 100644--- a/tests/pageobjects/Filmstrip.ts+++ b/tests/pageobjects/Filmstrip.ts@@ -124,20 +124,6 @@ export default class Filmstrip extends BasePageObject {return await elem.isExisting() ? await elem.getAttribute('src') : null;}- /**- * Returns true if the endpoint is dominant speaker and false otherwise.- * Uses the dominant-speaker class on the video thumbnail in order to check.- *- * @param {string} endpointId - The endpoint id of the participant we want to check.- * @returns {boolean} - True if the endpoint is dominant speaker and false otherwise.- */- async isDominantSpeaker(endpointId: string) {- const elem = this.participant.driver.$(- `//span[@id='participant_${endpointId}' and contains(@class,'dominant-speaker')]`);-- return await elem.isExisting();- }-/*** Grants moderator rights to a participant.* @param participantdiff --git a/tests/specs/media/activeSpeaker.spec.ts b/tests/specs/media/activeSpeaker.spec.tsindex 2e544ab712..8a59fe2cb2 100644--- a/tests/specs/media/activeSpeaker.spec.ts+++ b/tests/specs/media/activeSpeaker.spec.ts@@ -66,10 +66,10 @@ async function testActiveSpeaker(const otherParticipant1Driver = otherParticipant1.driver;await otherParticipant1Driver.waitUntil(- async () => await otherParticipant1.getFilmstrip().isDominantSpeaker(speakerEndpoint),+ async () => await otherParticipant1.getLargeVideo().getResource() === speakerEndpoint,{timeout: 30_000, // 30 seconds- timeoutMsg: `${activeSpeaker.name} is not selected as active speaker.`+ timeoutMsg: 'Active speaker not displayed on large video.'});// just a debug print to go in logsdiff --git a/tests/specs/media/codecSelection.spec.ts b/tests/specs/media/codecSelection.spec.tsindex c118397e9e..0b890abdce 100644--- a/tests/specs/media/codecSelection.spec.ts+++ b/tests/specs/media/codecSelection.spec.ts@@ -49,7 +49,6 @@ describe('Codec selection', () => {it('asymmetric codecs with AV1', async () => {await ensureThreeParticipants({configOverwrite: {- disableTileView: true,videoQuality: {codecPreferenceOrder: [ 'AV1', 'VP9', 'VP8' ]}@@ -99,7 +98,6 @@ describe('Codec selection', () => {await ensureThreeParticipants({configOverwrite: {- disableTileView: true,videoQuality: {codecPreferenceOrder: [ 'VP8' ]}