diff --git a/webapp/components/device.tsx b/webapp/components/device.tsx index 136e415..d358438 100644 --- a/webapp/components/device.tsx +++ b/webapp/components/device.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react' +import { useEffect, useState } from 'react' import { useAtom } from 'jotai' import { Device, @@ -19,7 +19,6 @@ import SvgVideo from './svg/video' export default function DeviceBar() { const disableDevice = "none" - const refEnabled = useRef(false) const [permissionAudio, setPermissionAudio] = useState("...") const [permissionVideo, setPermissionVideo] = useState("...") @@ -79,8 +78,8 @@ export default function DeviceBar() { } } - setDeviceAudio([deviceNone, ...audios]) - setDeviceVideo([deviceNone, ...videos, deviceScreen]) + setDeviceAudio([...audios]) + setDeviceVideo([...videos, deviceScreen]) } const init = async () => { @@ -95,11 +94,8 @@ export default function DeviceBar() { } useEffect(() => { - if (!refEnabled.current) { - refEnabled.current = true - init() - } - }, []) + init() + }, [localStream]) useEffect(() => { // Reference: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/devicechange_event @@ -226,7 +222,7 @@ export default function DeviceBar() { :
} {currentDeviceVideo === disableDevice - ? < div className='w-8 h-1 bg-red-500 rounded-full rotate-45' + ?
+
{props.meetingId}