diff --git a/web/src/components/camera/CameraImage.tsx b/web/src/components/camera/CameraImage.tsx index ab0bfdf08..3a8c0554f 100644 --- a/web/src/components/camera/CameraImage.tsx +++ b/web/src/components/camera/CameraImage.tsx @@ -24,6 +24,7 @@ export default function CameraImage({ const { name } = config ? config.cameras[camera] : ""; const enabled = config ? config.cameras[camera].enabled : "True"; + const [isPortraitImage, setIsPortraitImage] = useState(false); useEffect(() => { if (!config || !imgRef.current) { @@ -40,11 +41,15 @@ export default function CameraImage({ {enabled ? ( { setHasLoaded(true); if (onload) { + if (imgRef.current) { + const { naturalHeight, naturalWidth } = imgRef.current; + setIsPortraitImage(naturalHeight > naturalWidth); + } onload(); } }} diff --git a/web/src/components/player/MsePlayer.tsx b/web/src/components/player/MsePlayer.tsx index 222f2ebcd..63f78006f 100644 --- a/web/src/components/player/MsePlayer.tsx +++ b/web/src/components/player/MsePlayer.tsx @@ -215,8 +215,7 @@ function MSEPlayer({ } } } catch (e) { - // eslint-disable-next-line no-console - console.debug(e); + // no-op } }); @@ -233,8 +232,7 @@ function MSEPlayer({ try { sb?.appendBuffer(data); } catch (e) { - // eslint-disable-next-line no-console - console.debug(e); + // no-op } } };