소스 검색

fix(multi-stream): Add a virtual SS tile on RN.

Add a second virtual SS tile on RN when a remote participant that has multi-stream mode enabled starts a screenshare.
master
Jaya Allamsetty 3 년 전
부모
커밋
a707022d0b

+ 7
- 6
react/features/base/participants/components/ParticipantView.native.js 파일 보기

@@ -5,6 +5,7 @@ import { Text, View } from 'react-native';
5 5
 
6 6
 import { SharedVideo } from '../../../shared-video/components/native';
7 7
 import { Avatar } from '../../avatar';
8
+import { getMultipleVideoSupportFeatureFlag } from '../../config/';
8 9
 import { translate } from '../../i18n';
9 10
 import { JitsiParticipantConnectionStatus } from '../../lib-jitsi-meet';
10 11
 import {
@@ -14,7 +15,7 @@ import {
14 15
 import { Container, TintedView } from '../../react';
15 16
 import { connect } from '../../redux';
16 17
 import { TestHint } from '../../testing/components';
17
-import { getTrackByMediaTypeAndParticipant } from '../../tracks';
18
+import { getTrackByMediaTypeAndParticipant, getVirtualScreenshareParticipantTrack } from '../../tracks';
18 19
 import { shouldRenderParticipantVideo, getParticipantById } from '../functions';
19 20
 
20 21
 import styles from './styles';
@@ -251,8 +252,12 @@ class ParticipantView extends Component<Props> {
251 252
 function _mapStateToProps(state, ownProps) {
252 253
     const { disableVideo, participantId } = ownProps;
253 254
     const participant = getParticipantById(state, participantId);
255
+    const tracks = state['features/base/tracks'];
254 256
     let connectionStatus;
255 257
     let participantName;
258
+    const videoTrack = getMultipleVideoSupportFeatureFlag(state) && participant?.isVirtualScreenshareParticipant
259
+        ? getVirtualScreenshareParticipantTrack(tracks, participantId)
260
+        : getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, participantId);
256 261
 
257 262
     return {
258 263
         _connectionStatus:
@@ -261,11 +266,7 @@ function _mapStateToProps(state, ownProps) {
261 266
         _isFakeParticipant: participant && participant.isFakeParticipant,
262 267
         _participantName: participantName,
263 268
         _renderVideo: shouldRenderParticipantVideo(state, participantId) && !disableVideo,
264
-        _videoTrack:
265
-            getTrackByMediaTypeAndParticipant(
266
-                state['features/base/tracks'],
267
-                MEDIA_TYPE.VIDEO,
268
-                participantId)
269
+        _videoTrack: videoTrack
269 270
     };
270 271
 }
271 272
 

+ 13
- 3
react/features/base/participants/functions.js 파일 보기

@@ -10,7 +10,11 @@ import { getMultipleVideoSupportFeatureFlag, getSourceNameSignalingFeatureFlag }
10 10
 import { JitsiParticipantConnectionStatus } from '../lib-jitsi-meet';
11 11
 import { MEDIA_TYPE, shouldRenderVideoTrack } from '../media';
12 12
 import { toState } from '../redux';
13
-import { getScreenShareTrack, getTrackByMediaTypeAndParticipant } from '../tracks';
13
+import {
14
+    getScreenShareTrack,
15
+    getTrackByMediaTypeAndParticipant,
16
+    getVirtualScreenshareParticipantTrack
17
+} from '../tracks';
14 18
 import { createDeferred } from '../util';
15 19
 
16 20
 import { JIGASI_PARTICIPANT_ICON, MAX_DISPLAY_NAME_LENGTH, PARTICIPANT_ROLE } from './constants';
@@ -478,8 +482,14 @@ export function shouldRenderParticipantVideo(stateful: Object | Function, id: st
478 482
     }
479 483
 
480 484
     /* First check if we have an unmuted video track. */
481
-    const videoTrack
482
-        = getTrackByMediaTypeAndParticipant(state['features/base/tracks'], MEDIA_TYPE.VIDEO, id);
485
+    const tracks = state['features/base/tracks'];
486
+    let videoTrack;
487
+
488
+    if (getMultipleVideoSupportFeatureFlag(state) && participant.isVirtualScreenshareParticipant) {
489
+        videoTrack = getVirtualScreenshareParticipantTrack(tracks, id);
490
+    } else {
491
+        videoTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
492
+    }
483 493
 
484 494
     if (!shouldRenderVideoTrack(videoTrack, /* waitForVideoStarted */ false)) {
485 495
         return false;

react/features/base/participants/subscriber.web.js → react/features/base/participants/subscriber.js 파일 보기


+ 0
- 0
react/features/base/participants/subscriber.native.js 파일 보기


+ 26
- 12
react/features/filmstrip/components/native/Thumbnail.js 파일 보기

@@ -4,6 +4,7 @@ import React, { PureComponent } from 'react';
4 4
 import { Image, View } from 'react-native';
5 5
 import type { Dispatch } from 'redux';
6 6
 
7
+import { getMultipleVideoSupportFeatureFlag } from '../../../base/config';
7 8
 import { MEDIA_TYPE, VIDEO_TYPE } from '../../../base/media';
8 9
 import {
9 10
     PARTICIPANT_ROLE,
@@ -55,11 +56,21 @@ type Props = {
55 56
      */
56 57
     _isFakeParticipant: boolean,
57 58
 
59
+    /**
60
+     * Indicates whether multi-stream support is enabled.
61
+     */
62
+    _isMultiStreamSupportEnabled: boolean,
63
+
58 64
     /**
59 65
      * Indicates whether the participant is screen sharing.
60 66
      */
61 67
     _isScreenShare: boolean,
62 68
 
69
+    /**
70
+     * Indicates whether the thumbnail is for a virtual screenshare participant.
71
+     */
72
+    _isVirtualScreenshare: boolean,
73
+
63 74
     /**
64 75
      * Indicates whether the participant is local.
65 76
      */
@@ -187,6 +198,7 @@ class Thumbnail extends PureComponent<Props> {
187 198
         const {
188 199
             _audioMuted: audioMuted,
189 200
             _isScreenShare: isScreenShare,
201
+            _isVirtualScreenshare,
190 202
             _isFakeParticipant,
191 203
             _renderModeratorIndicator: renderModeratorIndicator,
192 204
             _participantId: participantId,
@@ -203,8 +215,8 @@ class Thumbnail extends PureComponent<Props> {
203 215
                     styles.thumbnailTopIndicatorContainer,
204 216
                     styles.thumbnailTopLeftIndicatorContainer
205 217
                 ] }>
206
-                <ConnectionIndicator participantId = { participantId } />
207
-                <RaisedHandIndicator participantId = { participantId } />
218
+                { !_isVirtualScreenshare && <ConnectionIndicator participantId = { participantId } /> }
219
+                { !_isVirtualScreenshare && <RaisedHandIndicator participantId = { participantId } /> }
208 220
                 {tileView && isScreenShare && (
209 221
                     <View style = { styles.indicatorContainer }>
210 222
                         <ScreenShareIndicator />
@@ -215,10 +227,10 @@ class Thumbnail extends PureComponent<Props> {
215 227
                 key = 'bottom-indicators'
216 228
                 style = { styles.thumbnailIndicatorContainer }>
217 229
                 <Container style = { (audioMuted || renderModeratorIndicator) && styles.bottomIndicatorsContainer }>
218
-                    { audioMuted && <AudioMutedIndicator /> }
230
+                    { audioMuted && !_isVirtualScreenshare && <AudioMutedIndicator /> }
219 231
                     { !tileView && _pinned && <PinnedIndicator />}
220
-                    { renderModeratorIndicator && <ModeratorIndicator />}
221
-                    { !tileView && isScreenShare
232
+                    { renderModeratorIndicator && !_isVirtualScreenshare && <ModeratorIndicator />}
233
+                    { !tileView && (isScreenShare || _isVirtualScreenshare)
222 234
                         && <ScreenShareIndicator />
223 235
                     }
224 236
                 </Container>
@@ -242,8 +254,9 @@ class Thumbnail extends PureComponent<Props> {
242 254
     render() {
243 255
         const {
244 256
             _gifSrc,
245
-            _isScreenShare: isScreenShare,
246 257
             _isFakeParticipant,
258
+            _isScreenShare: isScreenShare,
259
+            _isVirtualScreenshare,
247 260
             _participantId: participantId,
248 261
             _raisedHand,
249 262
             _renderDominantSpeakerIndicator,
@@ -266,8 +279,8 @@ class Thumbnail extends PureComponent<Props> {
266 279
                 style = { [
267 280
                     styles.thumbnail,
268 281
                     styleOverrides,
269
-                    _raisedHand ? styles.thumbnailRaisedHand : null,
270
-                    _renderDominantSpeakerIndicator ? styles.thumbnailDominantSpeaker : null
282
+                    _raisedHand && !_isVirtualScreenshare ? styles.thumbnailRaisedHand : null,
283
+                    _renderDominantSpeakerIndicator && !_isVirtualScreenshare ? styles.thumbnailDominantSpeaker : null
271 284
                 ] }
272 285
                 touchFeedback = { false }>
273 286
                 {_gifSrc ? <Image
@@ -303,10 +316,9 @@ function _mapStateToProps(state, ownProps) {
303 316
     const participant = getParticipantByIdOrUndefined(state, participantID);
304 317
     const localParticipantId = getLocalParticipant(state).id;
305 318
     const id = participant?.id;
306
-    const audioTrack
307
-        = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
308
-    const videoTrack
309
-        = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
319
+    const audioTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
320
+    const videoTrack = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
321
+    const isMultiStreamSupportEnabled = getMultipleVideoSupportFeatureFlag(state);
310 322
     const isScreenShare = videoTrack?.videoType === VIDEO_TYPE.DESKTOP;
311 323
     const participantCount = getParticipantCount(state);
312 324
     const renderDominantSpeakerIndicator = participant && participant.dominantSpeaker && participantCount > 2;
@@ -320,7 +332,9 @@ function _mapStateToProps(state, ownProps) {
320 332
         _audioMuted: audioTrack?.muted ?? true,
321 333
         _gifSrc: mode === 'chat' ? null : gifSrc,
322 334
         _isFakeParticipant: participant?.isFakeParticipant,
335
+        _isMultiStreamSupportEnabled: isMultiStreamSupportEnabled,
323 336
         _isScreenShare: isScreenShare,
337
+        _isVirtualScreenshare: isMultiStreamSupportEnabled && participant?.isVirtualScreenshareParticipant,
324 338
         _local: participant?.local,
325 339
         _localVideoOwner: Boolean(ownerId === localParticipantId),
326 340
         _participantId: id,

+ 1
- 1
react/features/filmstrip/components/web/StatusIndicators.js 파일 보기

@@ -108,7 +108,7 @@ function _mapStateToProps(state, ownProps) {
108 108
     if (participant?.local) {
109 109
         isAudioMuted = isLocalTrackMuted(tracks, MEDIA_TYPE.AUDIO);
110 110
     } else if (!participant?.isFakeParticipant) { // remote participants excluding shared video
111
-        const track = isMultiStreamSupportEnabled
111
+        const track = isMultiStreamSupportEnabled && participant?.isVirtualScreenshareParticipant
112 112
             ? getVirtualScreenshareParticipantTrack(tracks, participantID)
113 113
             : getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, participantID);
114 114
 

Loading…
취소
저장