diff --git a/src/frontend/src/features/settings/components/tabs/VideoTab.tsx b/src/frontend/src/features/settings/components/tabs/VideoTab.tsx index 90607654..7a9dbedd 100644 --- a/src/frontend/src/features/settings/components/tabs/VideoTab.tsx +++ b/src/frontend/src/features/settings/components/tabs/VideoTab.tsx @@ -4,7 +4,7 @@ import { TabPanel, TabPanelProps } from '@/primitives/Tabs' import { useMediaDeviceSelect, useRoomContext } from '@livekit/components-react' import { useTranslation } from 'react-i18next' import { usePersistentUserChoices } from '@/features/rooms/livekit/hooks/usePersistentUserChoices' -import { useCallback, useEffect, useState } from 'react' +import { useCallback, useEffect, useMemo, useState } from 'react' import { css } from '@/styled-system/css' import { createLocalVideoTrack, @@ -119,6 +119,40 @@ export const VideoTab = ({ id }: VideoTabProps) => { } }, [videoDeviceId, videoElement]) + const resolutionItems = useMemo(() => { + return [ + { + value: 'h720', + label: `${t('resolution.publish.items.high')} (720p)`, + }, + { + value: 'h360', + label: `${t('resolution.publish.items.medium')} (360p)`, + }, + { + value: 'h180', + label: `${t('resolution.publish.items.low')} (180p)`, + }, + ] + }, [t]) + + const videoQualityItems = useMemo(() => { + return [ + { + value: VideoQuality.HIGH.toString(), + label: t('resolution.subscribe.items.high'), + }, + { + value: VideoQuality.MEDIUM.toString(), + label: t('resolution.subscribe.items.medium'), + }, + { + value: VideoQuality.LOW.toString(), + label: t('resolution.subscribe.items.low'), + }, + ] + }, [t]) + return ( @@ -180,20 +214,7 @@ export const VideoTab = ({ id }: VideoTabProps) => { { await handleVideoResolutionChange(key as VideoResolution) @@ -208,20 +229,7 @@ export const VideoTab = ({ id }: VideoTabProps) => { { if (key == undefined) return