mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
fix overflowing camera image and remove mse console debug
This commit is contained in:
parent
a3267f7d44
commit
efde23ed81
@ -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 ? (
|
||||
<img
|
||||
ref={imgRef}
|
||||
className="object-contain rounded-lg md:rounded-2xl"
|
||||
className={`object-contain ${isPortraitImage ? "h-full w-auto" : "w-full h-auto"} rounded-lg md:rounded-2xl`}
|
||||
onLoad={() => {
|
||||
setHasLoaded(true);
|
||||
|
||||
if (onload) {
|
||||
if (imgRef.current) {
|
||||
const { naturalHeight, naturalWidth } = imgRef.current;
|
||||
setIsPortraitImage(naturalHeight > naturalWidth);
|
||||
}
|
||||
onload();
|
||||
}
|
||||
}}
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user