Selaa lähdekoodia

thumbnail: don't render dominant speaker indicator on 1-1 calls

master
Saúl Ibarra Corretgé 6 vuotta sitten
vanhempi
commit
c1f7bf75c1

+ 5
- 2
modules/UI/videolayout/SmallVideo.js Näytä tiedosto

12
     from '../../../react/features/audio-level-indicator';
12
     from '../../../react/features/audio-level-indicator';
13
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
13
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
14
 import {
14
 import {
15
+    getParticipantCount,
15
     getPinnedParticipant,
16
     getPinnedParticipant,
16
     pinParticipant
17
     pinParticipant
17
 } from '../../../react/features/base/participants';
18
 } from '../../../react/features/base/participants';
836
     const iconSize = UIUtil.getIndicatorFontSize();
837
     const iconSize = UIUtil.getIndicatorFontSize();
837
     const showConnectionIndicator = this.videoIsHovered
838
     const showConnectionIndicator = this.videoIsHovered
838
         || !interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED;
839
         || !interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED;
839
-    const currentLayout = getCurrentLayout(APP.store.getState());
840
+    const state = APP.store.getState();
841
+    const currentLayout = getCurrentLayout(state);
842
+    const participantCount = getParticipantCount(state);
840
     let statsPopoverPosition, tooltipPosition;
843
     let statsPopoverPosition, tooltipPosition;
841
 
844
 
842
     if (currentLayout === LAYOUTS.TILE_VIEW) {
845
     if (currentLayout === LAYOUTS.TILE_VIEW) {
871
                             iconSize = { iconSize }
874
                             iconSize = { iconSize }
872
                             participantId = { this.id }
875
                             participantId = { this.id }
873
                             tooltipPosition = { tooltipPosition } />
876
                             tooltipPosition = { tooltipPosition } />
874
-                        { this._showDominantSpeaker
877
+                        { this._showDominantSpeaker && participantCount > 2
875
                             ? <DominantSpeakerIndicator
878
                             ? <DominantSpeakerIndicator
876
                                 iconSize = { iconSize }
879
                                 iconSize = { iconSize }
877
                                 tooltipPosition = { tooltipPosition } />
880
                                 tooltipPosition = { tooltipPosition } />

+ 12
- 8
react/features/filmstrip/components/native/Thumbnail.js Näytä tiedosto

10
 import {
10
 import {
11
     PARTICIPANT_ROLE,
11
     PARTICIPANT_ROLE,
12
     ParticipantView,
12
     ParticipantView,
13
+    getParticipantCount,
13
     isEveryoneModerator,
14
     isEveryoneModerator,
14
     pinParticipant
15
     pinParticipant
15
 } from '../../../base/participants';
16
 } from '../../../base/participants';
59
      */
60
      */
60
     _onShowRemoteVideoMenu: ?Function,
61
     _onShowRemoteVideoMenu: ?Function,
61
 
62
 
63
+    /**
64
+     * Whether to show the dominant speaker indicator or not.
65
+     */
66
+    _showDominantSpeakerIndicator: boolean,
67
+
62
     /**
68
     /**
63
      * The color-schemed stylesheet of the feature.
69
      * The color-schemed stylesheet of the feature.
64
      */
70
      */
121
             _largeVideo: largeVideo,
127
             _largeVideo: largeVideo,
122
             _onClick,
128
             _onClick,
123
             _onShowRemoteVideoMenu,
129
             _onShowRemoteVideoMenu,
130
+            _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
124
             _styles,
131
             _styles,
125
             _videoTrack: videoTrack,
132
             _videoTrack: videoTrack,
126
             disableTint,
133
             disableTint,
182
                         styles.thumbnailTopLeftIndicatorContainer
189
                         styles.thumbnailTopLeftIndicatorContainer
183
                     ] }>
190
                     ] }>
184
                     <RaisedHandIndicator participantId = { participant.id } />
191
                     <RaisedHandIndicator participantId = { participant.id } />
185
-                    { participant.dominantSpeaker
186
-                        && <DominantSpeakerIndicator /> }
192
+                    { showDominantSpeakerIndicator && <DominantSpeakerIndicator /> }
187
                 </View>
193
                 </View>
188
 
194
 
189
                 <View
195
                 <View
255
  *
261
  *
256
  * @param {Object} state - Redux state.
262
  * @param {Object} state - Redux state.
257
  * @param {Props} ownProps - Properties of component.
263
  * @param {Props} ownProps - Properties of component.
258
- * @returns {{
259
- *      _audioTrack: Track,
260
- *      _largeVideo: Object,
261
- *      _styles: StyleType,
262
- *      _videoTrack: Track
263
- *  }}
264
+ * @returns {Object}
264
  */
265
  */
265
 function _mapStateToProps(state, ownProps) {
266
 function _mapStateToProps(state, ownProps) {
266
     // We need read-only access to the state of features/large-video so that the
267
     // We need read-only access to the state of features/large-video so that the
273
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
274
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
274
     const videoTrack
275
     const videoTrack
275
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
276
         = getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
277
+    const participantCount = getParticipantCount(state);
278
+    const showDominantSpeakerIndicator = ownProps.participant.dominantSpeaker && participantCount > 2;
276
 
279
 
277
     return {
280
     return {
278
         _audioTrack: audioTrack,
281
         _audioTrack: audioTrack,
279
         _isEveryoneModerator: isEveryoneModerator(state),
282
         _isEveryoneModerator: isEveryoneModerator(state),
280
         _largeVideo: largeVideo,
283
         _largeVideo: largeVideo,
284
+        _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
281
         _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),
285
         _styles: ColorSchemeRegistry.get(state, 'Thumbnail'),
282
         _videoTrack: videoTrack
286
         _videoTrack: videoTrack
283
     };
287
     };

Loading…
Peruuta
Tallenna