Start at correct time of hour

This commit is contained in:
Nicolas Mowen 2024-03-08 10:21:06 -07:00
parent d82d403f72
commit 8d7ba46e4e
2 changed files with 11 additions and 2 deletions

View File

@ -173,7 +173,6 @@ export class PreviewVideoController {
newPlayback(newPlayback: PreviewPlayback) {
this.preview = newPlayback.preview;
this.seeking = false;
this.timeToSeek = undefined;
this.timeRange = newPlayback.timeRange;
}
@ -200,6 +199,10 @@ export class PreviewVideoController {
}
}
setNewPreviewStartTime(time: number) {
this.timeToSeek = time;
}
finishedSeeking() {
if (!this.previewRef.current || !this.preview) {
return;
@ -218,7 +221,10 @@ export class PreviewVideoController {
previewReady() {
this.seeking = false;
this.timeToSeek = undefined;
this.previewRef.current?.pause();
if (this.timeToSeek) {
this.finishedSeeking();
}
}
}

View File

@ -602,6 +602,9 @@ function MotionReview({
);
if (index != -1) {
Object.values(videoPlayersRef.current).forEach((controller) => {
controller.setNewPreviewStartTime(currentTime);
});
setSelectedRangeIdx(index);
}
return;