Skip to content

Commit

Permalink
Offer download of video recording backups if they are available
Browse files Browse the repository at this point in the history
Remove them, independently if they were downloaded or not.
  • Loading branch information
rafaellehmkuhl committed Nov 21, 2023
1 parent 370678e commit 7c1dfda
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/mini-widgets/MiniVideoRecorder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> => {
Expand Down

0 comments on commit 7c1dfda

Please sign in to comment.