This commit is contained in:
Nicolas Mowen 2025-09-29 14:46:19 -06:00
parent c74efe8656
commit 64be8a420f

View File

@ -507,12 +507,13 @@ export default function LiveCameraView({
)} )}
</Button> </Button>
)} )}
{supportsFullscreen && !debug && ( {supportsFullscreen && (
<CameraFeatureToggle <CameraFeatureToggle
className="p-2 md:p-0" className="p-2 md:p-0"
variant={fullscreen ? "overlay" : "primary"} variant={fullscreen ? "overlay" : "primary"}
Icon={fullscreen ? FaCompress : FaExpand} Icon={fullscreen ? FaCompress : FaExpand}
isActive={fullscreen} isActive={fullscreen}
disabled={debug}
title={ title={
fullscreen fullscreen
? t("button.close", { ns: "common" }) ? t("button.close", { ns: "common" })
@ -521,32 +522,29 @@ export default function LiveCameraView({
onClick={toggleFullscreen} onClick={toggleFullscreen}
/> />
)} )}
{!isIOS && {!isIOS && !isFirefox && preferredLiveMode != "jsmpeg" && (
!isFirefox && <CameraFeatureToggle
!debug && className="p-2 md:p-0"
preferredLiveMode != "jsmpeg" && ( variant={fullscreen ? "overlay" : "primary"}
<CameraFeatureToggle Icon={LuPictureInPicture}
className="p-2 md:p-0" isActive={pip}
variant={fullscreen ? "overlay" : "primary"} title={
Icon={LuPictureInPicture} pip
isActive={pip} ? t("button.close", { ns: "common" })
title={ : t("button.pictureInPicture", { ns: "common" })
pip }
? t("button.close", { ns: "common" }) onClick={() => {
: t("button.pictureInPicture", { ns: "common" }) if (!pip) {
setPip(true);
} else {
document.exitPictureInPicture();
setPip(false);
} }
onClick={() => { }}
if (!pip) { disabled={!cameraEnabled || debug}
setPip(true); />
} else { )}
document.exitPictureInPicture(); {supports2WayTalk && (
setPip(false);
}
}}
disabled={!cameraEnabled}
/>
)}
{supports2WayTalk && !debug && (
<CameraFeatureToggle <CameraFeatureToggle
className="p-2 md:p-0" className="p-2 md:p-0"
variant={fullscreen ? "overlay" : "primary"} variant={fullscreen ? "overlay" : "primary"}
@ -563,10 +561,10 @@ export default function LiveCameraView({
setAudio(true); setAudio(true);
} }
}} }}
disabled={!cameraEnabled} disabled={!cameraEnabled || debug}
/> />
)} )}
{supportsAudioOutput && !debug && preferredLiveMode != "jsmpeg" && ( {supportsAudioOutput && preferredLiveMode != "jsmpeg" && (
<CameraFeatureToggle <CameraFeatureToggle
className="p-2 md:p-0" className="p-2 md:p-0"
variant={fullscreen ? "overlay" : "primary"} variant={fullscreen ? "overlay" : "primary"}
@ -578,7 +576,7 @@ export default function LiveCameraView({
: t("cameraAudio.enable", { ns: "views/live" }) : t("cameraAudio.enable", { ns: "views/live" })
} }
onClick={() => setAudio(!audio)} onClick={() => setAudio(!audio)}
disabled={!cameraEnabled} disabled={!cameraEnabled || debug}
/> />
)} )}
<FrigateCameraFeatures <FrigateCameraFeatures
@ -680,7 +678,7 @@ export default function LiveCameraView({
{camera.onvif.host != "" && ( {camera.onvif.host != "" && (
<div className="flex flex-col items-center justify-center"> <div className="flex flex-col items-center justify-center">
<PtzControlPanel <PtzControlPanel
className={debug ? "bottom-auto top-[25%]" : ""} className={debug && isMobile ? "bottom-auto top-[25%]" : ""}
camera={camera.name} camera={camera.name}
enabled={cameraEnabled} enabled={cameraEnabled}
clickOverlay={clickOverlay} clickOverlay={clickOverlay}
@ -888,21 +886,17 @@ function FrigateCameraFeatures({
<> <>
{isAdmin && ( {isAdmin && (
<> <>
{!debug && ( <CameraFeatureToggle
<CameraFeatureToggle className="p-2 md:p-0"
className="p-2 md:p-0" variant={fullscreen ? "overlay" : "primary"}
variant={fullscreen ? "overlay" : "primary"} Icon={enabledState == "ON" ? LuPower : LuPowerOff}
Icon={enabledState == "ON" ? LuPower : LuPowerOff} isActive={enabledState == "ON"}
isActive={enabledState == "ON"} title={
title={ enabledState == "ON" ? t("camera.disable") : t("camera.enable")
enabledState == "ON" }
? t("camera.disable") onClick={() => sendEnabled(enabledState == "ON" ? "OFF" : "ON")}
: t("camera.enable") disabled={debug}
} />
onClick={() => sendEnabled(enabledState == "ON" ? "OFF" : "ON")}
disabled={false}
/>
)}
<CameraFeatureToggle <CameraFeatureToggle
className="p-2 md:p-0" className="p-2 md:p-0"
variant={fullscreen ? "overlay" : "primary"} variant={fullscreen ? "overlay" : "primary"}
@ -997,21 +991,18 @@ function FrigateCameraFeatures({
)} )}
</> </>
)} )}
{!debug && ( <CameraFeatureToggle
<CameraFeatureToggle className={cn(
className={cn( "p-2 md:p-0",
"p-2 md:p-0", isRecording && "animate-pulse bg-red-500 hover:bg-red-600",
isRecording && "animate-pulse bg-red-500 hover:bg-red-600", )}
)} variant={fullscreen ? "overlay" : "primary"}
variant={fullscreen ? "overlay" : "primary"} Icon={isRecording ? TbRecordMail : TbRecordMailOff}
Icon={isRecording ? TbRecordMail : TbRecordMailOff} isActive={isRecording}
isActive={isRecording} title={t("manualRecording." + (isRecording ? "stop" : "start"))}
title={t("manualRecording." + (isRecording ? "stop" : "start"))} onClick={handleEventButtonClick}
onClick={handleEventButtonClick} disabled={!cameraEnabled || debug}
disabled={!cameraEnabled} />
/>
)}
<DropdownMenu modal={false}> <DropdownMenu modal={false}>
<DropdownMenuTrigger> <DropdownMenuTrigger>
<div <div