From 64140891a3646a88a79ad9bc786b19e29e268c20 Mon Sep 17 00:00:00 2001 From: Stefan Dej Date: Thu, 5 Sep 2024 13:14:59 +0200 Subject: [PATCH] fix: fix type error --- src/components/webcams/streamers/Mjpegstreamer.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/webcams/streamers/Mjpegstreamer.vue b/src/components/webcams/streamers/Mjpegstreamer.vue index 949a4aa6a..d971c0761 100644 --- a/src/components/webcams/streamers/Mjpegstreamer.vue +++ b/src/components/webcams/streamers/Mjpegstreamer.vue @@ -235,7 +235,9 @@ export default class Mjpegstreamer extends Mixins(BaseMixin, WebcamMixin) { } // we're done reading the jpeg. Time to render it. - this.image?.src = 'data:image/jpeg;base64,' + btoa(String.fromCharCode.apply(null, imageBuffer)) + if (this.image) { + this.image.src = 'data:image/jpeg;base64,' + btoa(Array.from(imageBuffer).map(byte => String.fromCharCode(byte)).join('')) + } this.frames++ contentLength = 0 bytesRead = 0