diff --git a/src/frontend/package-lock.json b/src/frontend/package-lock.json index 50c7c8c4..b1b08286 100644 --- a/src/frontend/package-lock.json +++ b/src/frontend/package-lock.json @@ -37,7 +37,7 @@ "@typescript-eslint/parser": "7.13.1", "@vitejs/plugin-react": "4.3.1", "eslint": "8.57.0", - "eslint-config-prettier": "^9.1.0", + "eslint-config-prettier": "9.1.0", "eslint-plugin-jsx-a11y": "6.9.0", "eslint-plugin-react-hooks": "4.6.2", "eslint-plugin-react-refresh": "0.4.7", @@ -454,7 +454,6 @@ }, "node_modules/@clack/prompts/node_modules/is-unicode-supported": { "version": "1.3.0", - "dev": true, "inBundle": true, "license": "MIT", "engines": { diff --git a/src/frontend/public/sounds/uprise.mp3 b/src/frontend/public/sounds/uprise.mp3 new file mode 100644 index 00000000..cacfba22 Binary files /dev/null and b/src/frontend/public/sounds/uprise.mp3 differ diff --git a/src/frontend/src/components/SoundTester.tsx b/src/frontend/src/components/SoundTester.tsx new file mode 100644 index 00000000..49cb661a --- /dev/null +++ b/src/frontend/src/components/SoundTester.tsx @@ -0,0 +1,47 @@ +import { Button } from '@/primitives' +import { useEffect, useRef, useState } from 'react' +import { useTranslation } from 'react-i18next' +import { useMediaDeviceSelect } from '@livekit/components-react' + +export const SoundTester = () => { + const { t } = useTranslation('settings') + const [isPlaying, setIsPlaying] = useState(false) + const audioRef = useRef(null) + + const { activeDeviceId } = useMediaDeviceSelect({ kind: 'audiooutput' }) + + useEffect(() => { + const updateActiveId = async (deviceId: string) => { + try { + await audioRef?.current?.setSinkId(deviceId) + } catch (error) { + console.error(`Error setting sinkId: ${error}`) + } + } + updateActiveId(activeDeviceId) + }, [activeDeviceId]) + + // prevent pausing the sound + navigator.mediaSession.setActionHandler('pause', function () {}) + + return ( + <> + + {/* eslint-disable jsx-a11y/media-has-caption */} +