Skip to content

Commit

Permalink
fix video screen label
Browse files Browse the repository at this point in the history
  • Loading branch information
xdzqyyds committed Nov 23, 2024
1 parent d61f7b4 commit 3736218
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webapp/components/device.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function DeviceBar(props: { streamId: string }) {
const [currentDeviceSpeaker, setCurrentDeviceSpeaker] = useAtom(deviceSpeakerAtom)
const [SpeakerStatus, setSpeakerStatus] = useAtom(SpeakerStatusAtom)

const [mobileDevice, setMobileDevice] = useState(false)
const [mobileDevice, setMobileDevice] = useState<boolean | null>(null)

const {
userStatus,
Expand Down Expand Up @@ -113,7 +113,7 @@ export default function DeviceBar(props: { streamId: string }) {

setDeviceSpeaker([...speakers])
setDeviceAudio([...audios])
setDeviceVideo([...videos, deviceScreen])
setDeviceVideo(mobileDevice ? [...videos] : [...videos, deviceScreen])
}

const init = async () => {
Expand All @@ -138,8 +138,11 @@ export default function DeviceBar(props: { streamId: string }) {
}

useEffect(() => {
if (mobileDevice === null) {
return
}
init()
}, [])
}, [mobileDevice])

useEffect(() => {
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event
Expand Down

0 comments on commit 3736218

Please sign in to comment.