Non alert videos are always 16:9

This commit is contained in:
Nicolas Mowen 2024-09-12 12:46:06 -06:00
parent 097d539377
commit 8f8fcccfc3

View File

@ -91,13 +91,17 @@ export function AnimatedEventCard({
const [alertVideos] = usePersistence("alertVideos", true); const [alertVideos] = usePersistence("alertVideos", true);
const aspectRatio = useMemo(() => { const aspectRatio = useMemo(() => {
if (!config || !Object.keys(config.cameras).includes(event.camera)) { if (
!config ||
!alertVideos ||
!Object.keys(config.cameras).includes(event.camera)
) {
return 16 / 9; return 16 / 9;
} }
const detect = config.cameras[event.camera].detect; const detect = config.cameras[event.camera].detect;
return detect.width / detect.height; return detect.width / detect.height;
}, [config, event]); }, [alertVideos, config, event]);
return ( return (
<Tooltip> <Tooltip>