mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-09 04:35:25 +03:00
simplify controller state
This commit is contained in:
parent
c3fc20129a
commit
7957315e3f
@ -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();
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user