From 0136bad79967f1309d37a20629efc49041eccd33 Mon Sep 17 00:00:00 2001 From: Arturo M Date: Wed, 13 Mar 2024 14:34:03 -0300 Subject: [PATCH] video: add state variable & visual feedback to monitor video processing --- .../mini-widgets/MiniVideoRecorder.vue | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/components/mini-widgets/MiniVideoRecorder.vue b/src/components/mini-widgets/MiniVideoRecorder.vue index b3607f1e7..7f9a51022 100644 --- a/src/components/mini-widgets/MiniVideoRecorder.vue +++ b/src/components/mini-widgets/MiniVideoRecorder.vue @@ -4,10 +4,17 @@ class="flex justify-around px-2 py-1 text-center rounded-lg h-9 w-28 align-center bg-slate-800/60" >
+
+ mdi-loading +
-
+
{{ timePassedString }}
+
+
Processing video...
+
@@ -90,6 +100,7 @@ const isStreamSelectDialogOpen = ref(false) const isLoadingStream = ref(false) const timeNow = useTimestamp({ interval: 100 }) const mediaStream = ref() +const isProcessingVideo = ref(false) onBeforeMount(async () => { // Set initial widget options if they don't exist @@ -128,6 +139,7 @@ const toggleRecording = async (): Promise => { if (isRecording.value) { if (nameSelectedStream.value !== undefined) { videoStore.stopRecording(nameSelectedStream.value) + isProcessingVideo.value = true } return } @@ -215,6 +227,14 @@ if (widgetStore.isRealMiniWidget(miniWidget.value)) { } onBeforeUnmount(() => clearInterval(streamConnectionRoutine)) +// Check if there are videos being processed +watch( + () => videoStore.areThereVideosProcessing, + (newValue) => { + isProcessingVideo.value = newValue + } +) + // Try to prevent user from closing Cockpit when a stream is being recorded watch(isRecording, () => { if (!isRecording.value) {