From c1f7bf75c19735801343588705b34f5b1dfe43a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Thu, 12 Sep 2019 15:03:20 +0200 Subject: [PATCH] thumbnail: don't render dominant speaker indicator on 1-1 calls --- modules/UI/videolayout/SmallVideo.js | 7 +++++-- .../filmstrip/components/native/Thumbnail.js | 20 +++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index f022f24ef..f13c4c656 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -12,6 +12,7 @@ import { AudioLevelIndicator } from '../../../react/features/audio-level-indicator'; import { Avatar as AvatarDisplay } from '../../../react/features/base/avatar'; import { + getParticipantCount, getPinnedParticipant, pinParticipant } from '../../../react/features/base/participants'; @@ -836,7 +837,9 @@ SmallVideo.prototype.updateIndicators = function() { const iconSize = UIUtil.getIndicatorFontSize(); const showConnectionIndicator = this.videoIsHovered || !interfaceConfig.CONNECTION_INDICATOR_AUTO_HIDE_ENABLED; - const currentLayout = getCurrentLayout(APP.store.getState()); + const state = APP.store.getState(); + const currentLayout = getCurrentLayout(state); + const participantCount = getParticipantCount(state); let statsPopoverPosition, tooltipPosition; if (currentLayout === LAYOUTS.TILE_VIEW) { @@ -871,7 +874,7 @@ SmallVideo.prototype.updateIndicators = function() { iconSize = { iconSize } participantId = { this.id } tooltipPosition = { tooltipPosition } /> - { this._showDominantSpeaker + { this._showDominantSpeaker && participantCount > 2 ? diff --git a/react/features/filmstrip/components/native/Thumbnail.js b/react/features/filmstrip/components/native/Thumbnail.js index 2c8a1bbca..b2e8532cd 100644 --- a/react/features/filmstrip/components/native/Thumbnail.js +++ b/react/features/filmstrip/components/native/Thumbnail.js @@ -10,6 +10,7 @@ import { MEDIA_TYPE, VIDEO_TYPE, Audio } from '../../../base/media'; import { PARTICIPANT_ROLE, ParticipantView, + getParticipantCount, isEveryoneModerator, pinParticipant } from '../../../base/participants'; @@ -59,6 +60,11 @@ type Props = { */ _onShowRemoteVideoMenu: ?Function, + /** + * Whether to show the dominant speaker indicator or not. + */ + _showDominantSpeakerIndicator: boolean, + /** * The color-schemed stylesheet of the feature. */ @@ -121,6 +127,7 @@ class Thumbnail extends Component { _largeVideo: largeVideo, _onClick, _onShowRemoteVideoMenu, + _showDominantSpeakerIndicator: showDominantSpeakerIndicator, _styles, _videoTrack: videoTrack, disableTint, @@ -182,8 +189,7 @@ class Thumbnail extends Component { styles.thumbnailTopLeftIndicatorContainer ] }> - { participant.dominantSpeaker - && } + { showDominantSpeakerIndicator && } 2; return { _audioTrack: audioTrack, _isEveryoneModerator: isEveryoneModerator(state), _largeVideo: largeVideo, + _showDominantSpeakerIndicator: showDominantSpeakerIndicator, _styles: ColorSchemeRegistry.get(state, 'Thumbnail'), _videoTrack: videoTrack };