mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-04 12:50:31 +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]);
|
}, [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}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user