fix: re-apply desired device state after EC joins, support mid-call PTT
This commit is contained in:
@@ -58,6 +58,15 @@ export function CallControls({ callEmbed }: CallControlsProps) {
|
||||
const [pttKey] = useSetting(settingsAtom, 'pttKey');
|
||||
const [pttActive, setPttActive] = useState(false);
|
||||
|
||||
// Mute mic immediately when PTT is enabled mid-call so the key handler can activate
|
||||
const pttModeRef = useRef(pttMode);
|
||||
useEffect(() => {
|
||||
if (pttMode && !pttModeRef.current && microphone) {
|
||||
callEmbed.control.setMicrophone(false);
|
||||
}
|
||||
pttModeRef.current = pttMode;
|
||||
}, [pttMode, callEmbed, microphone]);
|
||||
|
||||
const handleOpenMenu: MouseEventHandler<HTMLButtonElement> = (evt) => {
|
||||
setCords(evt.currentTarget.getBoundingClientRect());
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user