Merge pull request #90 from ibs0d/claude/add-camera-rotation-support-Lg2l9

Fix ui.rotate: broken CSS height chain causing blank video
This commit is contained in:
ibs0d 2026-03-21 19:23:11 +11:00 committed by GitHub
commit cdb58a43a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -360,11 +360,13 @@ export default function LiveCameraView({
}, [windowAspectRatio, containerRef]);
const cameraAspectRatio = useMemo(() => {
let ratio;
if (fullResolution.width && fullResolution.height) {
return fullResolution.width / fullResolution.height;
ratio = fullResolution.width / fullResolution.height;
} else {
return camera.detect.width / camera.detect.height;
ratio = camera.detect.width / camera.detect.height;
}
return camera.ui?.rotate ? 1 / ratio : ratio;
}, [camera, fullResolution]);
const constrainedAspectRatio = useMemo<number>(() => {
@ -651,7 +653,7 @@ export default function LiveCameraView({
className={cn(
fullscreen ? "*:rounded-none" : "",
camera.ui?.rotate &&
"[--frigate-mse-grid-rotated:1] [--frigate-mse-grid-rotation:rotate(90deg)]",
"size-full [--frigate-mse-grid-rotated:1] [--frigate-mse-grid-rotation:rotate(90deg)]",
)}
windowVisible
showStillWithoutActivity={false}