mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-01 19:30:33 +03:00
unmute camera audio when starting two-way talk from the shortcut
This commit is contained in:
@@ -511,6 +511,13 @@ export default function LiveCameraView({
|
||||
}
|
||||
}, [webRTCVerdictPending]);
|
||||
|
||||
const toggleMic = () => {
|
||||
setMic(!mic);
|
||||
if (!mic && !audio) {
|
||||
setAudio(true);
|
||||
}
|
||||
};
|
||||
|
||||
useKeyboardListener(["m", "t", "Escape"], (key, modifiers) => {
|
||||
if (!modifiers.down) {
|
||||
return true;
|
||||
@@ -525,7 +532,7 @@ export default function LiveCameraView({
|
||||
break;
|
||||
case "t":
|
||||
if (supports2WayTalk && talkAvailable) {
|
||||
setMic(!mic);
|
||||
toggleMic();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
@@ -792,12 +799,7 @@ export default function LiveCameraView({
|
||||
? t("twoWayTalk.disable", { ns: "views/live" })
|
||||
: t("twoWayTalk.enable", { ns: "views/live" })
|
||||
}
|
||||
onClick={() => {
|
||||
setMic(!mic);
|
||||
if (!mic && !audio) {
|
||||
setAudio(true);
|
||||
}
|
||||
}}
|
||||
onClick={toggleMic}
|
||||
disabled={!cameraEnabled || debug || !talkAvailable}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user