simplify controller state

This commit is contained in:
Josh Hawkins 2024-03-13 22:13:15 -05:00
parent c3fc20129a
commit 7957315e3f
2 changed files with 2 additions and 6 deletions

View File

@ -9,7 +9,6 @@ export class DynamicVideoController {
public camera = "";
private playerController: HTMLVideoElement;
private previewController: PreviewController;
private isScrubbing: boolean;
private setFocusedItem: (timeline: Timeline) => void;
private playerMode: PlayerMode = "playback";
@ -24,7 +23,6 @@ export class DynamicVideoController {
previewController: PreviewController,
annotationOffset: number,
defaultMode: PlayerMode,
isScrubbing: boolean,
setFocusedItem: (timeline: Timeline) => void,
) {
this.camera = camera;
@ -32,7 +30,6 @@ export class DynamicVideoController {
this.previewController = previewController;
this.annotationOffset = annotationOffset;
this.playerMode = defaultMode;
this.isScrubbing = isScrubbing;
this.setFocusedItem = setFocusedItem;
}
@ -122,7 +119,7 @@ export class DynamicVideoController {
this.previewController.setNewPreviewStartTime(time);
}
if (scrubResult && this.playerMode != "scrubbing" && !this.isScrubbing) {
if (scrubResult && this.playerMode != "scrubbing") {
this.playerMode = "scrubbing";
this.playerController.pause();
}

View File

@ -68,8 +68,7 @@ export default function DynamicVideoPlayer({
playerRef.current,
previewController,
(config.cameras[camera]?.detect?.annotation_offset || 0) / 1000,
"playback",
isScrubbing,
isScrubbing ? "scrubbing" : "playback",
setFocusedItem,
);
// we only want to fire once when players are ready