diff --git a/bricks/camera.js b/bricks/camera.js index ee7c630..38d94cf 100644 --- a/bricks/camera.js +++ b/bricks/camera.js @@ -126,10 +126,11 @@ bricks.Camera = class extends bricks.Popup { }; this.mediaRecorder.onstop = () => { const blob = new Blob(this.recordedChunks, { type: 'video/webm' }); + const file = new File([blob], "recorded_video.webm", { type: "video/webm" }); const url = URL.createObjectURL(blob); console.log('recorded url=', url); this.recordedChunks = []; - this.dispatch('recorded', url); + this.dispatch('recorded', file); console.log('record end') } this.mediaRecorder.start();