fix: don't createObjectURL, when webcam img doesn't exist in Mjpegstreamer.vue (#834)
Signed-off-by: Stefan Dej <meteyou@gmail.com>
This commit is contained in:
parent
cc888a3924
commit
fd89ff7ba3
@ -148,8 +148,12 @@ export default class Mjpegstreamer extends Mixins(BaseMixin) {
|
|||||||
}
|
}
|
||||||
// we're done reading the jpeg. Time to render it.
|
// we're done reading the jpeg. Time to render it.
|
||||||
else {
|
else {
|
||||||
img.src = URL.createObjectURL(new Blob([imageBuffer], { type: TYPE_JPEG }))
|
if (img) {
|
||||||
img.onload = () => URL.revokeObjectURL(img.src)
|
img.src = URL.createObjectURL(
|
||||||
|
new Blob([imageBuffer], { type: TYPE_JPEG })
|
||||||
|
)
|
||||||
|
img.onload = () => URL.revokeObjectURL(img.src)
|
||||||
|
}
|
||||||
frames++
|
frames++
|
||||||
contentLength = 0
|
contentLength = 0
|
||||||
bytesRead = 0
|
bytesRead = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user