diff --git a/src/frontend/src/features/rooms/components/Join.tsx b/src/frontend/src/features/rooms/components/Join.tsx
index 2a7ff4bb..782fe106 100644
--- a/src/frontend/src/features/rooms/components/Join.tsx
+++ b/src/frontend/src/features/rooms/components/Join.tsx
@@ -8,7 +8,7 @@ import { H } from '@/primitives/H'
import { SelectToggleDevice } from '../livekit/components/controls/SelectToggleDevice'
import { Field } from '@/primitives/Field'
import { Button, Dialog, Text, Form } from '@/primitives'
-import { HStack, VStack } from '@/styled-system/jsx'
+import { VStack } from '@/styled-system/jsx'
import { Heading } from 'react-aria-components'
import { RiImageCircleAiFill } from '@remixicon/react'
import {
@@ -71,36 +71,14 @@ const Effects = ({
-
-
-
-
+
+
>
)
}
@@ -160,12 +138,14 @@ export const Join = ({
)
const videoEl = useRef(null)
+ const isVideoInitiated = useRef(false)
useEffect(() => {
const videoElement = videoEl.current as HTMLVideoElement | null
const handleVideoLoaded = () => {
if (videoElement) {
+ isVideoInitiated.current = true
videoElement.style.opacity = '1'
}
}
@@ -240,6 +220,20 @@ export const Join = ({
enterRoom()
}
+ const hintMessage = useMemo(() => {
+ if (!videoEnabled) {
+ return 'cameraDisabled'
+ }
+
+ if (!isVideoInitiated.current) {
+ return 'cameraStarting'
+ }
+
+ if (videoTrack && videoEnabled) {
+ return ''
+ }
+ }, [videoTrack, videoEnabled])
+
const renderWaitingState = () => {
switch (status) {
case ApiLobbyStatus.TIMEOUT:
@@ -322,146 +316,216 @@ export const Join = ({
- {videoTrack && videoEnabled ? (
- // eslint-disable-next-line jsx-a11y/media-has-caption
-
- ) : (
+
-
- {!videoEnabled && t('cameraDisabled')}
- {videoEnabled && !videoTrack && t('cameraStarting')}
-
+
+ {/* eslint-disable-next-line jsx-a11y/media-has-caption */}
+
+
+
+
+
+ {hintMessage && t(hintMessage)}
+
+
- )}
-
- saveProcessorSerialized(processor?.serialize())
- }
- />
+
+
+ saveProcessorSerialized(processor?.serialize())
+ }
+ />
+
+
+
+
+
+ saveAudioInputEnabled(enabled)}
+ onDeviceError={(error) => console.error(error)}
+ onActiveDeviceChange={(deviceId) =>
+ saveAudioInputDeviceId(deviceId ?? '')
+ }
+ variant="tertiary"
+ />
+
+
+ saveVideoInputEnabled(enabled)}
+ onDeviceError={(error) => console.error(error)}
+ onActiveDeviceChange={(deviceId) =>
+ saveVideoInputDeviceId(deviceId ?? '')
+ }
+ variant="tertiary"
+ />
+
-
- saveAudioInputEnabled(enabled)}
- onDeviceError={(error) => console.error(error)}
- onActiveDeviceChange={(deviceId) =>
- saveAudioInputDeviceId(deviceId ?? '')
- }
- variant="tertiary"
- />
- saveVideoInputEnabled(enabled)}
- onDeviceError={(error) => console.error(error)}
- onActiveDeviceChange={(deviceId) =>
- saveVideoInputDeviceId(deviceId ?? '')
- }
- variant="tertiary"
- />
-
-
-
- {renderWaitingState()}
+
+ {renderWaitingState()}
+
)