From 5a2b88a5f0b49b3d204b0c11ed4cd231db0dbb2d Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 10 Feb 2024 09:36:22 -0600 Subject: [PATCH] try 8/9 --- web/src/components/player/LivePlayer.tsx | 3 --- web/src/pages/Live.tsx | 19 ++++--------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/web/src/components/player/LivePlayer.tsx b/web/src/components/player/LivePlayer.tsx index ba3e31f05..a13a43707 100644 --- a/web/src/components/player/LivePlayer.tsx +++ b/web/src/components/player/LivePlayer.tsx @@ -23,7 +23,6 @@ const emptyObject = Object.freeze({}); type LivePlayerProps = { className?: string; - aspectRatio?: string; cameraConfig: CameraConfig; preferredLiveMode?: LivePlayerMode; showStillWithoutActivity?: boolean; @@ -33,7 +32,6 @@ type Options = { [key: string]: boolean }; export default function LivePlayer({ className, - aspectRatio, cameraConfig, preferredLiveMode, showStillWithoutActivity = true, @@ -168,7 +166,6 @@ export default function LivePlayer({ ? "outline-destructive outline-1 rounded-2xl shadow-[0_0_6px_1px] shadow-destructive" : "outline-0" } transition-all duration-500 ${className}`} - style={{ aspectRatio: aspectRatio }} > {(showStillWithoutActivity == false || activeMotion || activeTracking) && player} diff --git a/web/src/pages/Live.tsx b/web/src/pages/Live.tsx index e8bde6475..2f4270bb1 100644 --- a/web/src/pages/Live.tsx +++ b/web/src/pages/Live.tsx @@ -80,17 +80,15 @@ function Live() { let grow; let aspectRatio = camera.detect.width / camera.detect.height; if (aspectRatio > 2) { - grow = "md:col-span-2"; + grow = "md:col-span-2 aspect-wide"; } else if (aspectRatio < 1) { - grow = `md:row-span-2`; + grow = `md:row-span-2 aspect-[8/9]`; + } else { + grow = "aspect-video"; } return ( { - return b === 0 ? a : gcd(b, a % b); - }; - - const common = gcd(width, height); - return `${width / common}/${height / common}`; -} - export default Live;