From df0291db5c9ac0eff6b2585fcc47d90e55654315 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 15 Mar 2024 08:57:58 -0600 Subject: [PATCH] Fix zoom scaling for live view (#10479) --- web/src/views/live/LiveCameraView.tsx | 243 ++++++++++++++------------ 1 file changed, 127 insertions(+), 116 deletions(-) diff --git a/web/src/views/live/LiveCameraView.tsx b/web/src/views/live/LiveCameraView.tsx index 0ed7c342a..19aff72e0 100644 --- a/web/src/views/live/LiveCameraView.tsx +++ b/web/src/views/live/LiveCameraView.tsx @@ -157,131 +157,142 @@ export default function LiveCameraView({ camera }: LiveCameraViewProps) { }, [cameraAspectRatio, windowAspectRatio, fullscreen]); return ( -
+
- {!fullscreen ? ( - - ) : ( -
- )} - -
- { - if (fullscreen) { - document.exitFullscreen(); - } else { - mainRef.current?.requestFullscreen(); - } - }} - /> - {window.isSecureContext && ( - setMic(!mic)} - /> - )} - setAudio(!audio)} - /> - sendDetect(detectState == "ON" ? "OFF" : "ON")} - /> - sendRecord(recordState == "ON" ? "OFF" : "ON")} - /> - sendSnapshot(snapshotState == "ON" ? "OFF" : "ON")} - /> - {camera.audio.enabled_in_config && ( - sendAudio(audioState == "ON" ? "OFF" : "ON")} - /> - )} -
-
-
-
+ {!fullscreen ? ( + + ) : ( +
+ )} + +
+ { + if (fullscreen) { + document.exitFullscreen(); + } else { + mainRef.current?.requestFullscreen(); + } + }} + /> + {window.isSecureContext && ( + setMic(!mic)} + /> + )} + setAudio(!audio)} + /> + sendDetect(detectState == "ON" ? "OFF" : "ON")} + /> + sendRecord(recordState == "ON" ? "OFF" : "ON")} + /> + + sendSnapshot(snapshotState == "ON" ? "OFF" : "ON") + } + /> + {camera.audio.enabled_in_config && ( + sendAudio(audioState == "ON" ? "OFF" : "ON")} + /> + )} +
+
+
+ - - - - - -
- {camera.onvif.host != "" && } +
+ +
+ {camera.onvif.host != "" && } +
-
+
); }