Skip to content

Commit

Permalink
Fix layout for tall video
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 committed Mar 8, 2024
1 parent 8d7ba46 commit ac85c3d
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions web/src/components/player/PreviewVideoPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ export default function PreviewVideoPlayer({
}: PreviewVideoPlayerProps) {
const { data: config } = useSWR<FrigateConfig>("config");

// playback behavior
const tallVideo = useMemo(() => {
if (!config) {
return false;
}

return (
config.cameras[camera].detect.width /
config.cameras[camera].detect.height <
1
);
}, [camera, config]);

// controlling playback

const previewRef = useRef<HTMLVideoElement | null>(null);
Expand Down Expand Up @@ -123,12 +110,12 @@ export default function PreviewVideoPlayer({

return (
<div
className={`relative ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}
className={`relative w-full ${className ?? ""} ${onClick ? "cursor-pointer" : ""}`}
onClick={onClick}
>
<video
ref={previewRef}
className={`size-full rounded-2xl ${tallVideo ? "aspect-tall" : ""} bg-black`}
className={`size-full rounded-2xl bg-black`}
preload="auto"
autoPlay
playsInline
Expand Down

0 comments on commit ac85c3d

Please sign in to comment.