WebUI Improvements and fixes (#9613)

* Show toast instead of text for success and errors

* Show correct times

* Start playing next hour when current hour ends

* Fix refreshing camera image

* Fix timeline
This commit is contained in:
Nicolas Mowen
2024-02-05 16:54:08 -07:00
committed by GitHub
parent 3df8b5829c
commit f4310862aa
10 changed files with 435 additions and 57 deletions

View File

@@ -228,6 +228,7 @@ export default function DynamicVideoPlayer({
player.on("timeupdate", () => {
controller.updateProgress(player.currentTime() || 0);
});
player.on("ended", () => controller.fireClipEndEvent());
if (onControllerReady) {
onControllerReady(controller);
@@ -284,6 +285,7 @@ export class DynamicVideoController {
// playback
private recordings: Recording[] = [];
private onPlaybackTimestamp: ((time: number) => void) | undefined = undefined;
private onClipEnded: (() => void) | undefined = undefined;
private annotationOffset: number;
private timeToStart: number | undefined = undefined;
@@ -393,6 +395,16 @@ export class DynamicVideoController {
this.onPlaybackTimestamp = listener;
}
onClipEndedEvent(listener: () => void) {
this.onClipEnded = listener;
}
fireClipEndEvent() {
if (this.onClipEnded) {
this.onClipEnded();
}
}
scrubToTimestamp(time: number) {
if (this.playerMode != "scrubbing") {
this.playerMode = "scrubbing";