Live view tweaks and jsmpeg bugfix (#11584)

* live view tweaks and jsmpeg bugfix

* use container aspect in check
This commit is contained in:
Josh Hawkins
2024-05-28 08:11:35 -05:00
committed by GitHub
parent 6913cc6abc
commit 4165639308
3 changed files with 65 additions and 87 deletions

View File

@@ -77,7 +77,7 @@ export default function JSMpegPlayer({
const video = new JSMpeg.VideoElement(
playerRef.current,
url,
{ canvas: "#video-canvas" },
{ canvas: `#${camera}-canvas` },
{ protocols: [], audio: false, videoBufferSize: 1024 * 1024 * 4 },
);
@@ -90,13 +90,13 @@ export default function JSMpegPlayer({
playerRef.current = null;
}
};
}, [url]);
}, [url, camera]);
return (
<div className={className} ref={internalContainerRef}>
<div ref={playerRef} className="jsmpeg">
<canvas
id="video-canvas"
id={`${camera}-canvas`}
style={{
width: scaledWidth ?? width,
height: scaledHeight ?? height,