Skip to content

Commit

Permalink
Define video filename on recording start
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Nov 24, 2023
1 parent 60b4ee7 commit ef9253a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/mini-widgets/MiniVideoRecorder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ const startRecording = async (): Promise<SweetAlertResult | void> => {
}
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[] = []
Expand All @@ -191,7 +192,6 @@ const startRecording = async (): Promise<SweetAlertResult | void> => {
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 = []
Expand Down

0 comments on commit ef9253a

Please sign in to comment.