Ver código fonte

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

master
Saúl Ibarra Corretgé 6 anos atrás
pai
commit
c1f7bf75c1

+ 5
- 2
modules/UI/videolayout/SmallVideo.js Ver arquivo

@@ -12,6 +12,7 @@ import { AudioLevelIndicator }
12 12
     from '../../../react/features/audio-level-indicator';
13 13
 import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar';
14 14
 import {
15
+    getParticipantCount,
15 16
     getPinnedParticipant,
16 17
     pinParticipant
17 18
 } from '../../../react/features/base/participants';
@@ -836,7 +837,9 @@ SmallVideo.prototype.updateIndicators = function() {
836 837
     const iconSize = UIUtil.getIndicatorFontSize();
837 838
     const showConnectionIndicator = this.videoIsHovered
838 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 843
     let statsPopoverPosition, tooltipPosition;
841 844
 
842 845
     if (currentLayout === LAYOUTS.TILE_VIEW) {
@@ -871,7 +874,7 @@ SmallVideo.prototype.updateIndicators = function() {
871 874
                             iconSize = { iconSize }
872 875
                             participantId = { this.id }
873 876
                             tooltipPosition = { tooltipPosition } />
874
-                        { this._showDominantSpeaker
877
+                        { this._showDominantSpeaker && participantCount > 2
875 878
                             ? <DominantSpeakerIndicator
876 879
                                 iconSize = { iconSize }
877 880
                                 tooltipPosition = { tooltipPosition } />

+ 12
- 8
react/features/filmstrip/components/native/Thumbnail.js Ver arquivo

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

Carregando…
Cancelar
Salvar