diff --git a/src/components/mini-widgets/MiniVideoRecorder.vue b/src/components/mini-widgets/MiniVideoRecorder.vue index f06607f33..aeb8569cc 100644 --- a/src/components/mini-widgets/MiniVideoRecorder.vue +++ b/src/components/mini-widgets/MiniVideoRecorder.vue @@ -118,6 +118,16 @@ onBeforeMount(async () => { } } addScreenStream() + + const videoKeys = await cockpitVideoDB.keys() + videoKeys.forEach(async (savedVideoName) => { + const videoBlobArray: Blob[] = (await cockpitVideoDB.getItem(savedVideoName)) as Blob[] + const blob = videoBlobArray.reduce((a, b) => new Blob([a, b], { type: 'video/webm' })) + fixWebmDuration(blob, Date.now() - timeRecordingStart.value.getTime()).then((fixedBlob) => { + saveAs(fixedBlob, savedVideoName) + }) + await cockpitVideoDB.removeItem(savedVideoName) + }) }) const toggleRecording = async (): Promise => {