This commit is contained in:
yumoqing 2025-09-29 11:48:29 +08:00
parent 89a9baaa40
commit b115f2de65

View File

@ -126,10 +126,11 @@ bricks.Camera = class extends bricks.Popup {
}; };
this.mediaRecorder.onstop = () => { this.mediaRecorder.onstop = () => {
const blob = new Blob(this.recordedChunks, { type: 'video/webm' }); 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); const url = URL.createObjectURL(blob);
console.log('recorded url=', url); console.log('recorded url=', url);
this.recordedChunks = []; this.recordedChunks = [];
this.dispatch('recorded', url); this.dispatch('recorded', file);
console.log('record end') console.log('record end')
} }
this.mediaRecorder.start(); this.mediaRecorder.start();