Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

Saúl Ibarra Corretgéc1f7bf75c197
diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js
index f022f24ef6..f13c4c6564 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
? <DominantSpeakerIndicator
iconSize = { iconSize }
tooltipPosition = { tooltipPosition } />
diff --git a/react/features/filmstrip/components/native/Thumbnail.js b/react/features/filmstrip/components/native/Thumbnail.js
index 2c8a1bbca4..b2e8532cd9 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<Props> {
_largeVideo: largeVideo,
_onClick,
_onShowRemoteVideoMenu,
+ _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
_styles,
_videoTrack: videoTrack,
disableTint,
@@ -182,8 +189,7 @@ class Thumbnail extends Component<Props> {
styles.thumbnailTopLeftIndicatorContainer
] }>
<RaisedHandIndicator participantId = { participant.id } />
- { participant.dominantSpeaker
- && <DominantSpeakerIndicator /> }
+ { showDominantSpeakerIndicator && <DominantSpeakerIndicator /> }
</View>
<View
@@ -255,12 +261,7 @@ function _mapDispatchToProps(dispatch: Function, ownProps): Object {
*
* @param {Object} state - Redux state.
* @param {Props} ownProps - Properties of component.
- * @returns {{
- * _audioTrack: Track,
- * _largeVideo: Object,
- * _styles: StyleType,
- * _videoTrack: Track
- * }}
+ * @returns {Object}
*/
function _mapStateToProps(state, ownProps) {
// We need read-only access to the state of features/large-video so that the
@@ -273,11 +274,14 @@ function _mapStateToProps(state, ownProps) {
= getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.AUDIO, id);
const videoTrack
= getTrackByMediaTypeAndParticipant(tracks, MEDIA_TYPE.VIDEO, id);
+ const participantCount = getParticipantCount(state);
+ const showDominantSpeakerIndicator = ownProps.participant.dominantSpeaker && participantCount > 2;
return {
_audioTrack: audioTrack,
_isEveryoneModerator: isEveryoneModerator(state),
_largeVideo: largeVideo,
+ _showDominantSpeakerIndicator: showDominantSpeakerIndicator,
_styles: ColorSchemeRegistry.get(state, 'Thumbnail'),
_videoTrack: videoTrack
};