hide bounding boxes when playing

This commit is contained in:
Josh Hawkins 2025-10-16 14:26:54 -05:00
parent 0ebc9a2e92
commit 83354be7f6
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import { useTranslation } from "react-i18next";
type ObjectTrackOverlayProps = { type ObjectTrackOverlayProps = {
camera: string; camera: string;
selectedObjectId: string; selectedObjectId: string;
showBoundingBoxes?: boolean;
currentTime: number; currentTime: number;
videoWidth: number; videoWidth: number;
videoHeight: number; videoHeight: number;
@ -26,6 +27,7 @@ type ObjectTrackOverlayProps = {
export default function ObjectTrackOverlay({ export default function ObjectTrackOverlay({
camera, camera,
selectedObjectId, selectedObjectId,
showBoundingBoxes = false,
currentTime, currentTime,
videoWidth, videoWidth,
videoHeight, videoHeight,
@ -366,7 +368,7 @@ export default function ObjectTrackOverlay({
</Tooltip> </Tooltip>
))} ))}
{currentBoundingBox && ( {currentBoundingBox && showBoundingBoxes && (
<g> <g>
<rect <rect
x={currentBoundingBox.left * videoWidth} x={currentBoundingBox.left * videoWidth}

View File

@ -324,6 +324,7 @@ export default function HlsVideoPlayer({
key={`${selectedObjectId}-${currentTime}`} key={`${selectedObjectId}-${currentTime}`}
camera={camera} camera={camera}
selectedObjectId={selectedObjectId} selectedObjectId={selectedObjectId}
showBoundingBoxes={!isPlaying}
currentTime={currentTime} currentTime={currentTime}
videoWidth={videoDimensions.width} videoWidth={videoDimensions.width}
videoHeight={videoDimensions.height} videoHeight={videoDimensions.height}