Skip to content

Commit 841dffd

Browse files
fix: BROS-669: Fix stuck regions when quickly scrubbing through the video via seeker (#9027)
1 parent 812f61c commit 841dffd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

web/libs/editor/src/tags/object/Video/VideoRegions.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,18 @@ const VideoRegionsPure = ({
238238
};
239239

240240
const RegionsLayer = observer(({ regions, item, locked, isDrawing, workinAreaCoordinates, stageRef, onDragMove }) => {
241+
// Access item.frame here to ensure the observer tracks frame changes
242+
// This ensures regions update correctly during fast scrubbing
243+
const frame = item.frame;
244+
241245
return (
242246
<>
243247
{regions.map((reg) => (
244248
<Shape
245249
id={reg.id}
246250
key={reg.id}
247251
reg={reg}
248-
frame={item.frame}
252+
item={item}
249253
workingArea={workinAreaCoordinates}
250254
draggable={!reg.isReadOnly() && !isDrawing && !locked}
251255
selected={reg.selected || reg.inSelection}
@@ -258,7 +262,11 @@ const RegionsLayer = observer(({ regions, item, locked, isDrawing, workinAreaCoo
258262
);
259263
});
260264

261-
const Shape = observer(({ id, reg, frame, stageRef, ...props }) => {
265+
const Shape = observer(({ id, reg, item, stageRef, ...props }) => {
266+
// Access item.frame directly inside the observer to ensure MobX tracks it
267+
// Even though frame is volatile, accessing it here ensures the observer
268+
// will re-render when frame changes during fast scrubbing
269+
const frame = item.frame;
262270
const box = reg.getShape(frame);
263271

264272
return (

0 commit comments

Comments
 (0)