From ef9253a544085eda90fcdd7791be17763f85e63d Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Fri, 24 Nov 2023 15:25:45 -0300 Subject: [PATCH] Define video filename on recording start --- src/components/mini-widgets/MiniVideoRecorder.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/mini-widgets/MiniVideoRecorder.vue b/src/components/mini-widgets/MiniVideoRecorder.vue index 3a7ea2e9e..c49b237cb 100644 --- a/src/components/mini-widgets/MiniVideoRecorder.vue +++ b/src/components/mini-widgets/MiniVideoRecorder.vue @@ -183,6 +183,7 @@ const startRecording = async (): Promise => { } timeRecordingStart.value = new Date() + const fileName = `${missionName || 'Cockpit'} (${format(timeRecordingStart.value, 'LLL dd, yyyy - HH꞉mm꞉ss O')})` mediaRecorder.value = new MediaRecorder(mediaStream.value) mediaRecorder.value.start() let chunks: Blob[] = [] @@ -191,7 +192,6 @@ const startRecording = async (): Promise => { mediaRecorder.value.onstop = () => { const blob = new Blob(chunks, { type: 'video/webm' }) fixWebmDuration(blob, Date.now() - timeRecordingStart.value.getTime()).then((fixedBlob) => { - const fileName = `${missionName || 'Cockpit'} (${format(timeRecordingStart.value, 'LLL dd, yyyy - HH꞉mm꞉ss O')})` saveAs(fixedBlob, fileName) }) chunks = []