This commit is contained in:
yumoqing 2026-02-27 14:43:20 +08:00
parent a5365d5842
commit 127c00bfd3

View File

@ -244,12 +244,16 @@ bricks.SysVideoRecorder = class extends bricks.MediaRecorder {
this.fps_task = schedule_interval(this.show_picture.bind(this), this.fps_period);
}
async show_picture(){
try {
var blob = await this.imageCapture.takePhoto();
this.dataurl = URL.createObjectURL(blob);
this.imgfile = new File([blob],
'image.jpg',
{ type: 'image/jpeg' });
this.imgw.set_url(this.dataurl);
} catch(e){
console.error(e);
}
}
close_recorder(){
super.close_recorder();