Skip to content

Commit

Permalink
fix: try to not use blob files
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou committed Sep 5, 2024
1 parent 5c44a4b commit f31b5f9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/components/webcams/streamers/Mjpegstreamer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

<script lang="ts">
import Component from 'vue-class-component'
import { Mixins, Prop, Ref, Watch } from 'vue-property-decorator'
import {Mixins, Prop, Ref, Watch} from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { GuiWebcamStateWebcam } from '@/store/gui/webcams/types'
import {GuiWebcamStateWebcam} from '@/store/gui/webcams/types'
import WebcamMixin from '@/components/mixins/webcam'
const CONTENT_LENGTH = 'content-length'
Expand Down Expand Up @@ -235,9 +235,7 @@ export default class Mjpegstreamer extends Mixins(BaseMixin, WebcamMixin) {
}
// we're done reading the jpeg. Time to render it.
const frame = URL.createObjectURL(new Blob([imageBuffer], { type: TYPE_JPEG }))
if (this.image) this.image.src = frame
this.image.onload = () => URL.revokeObjectURL(frame)
this.image?.src = 'data:image/jpeg;base64,' + btoa(String.fromCharCode.apply(null, imageBuffer))
this.frames++
contentLength = 0
bytesRead = 0
Expand Down

0 comments on commit f31b5f9

Please sign in to comment.