Skip to content

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

fix(participants-pane): add accessible labels to participant state indicators (#17973)

Muskan Kumariac94bbc95fe3
diff --git a/lang/main.json b/lang/main.json
index 9a9e84c7e0..ff47b5ecb2 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -1057,6 +1057,14 @@
"visitorsList": "Viewers ({{count}})",
"waitingLobby": "Waiting in lobby ({{count}})"
},
+ "indicators": {
+ "audioDominantSpeaker": "Active speaker",
+ "audioForceMuted": "Audio muted, cannot unmute",
+ "audioMuted": "Audio muted",
+ "raisedHand": "Hand raised",
+ "videoForceMuted": "Camera disabled, cannot enable",
+ "videoMuted": "Camera disabled"
+ },
"search": "Search participants",
"searchDescription": "Start typing to filter participants",
"title": "Participants"
diff --git a/react/features/participants-pane/components/native/ParticipantItem.tsx b/react/features/participants-pane/components/native/ParticipantItem.tsx
index ca4ac92b6f..5cb2dbde4c 100644
--- a/react/features/participants-pane/components/native/ParticipantItem.tsx
+++ b/react/features/participants-pane/components/native/ParticipantItem.tsx
@@ -11,6 +11,7 @@ import {
import { Text } from 'react-native-paper';
import Avatar from '../../../base/avatar/components/Avatar';
+import Icon from '../../../base/icons/components/Icon';
import { AudioStateIcons, MEDIA_STATE, type MediaState, VideoStateIcons } from '../../constants';
import { RaisedHandIndicator } from './RaisedHandIndicator';
@@ -95,9 +96,22 @@ function ParticipantItem({
const { t } = useTranslation();
+ const audioIconData = audioMediaState ? AudioStateIcons[audioMediaState] : null;
+ const videoIconData = videoMediaState ? VideoStateIcons[videoMediaState] : null;
+
+ const accessibleLabels = [
+ displayName,
+ local ? `(${t('chat.you')})` : '',
+ isModerator && !disableModeratorIndicator ? t('videothumbnail.moderator') : '',
+ raisedHand ? t('participantsPane.indicators.raisedHand') : '',
+ videoIconData?.labelKey ? t(videoIconData.labelKey) : '',
+ audioIconData?.labelKey ? t(audioIconData.labelKey) : ''
+ ].filter(Boolean).join(', ');
+
return (
<View style = { styles.participantContainer as StyleProp<ViewStyle> } >
<TouchableOpacity
+ accessibilityLabel = { accessibleLabels }
onPress = { onPress }
style = { styles.participantContent as StyleProp<ViewStyle> }>
<Avatar
@@ -124,8 +138,22 @@ function ParticipantItem({
!isKnockingParticipant
&& <View style = { styles.participantStatesContainer as StyleProp<ViewStyle> }>
<View>{ raisedHand && <RaisedHandIndicator /> }</View>
- <View style = { styles.participantStateVideo }>{ VideoStateIcons[videoMediaState] }</View>
- <View>{ AudioStateIcons[audioMediaState] }</View>
+ <View style = { styles.participantStateVideo }>
+ { videoIconData && (
+ <Icon
+ color = { videoIconData.color }
+ size = { 16 }
+ src = { videoIconData.src } />
+ ) }
+ </View>
+ <View>
+ { audioIconData && (
+ <Icon
+ color = { audioIconData.color }
+ size = { 16 }
+ src = { audioIconData.src } />
+ ) }
+ </View>
</View>
}
</TouchableOpacity>
diff --git a/react/features/participants-pane/components/web/ParticipantItem.tsx b/react/features/participants-pane/components/web/ParticipantItem.tsx
index 830d778a82..7f916c04dc 100644
--- a/react/features/participants-pane/components/web/ParticipantItem.tsx
+++ b/react/features/participants-pane/components/web/ParticipantItem.tsx
@@ -4,6 +4,7 @@ import { makeStyles } from 'tss-react/mui';
import Avatar from '../../../base/avatar/components/Avatar';
import { translate } from '../../../base/i18n/functions';
+import Icon from '../../../base/icons/components/Icon';
import ListItem from '../../../base/ui/components/web/ListItem';
import {
ACTION_TRIGGER,
@@ -173,11 +174,29 @@ function ParticipantItem({
</>
);
+ const audioIconData = audioMediaState ? AudioStateIcons[audioMediaState] : null;
+ const videoIconData = videoMediaState ? VideoStateIcons[videoMediaState] : null;
+
const indicators = (
<>
{raisedHand && <RaisedHandIndicator />}
- {VideoStateIcons[videoMediaState]}
- {AudioStateIcons[audioMediaState]}
+ {videoIconData && (
+ <Icon
+ alt = { videoIconData.labelKey ? t(videoIconData.labelKey) : undefined }
+ color = { videoIconData.color }
+ id = { videoIconData.id }
+ size = { 16 }
+ src = { videoIconData.src } />
+ )}
+ {audioIconData && (
+ <Icon
+ alt = { audioIconData.labelKey ? t(audioIconData.labelKey) : undefined }
+ className = { audioIconData.className }
+ color = { audioIconData.color }
+ id = { audioIconData.id }
+ size = { 16 }
+ src = { audioIconData.src } />
+ )}
</>
);
diff --git a/react/features/participants-pane/components/web/RaisedHandIndicator.tsx b/react/features/participants-pane/components/web/RaisedHandIndicator.tsx
index d13ee25457..7b788101f0 100644
--- a/react/features/participants-pane/components/web/RaisedHandIndicator.tsx
+++ b/react/features/participants-pane/components/web/RaisedHandIndicator.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { useTranslation } from 'react-i18next';
import { makeStyles } from 'tss-react/mui';
import Icon from '../../../base/icons/components/Icon';
@@ -17,10 +18,12 @@ const useStyles = makeStyles()(theme => {
export const RaisedHandIndicator = () => {
const { classes: styles, theme } = useStyles();
+ const { t } = useTranslation();
return (
<div className = { styles.indicator }>
<Icon
+ alt = { t('participantsPane.indicators.raisedHand') }
color = { theme.palette.participantRaisedHandIcon }
size = { 16 }
src = { IconRaiseHand } />
diff --git a/react/features/participants-pane/constants.tsx b/react/features/participants-pane/constants.tsx
index 35afca91fb..3fe67d0ace 100644
--- a/react/features/participants-pane/constants.tsx
+++ b/react/features/participants-pane/constants.tsx
@@ -1,6 +1,3 @@
-import React from 'react';
-
-import Icon from '../base/icons/components/Icon';
import {
IconMic,
IconMicSlash,
@@ -60,60 +57,59 @@ export const QUICK_ACTION_BUTTON: {
STOP_VIDEO: 'StopVideo'
};
+export interface IStateIconData {
+ className?: string;
+ color?: string;
+ id?: string;
+ labelKey?: string;
+ src: Function;
+}
+
/**
- * Icon mapping for possible participant audio states.
+ * Data mapping for possible participant audio states.
*/
-export const AudioStateIcons = {
- [MEDIA_STATE.DOMINANT_SPEAKER]: (
- <Icon
- className = 'jitsi-icon-dominant-speaker'
- size = { 16 }
- src = { IconMic } />
- ),
- [MEDIA_STATE.FORCE_MUTED]: (
- <Icon
- color = '#E04757'
- id = 'audioMuted'
- size = { 16 }
- src = { IconMicSlash } />
- ),
- [MEDIA_STATE.MUTED]: (
- <Icon
- id = 'audioMuted'
- size = { 16 }
- src = { IconMicSlash } />
- ),
- [MEDIA_STATE.UNMUTED]: (
- <Icon
- size = { 16 }
- src = { IconMic } />
- ),
+export const AudioStateIcons: { [key: string]: IStateIconData | null; } = {
+ [MEDIA_STATE.DOMINANT_SPEAKER]: {
+ className: 'jitsi-icon-dominant-speaker',
+ labelKey: 'participantsPane.indicators.audioDominantSpeaker',
+ src: IconMic
+ },
+ [MEDIA_STATE.FORCE_MUTED]: {
+ color: '#E04757',
+ id: 'audioMuted',
+ labelKey: 'participantsPane.indicators.audioForceMuted',
+ src: IconMicSlash
+ },
+ [MEDIA_STATE.MUTED]: {
+ id: 'audioMuted',
+ labelKey: 'participantsPane.indicators.audioMuted',
+ src: IconMicSlash
+ },
+ [MEDIA_STATE.UNMUTED]: {
+ src: IconMic
+ },
[MEDIA_STATE.NONE]: null
};
/**
- * Icon mapping for possible participant video states.
+ * Data mapping for possible participant video states.
*/
-export const VideoStateIcons = {
+export const VideoStateIcons: { [key: string]: IStateIconData | null; } = {
[MEDIA_STATE.DOMINANT_SPEAKER]: null,
- [MEDIA_STATE.FORCE_MUTED]: (
- <Icon
- color = '#E04757'
- id = 'videoMuted'
- size = { 16 }
- src = { IconVideoOff } />
- ),
- [MEDIA_STATE.MUTED]: (
- <Icon
- id = 'videoMuted'
- size = { 16 }
- src = { IconVideoOff } />
- ),
- [MEDIA_STATE.UNMUTED]: (
- <Icon
- size = { 16 }
- src = { IconVideo } />
- ),
+ [MEDIA_STATE.FORCE_MUTED]: {
+ color: '#E04757',
+ id: 'videoMuted',
+ labelKey: 'participantsPane.indicators.videoForceMuted',
+ src: IconVideoOff
+ },
+ [MEDIA_STATE.MUTED]: {
+ id: 'videoMuted',
+ labelKey: 'participantsPane.indicators.videoMuted',
+ src: IconVideoOff
+ },
+ [MEDIA_STATE.UNMUTED]: {
+ src: IconVideo
+ },
[MEDIA_STATE.NONE]: null
};