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
fix(large-video) Update large-video when the streamingStatus of the attached track changes. This fixes an issue where screenshare appears on the thumbnail but not on the large-video.
Jaya Allamsetty01001d643853
diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.jsindex f5c9e528f0..9e3e6af3d2 100644--- a/modules/UI/videolayout/VideoLayout.js+++ b/modules/UI/videolayout/VideoLayout.js@@ -2,7 +2,7 @@import Logger from '@jitsi/logger';-import { getSourceNameSignalingFeatureFlag } from '../../../react/features/base/config';+import { getMultipleVideoSupportFeatureFlag } from '../../../react/features/base/config';import { MEDIA_TYPE, VIDEO_TYPE } from '../../../react/features/base/media';import {getPinnedParticipant,@@ -95,7 +95,7 @@ const VideoLayout = {return VIDEO_TYPE.CAMERA;}- if (getSourceNameSignalingFeatureFlag(state) && participant?.isVirtualScreenshareParticipant) {+ if (getMultipleVideoSupportFeatureFlag(state) && participant?.isVirtualScreenshareParticipant) {return VIDEO_TYPE.DESKTOP;}@@ -190,7 +190,7 @@ const VideoLayout = {let videoTrack;- if (getSourceNameSignalingFeatureFlag(state) && participant?.isVirtualScreenshareParticipant) {+ if (getMultipleVideoSupportFeatureFlag(state) && participant?.isVirtualScreenshareParticipant) {videoTrack = getVirtualScreenshareParticipantTrack(tracks, id);} else {videoTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);@@ -218,7 +218,6 @@ const VideoLayout = {if (!isOnLarge || forceUpdate) {const videoType = this.getRemoteVideoType(id);-largeVideo.updateLargeVideo(id,videoStream,diff --git a/react/features/large-video/components/LargeVideo.web.js b/react/features/large-video/components/LargeVideo.web.jsindex fd29fd7dfb..cfec64fc13 100644--- a/react/features/large-video/components/LargeVideo.web.js+++ b/react/features/large-video/components/LargeVideo.web.js@@ -3,10 +3,12 @@import React, { Component } from 'react';import VideoLayout from '../../../../modules/UI/videolayout/VideoLayout';+import { getMultipleVideoSupportFeatureFlag } from '../../base/config';+import { MEDIA_TYPE, VIDEO_TYPE } from '../../base/media';import { getLocalParticipant } from '../../base/participants';import { Watermarks } from '../../base/react';import { connect } from '../../base/redux';-import { getVideoTrackByParticipant } from '../../base/tracks';+import { getTrackByMediaTypeAndParticipant, getVirtualScreenshareParticipantTrack } from '../../base/tracks';import { setColorAlpha } from '../../base/util';import { StageParticipantNameLabel } from '../../display-name';import { FILMSTRIP_BREAKPOINT, isFilmstripResizable } from '../../filmstrip';@@ -80,10 +82,10 @@ type Props = {*/_largeVideoParticipantId: string,- /**- * Whether or not the screen sharing is on.+ /**+ * Whether or not the local screen share is on large-video.*/- _isScreenSharing: boolean,+ _isScreenSharing: boolean,/*** Whether or not the screen sharing is visible.@@ -326,16 +328,22 @@ function _mapStateToProps(state) {const tracks = state['features/base/tracks'];const localParticipantId = getLocalParticipant(state)?.id;const largeVideoParticipant = getLargeVideoParticipant(state);- const videoTrack = getVideoTrackByParticipant(tracks, largeVideoParticipant);- const localParticipantisSharingTheScreen = largeVideoParticipant?.id?.includes(localParticipantId);- const isScreenSharing = localParticipantisSharingTheScreen && videoTrack?.videoType === 'desktop';+ let videoTrack;++ if (getMultipleVideoSupportFeatureFlag(state) && largeVideoParticipant?.isVirtualScreenshareParticipant) {+ videoTrack = getVirtualScreenshareParticipantTrack(tracks, largeVideoParticipant?.id);+ } else {+ videoTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, largeVideoParticipant?.id);+ }+ const isLocalScreenshareOnLargeVideo = largeVideoParticipant?.id?.includes(localParticipantId)+ && videoTrack?.videoType === VIDEO_TYPE.DESKTOP;return {_backgroundAlpha: state['features/base/config'].backgroundAlpha,_customBackgroundColor: backgroundColor,_customBackgroundImageUrl: backgroundImageUrl,_isChatOpen: isChatOpen,- _isScreenSharing: isScreenSharing,+ _isScreenSharing: isLocalScreenshareOnLargeVideo,_largeVideoParticipantId: largeVideoParticipant?.id,_noAutoPlayVideo: testingConfig?.noAutoPlayVideo,_resizableFilmstrip: isFilmstripResizable(state),diff --git a/react/features/large-video/subscriber.web.js b/react/features/large-video/subscriber.web.jsindex e032fbce18..79afdac9dd 100644--- a/react/features/large-video/subscriber.web.js+++ b/react/features/large-video/subscriber.web.js@@ -1,7 +1,12 @@// @flowimport VideoLayout from '../../../modules/UI/videolayout/VideoLayout';+import { getMultipleVideoSupportFeatureFlag } from '../base/config';+import { MEDIA_TYPE } from '../base/media';import { StateListenerRegistry } from '../base/redux';+import { getTrackByMediaTypeAndParticipant, getVirtualScreenshareParticipantTrack } from '../base/tracks';++import { getLargeVideoParticipant } from './functions';/*** Updates the on stage participant video.@@ -12,3 +17,32 @@ StateListenerRegistry.register(VideoLayout.updateLargeVideo(participantId, true);});++/**+ * Schedules a large video update when the streaming status of the track associated with the large video changes.+ */+StateListenerRegistry.register(+ /* selector */ state => {+ const largeVideoParticipant = getLargeVideoParticipant(state);+ const tracks = state['features/base/tracks'];+ let videoTrack;++ if (getMultipleVideoSupportFeatureFlag(state) && largeVideoParticipant?.isVirtualScreenshareParticipant) {+ videoTrack = getVirtualScreenshareParticipantTrack(tracks, largeVideoParticipant?.id);+ } else {+ videoTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, largeVideoParticipant?.id);+ }++ return {+ participantId: largeVideoParticipant?.id,+ streamingStatus: videoTrack?.streamingStatus+ };+ },+ /* listener */ ({ participantId, streamingStatus }, previousState = {}) => {+ if (streamingStatus !== previousState.streamingStatus) {+ VideoLayout.updateLargeVideo(participantId, true);+ }+ }, {+ deepEquals: true+ }+);