Skip to content

Commit

Permalink
fix(moderation) highlight dominant speaker (jitsi#9750)
Browse files Browse the repository at this point in the history
  • Loading branch information
quitrk authored and basil committed Aug 24, 2021
1 parent 9200ff3 commit 5418cc3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
9 changes: 8 additions & 1 deletion css/_participants-pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,11 @@
.participants_pane-content {
width: 100%;
}
}
}

.jitsi-icon {
&-dominant-speaker {
background-color: #1EC26A;
border-radius: 3px;
}
}
9 changes: 8 additions & 1 deletion react/features/base/participants/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,12 @@ export function getSortedParticipants(stateful: Object | Function) {
const remoteParticipants = getRemoteParticipants(stateful);

const items = [];
const dominantSpeaker = getDominantSpeakerParticipant(stateful);

remoteParticipants.forEach(p => {
items.push(p);
if (p !== dominantSpeaker) {
items.push(p);
}
});

items.sort((a, b) =>
Expand All @@ -469,6 +472,10 @@ export function getSortedParticipants(stateful: Object | Function) {

items.unshift(localParticipant);

if (dominantSpeaker && dominantSpeaker !== localParticipant) {
items.unshift(dominantSpeaker);
}

return items;
}

Expand Down
4 changes: 4 additions & 0 deletions react/features/participants-pane/components/web/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ export const ParticipantStates = styled.div`
& > *:not(:last-child) {
margin-right: 8px;
}
.jitsi-icon {
padding: 3px;
}
`;

export const ParticipantContainer = styled.div`
Expand Down
2 changes: 1 addition & 1 deletion react/features/participants-pane/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const QUICK_ACTION_BUTTON: {
export const AudioStateIcons: {[MediaState]: React$Element<any> | null} = {
[MEDIA_STATE.DOMINANT_SPEAKER]: (
<Icon
color = '#1EC26A'
className = 'jitsi-icon-dominant-speaker'
size = { 16 }
src = { IconMicrophoneEmpty } />
),
Expand Down

0 comments on commit 5418cc3

Please sign in to comment.