unmute camera audio when starting two-way talk from the shortcut

This commit is contained in:
Josh Hawkins
2026-11-01 08:30:33 -06:00
parent 72c97f2b7d
commit b92ad23116
+9 -7
View File
@@ -511,6 +511,13 @@ export default function LiveCameraView({
} }
}, [webRTCVerdictPending]); }, [webRTCVerdictPending]);
const toggleMic = () => {
setMic(!mic);
if (!mic && !audio) {
setAudio(true);
}
};
useKeyboardListener(["m", "t", "Escape"], (key, modifiers) => { useKeyboardListener(["m", "t", "Escape"], (key, modifiers) => {
if (!modifiers.down) { if (!modifiers.down) {
return true; return true;
@@ -525,7 +532,7 @@ export default function LiveCameraView({
break; break;
case "t": case "t":
if (supports2WayTalk && talkAvailable) { if (supports2WayTalk && talkAvailable) {
setMic(!mic); toggleMic();
return true; return true;
} }
break; break;
@@ -792,12 +799,7 @@ export default function LiveCameraView({
? t("twoWayTalk.disable", { ns: "views/live" }) ? t("twoWayTalk.disable", { ns: "views/live" })
: t("twoWayTalk.enable", { ns: "views/live" }) : t("twoWayTalk.enable", { ns: "views/live" })
} }
onClick={() => { onClick={toggleMic}
setMic(!mic);
if (!mic && !audio) {
setAudio(true);
}
}}
disabled={!cameraEnabled || debug || !talkAvailable} disabled={!cameraEnabled || debug || !talkAvailable}
/> />
)} )}