Przeglądaj źródła

[RN] Add display name label to tile view

master
Bettenbuk Zoltan 6 lat temu
rodzic
commit
e5caca9cfd

+ 13
- 2
react/features/conference/components/native/Conference.js Wyświetl plik

17
 import { createDesiredLocalTracks } from '../../../base/tracks';
17
 import { createDesiredLocalTracks } from '../../../base/tracks';
18
 import { ConferenceNotification } from '../../../calendar-sync';
18
 import { ConferenceNotification } from '../../../calendar-sync';
19
 import { Chat } from '../../../chat';
19
 import { Chat } from '../../../chat';
20
-import { DisplayNameLabel } from '../../../display-name/components/native';
20
+import { DisplayNameLabel } from '../../../display-name';
21
 import {
21
 import {
22
     FILMSTRIP_SIZE,
22
     FILMSTRIP_SIZE,
23
     Filmstrip,
23
     Filmstrip,
61
      */
61
      */
62
     _filmstripVisible: boolean,
62
     _filmstripVisible: boolean,
63
 
63
 
64
+    /**
65
+     * The ID of the participant currently on stage (if any)
66
+     */
67
+    _largeVideoParticipantId: string,
68
+
64
     /**
69
     /**
65
      * Current conference's full URL.
70
      * Current conference's full URL.
66
      *
71
      *
236
     render() {
241
     render() {
237
         const {
242
         const {
238
             _connecting,
243
             _connecting,
244
+            _largeVideoParticipantId,
239
             _reducedUI,
245
             _reducedUI,
240
             _shouldDisplayTileView
246
             _shouldDisplayTileView
241
         } = this.props;
247
         } = this.props;
282
 
288
 
283
                     <Captions onPress = { this._onClick } />
289
                     <Captions onPress = { this._onClick } />
284
 
290
 
285
-                    <DisplayNameLabel />
291
+                    { _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
286
 
292
 
287
                     {/*
293
                     {/*
288
                       * The Toolbox is in a stacking layer bellow the Filmstrip.
294
                       * The Toolbox is in a stacking layer bellow the Filmstrip.
497
          */
503
          */
498
         _filmstripVisible: isFilmstripVisible(state),
504
         _filmstripVisible: isFilmstripVisible(state),
499
 
505
 
506
+        /**
507
+         * The ID of the participant currently on stage.
508
+         */
509
+        _largeVideoParticipantId: state['features/large-video'].participantId,
510
+
500
         /**
511
         /**
501
          * Current conference's full URL.
512
          * Current conference's full URL.
502
          *
513
          *

+ 2
- 0
react/features/conference/index.js Wyświetl plik

1
+// @flow
2
+
1
 export * from './components';
3
 export * from './components';
2
 
4
 
3
 import './middleware';
5
 import './middleware';

+ 15
- 10
react/features/display-name/components/native/DisplayNameLabel.js Wyświetl plik

9
     shouldRenderParticipantVideo
9
     shouldRenderParticipantVideo
10
 } from '../../../base/participants';
10
 } from '../../../base/participants';
11
 import { connect } from '../../../base/redux';
11
 import { connect } from '../../../base/redux';
12
-import { shouldDisplayTileView } from '../../../video-layout';
13
 
12
 
14
 import styles from './styles';
13
 import styles from './styles';
15
 
14
 
23
     /**
22
     /**
24
      * True of the label needs to be rendered. False otherwise.
23
      * True of the label needs to be rendered. False otherwise.
25
      */
24
      */
26
-    _render: boolean
25
+    _render: boolean,
26
+
27
+    /**
28
+     * The ID of the participant to render the label for.
29
+     */
30
+    participantId: string
27
 }
31
 }
28
 
32
 
29
 /**
33
 /**
54
  * Maps part of the Redux state to the props of this component.
58
  * Maps part of the Redux state to the props of this component.
55
  *
59
  *
56
  * @param {Object} state - The Redux state.
60
  * @param {Object} state - The Redux state.
61
+ * @param {Props} ownProps - The own props of the component.
57
  * @returns {{
62
  * @returns {{
58
  * }}
63
  * }}
59
  */
64
  */
60
-function _mapStateToProps(state: Object) {
61
-    const largeVideoParticipantId = state['features/large-video'].participantId;
65
+function _mapStateToProps(state: Object, ownProps: Props) {
66
+    const { participantId } = ownProps;
62
     const localParticipant = getLocalParticipant(state);
67
     const localParticipant = getLocalParticipant(state);
63
 
68
 
64
     // Currently we only render the display name if it's not the local
69
     // Currently we only render the display name if it's not the local
65
-    // participant, we're not in tile view and there is no video rendered for
66
-    // the on-stage participant.
67
-    const _render = localParticipant.id !== largeVideoParticipantId
68
-        && !shouldDisplayTileView(state)
69
-        && !shouldRenderParticipantVideo(state, largeVideoParticipantId);
70
+    // participant and there is no video rendered for
71
+    // them.
72
+    const _render = Boolean(participantId)
73
+        && localParticipant.id !== participantId
74
+        && !shouldRenderParticipantVideo(state, participantId);
70
 
75
 
71
     return {
76
     return {
72
         _participantName:
77
         _participantName:
73
-            getParticipantDisplayName(state, largeVideoParticipantId),
78
+            getParticipantDisplayName(state, participantId),
74
         _render
79
         _render
75
     };
80
     };
76
 }
81
 }

+ 0
- 0
react/features/display-name/components/web/DisplayNameLabel.js Wyświetl plik


+ 1
- 0
react/features/display-name/components/web/index.js Wyświetl plik

1
 // @flow
1
 // @flow
2
 
2
 
3
 export { default as DisplayName } from './DisplayName';
3
 export { default as DisplayName } from './DisplayName';
4
+export { default as DisplayNameLabel } from './DisplayNameLabel';
4
 export { default as DisplayNamePrompt } from './DisplayNamePrompt';
5
 export { default as DisplayNamePrompt } from './DisplayNamePrompt';

+ 2
- 0
react/features/filmstrip/components/_.native.js Wyświetl plik

1
+// @flow
2
+
1
 export * from './native';
3
 export * from './native';

+ 2
- 0
react/features/filmstrip/components/_.web.js Wyświetl plik

1
+// @flow
2
+
1
 export * from './web';
3
 export * from './web';

+ 2
- 0
react/features/filmstrip/components/index.js Wyświetl plik

1
+// @flow
2
+
1
 export * from './_';
3
 export * from './_';

+ 10
- 2
react/features/filmstrip/components/native/Thumbnail.js Wyświetl plik

17
 import { connect } from '../../../base/redux';
17
 import { connect } from '../../../base/redux';
18
 import { StyleType } from '../../../base/styles';
18
 import { StyleType } from '../../../base/styles';
19
 import { getTrackByMediaTypeAndParticipant } from '../../../base/tracks';
19
 import { getTrackByMediaTypeAndParticipant } from '../../../base/tracks';
20
-
20
+import { DisplayNameLabel } from '../../../display-name';
21
 import { RemoteVideoMenu } from '../../../remote-video-menu';
21
 import { RemoteVideoMenu } from '../../../remote-video-menu';
22
 
22
 
23
 import AudioMutedIndicator from './AudioMutedIndicator';
23
 import AudioMutedIndicator from './AudioMutedIndicator';
90
      */
90
      */
91
     participant: Object,
91
     participant: Object,
92
 
92
 
93
+    /**
94
+     * Whether to display or hide the display name of the participant in the thumbnail.
95
+     */
96
+    renderDisplayName: ?boolean,
97
+
93
     /**
98
     /**
94
      * Optional styling to add or override on the Thumbnail component root.
99
      * Optional styling to add or override on the Thumbnail component root.
95
      */
100
      */
119
             _videoTrack: videoTrack,
124
             _videoTrack: videoTrack,
120
             disablePin,
125
             disablePin,
121
             disableTint,
126
             disableTint,
122
-            participant
127
+            participant,
128
+            renderDisplayName
123
         } = this.props;
129
         } = this.props;
124
 
130
 
125
         // We don't render audio in any of the following:
131
         // We don't render audio in any of the following:
163
                     tintStyle = { _styles.activeThumbnailTint }
169
                     tintStyle = { _styles.activeThumbnailTint }
164
                     zOrder = { 1 } />
170
                     zOrder = { 1 } />
165
 
171
 
172
+                { renderDisplayName && <DisplayNameLabel participantId = { participantId } /> }
173
+
166
                 { participant.role === PARTICIPANT_ROLE.MODERATOR
174
                 { participant.role === PARTICIPANT_ROLE.MODERATOR
167
                     && <View style = { styles.moderatorIndicatorContainer }>
175
                     && <View style = { styles.moderatorIndicatorContainer }>
168
                         <ModeratorIndicator />
176
                         <ModeratorIndicator />

+ 1
- 0
react/features/filmstrip/components/native/TileView.js Wyświetl plik

302
                     disableTint = { true }
302
                     disableTint = { true }
303
                     key = { participant.id }
303
                     key = { participant.id }
304
                     participant = { participant }
304
                     participant = { participant }
305
+                    renderDisplayName = { true }
305
                     styleOverrides = { styleOverrides } />));
306
                     styleOverrides = { styleOverrides } />));
306
     }
307
     }
307
 
308
 

+ 2
- 0
react/features/filmstrip/components/native/index.js Wyświetl plik

1
+// @flow
2
+
1
 export { default as Filmstrip } from './Filmstrip';
3
 export { default as Filmstrip } from './Filmstrip';
2
 export { default as TileView } from './TileView';
4
 export { default as TileView } from './TileView';
3
 export { default as styles } from './styles';
5
 export { default as styles } from './styles';

+ 2
- 0
react/features/filmstrip/components/web/index.js Wyświetl plik

1
+// @flow
2
+
1
 export { default as AudioMutedIndicator } from './AudioMutedIndicator';
3
 export { default as AudioMutedIndicator } from './AudioMutedIndicator';
2
 export { default as DominantSpeakerIndicator }
4
 export { default as DominantSpeakerIndicator }
3
     from './DominantSpeakerIndicator';
5
     from './DominantSpeakerIndicator';

Ładowanie…
Anuluj
Zapisz