diff --git a/src/frontend/src/components/SoundTester.tsx b/src/frontend/src/components/SoundTester.tsx index 49cb661a..5294f370 100644 --- a/src/frontend/src/components/SoundTester.tsx +++ b/src/frontend/src/components/SoundTester.tsx @@ -27,12 +27,17 @@ export const SoundTester = () => { return ( <> diff --git a/src/frontend/src/features/settings/components/SettingsDialogExtended.tsx b/src/frontend/src/features/settings/components/SettingsDialogExtended.tsx index 546f4048..b14bcd3d 100644 --- a/src/frontend/src/features/settings/components/SettingsDialogExtended.tsx +++ b/src/frontend/src/features/settings/components/SettingsDialogExtended.tsx @@ -36,6 +36,7 @@ const tabPanelContainerStyle = css({ display: 'flex', flexGrow: '1', marginTop: '3.5rem', + minWidth: 0, }) export type SettingsDialogExtended = Pick< diff --git a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx index 94e2a997..9b7a1a78 100644 --- a/src/frontend/src/features/settings/components/tabs/AudioTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/AudioTab.tsx @@ -1,10 +1,55 @@ import { DialogProps, Field, H } from '@/primitives' import { TabPanel, TabPanelProps } from '@/primitives/Tabs' -import { useMediaDeviceSelect } from '@livekit/components-react' +import { + useIsSpeaking, + useMediaDeviceSelect, + useRoomContext, +} from '@livekit/components-react' import { isSafari } from '@/utils/livekit' import { useTranslation } from 'react-i18next' -import { SoundTester } from '@/components/SoundTester.tsx' +import { SoundTester } from '@/components/SoundTester' +import { HStack } from '@/styled-system/jsx' +import { ActiveSpeaker } from '@/features/rooms/components/ActiveSpeaker' +import { ReactNode } from 'react' + +type RowWrapperProps = { + heading: string + children: ReactNode[] +} + +const RowWrapper = ({ heading, children }: RowWrapperProps) => { + return ( + <> + {heading} + +
+ {children[0]} +
+
+ {children[1]} +
+
+ + ) +} export type AudioTabProps = Pick & Pick @@ -13,6 +58,9 @@ type DeviceItems = Array<{ value: string; label: string }> export const AudioTab = ({ id }: AudioTabProps) => { const { t } = useTranslation('settings') + const { localParticipant } = useRoomContext() + + const isSpeaking = useIsSpeaking(localParticipant) const { devices: devicesOut, @@ -60,20 +108,32 @@ export const AudioTab = ({ id }: AudioTabProps) => { return ( - {t('audio.microphone.heading')} - setActiveMediaDeviceIn(key as string)} - {...disabledProps} - /> + + setActiveMediaDeviceIn(key as string)} + {...disabledProps} + style={{ + width: '100%', + }} + /> + <> + {localParticipant.isMicrophoneEnabled ? ( + + ) : ( + Micro désactivé + )} + + {/* Safari has a known limitation where its implementation of 'enumerateDevices' does not include audio output devices. To prevent errors or an empty selection list, we only render the speakers selection field on non-Safari browsers. */} {!isSafari() && ( - <> - {t('audio.speakers.heading')} + { setActiveMediaDeviceOut(key as string) } {...disabledProps} + style={{ + minWidth: 0, + }} /> - + )} )