From 127c00bfd3f0dd655a4aff3d13601c46039bfb2a Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 27 Feb 2026 14:43:20 +0800 Subject: [PATCH] bugfix --- bricks/recorder.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bricks/recorder.js b/bricks/recorder.js index d0c6725..9621e77 100644 --- a/bricks/recorder.js +++ b/bricks/recorder.js @@ -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(){ - 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); + 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();