Switching cameras | What does Quagga.CameraAccess.release() do? #317
Replies: 2 comments
-
Thank you for filing an issue! Please be patient. :-) |
Beta Was this translation helpful? Give feedback.
-
Good question! If you call Quagga.stop() that will eventually call CameraAccess.release(). So, I believe a good way to do a switch, is to call Quagga.stop() then call Quagga.init() again with the new deviceId in the constraints. It might be possible to actually change the camera device on the fly, but I haven't done any research into how that might be achieveable. CameraAccess.release() calls stop() on the media track associated with the camera video, but calling it alone would not stop Quagga from trying to process (although I have no idea if it would just process an empty image, or if it would generate a bunch of runtime errors) |
Beta Was this translation helpful? Give feedback.
-
Hi!
This isn't necessarily an issue just a question about a few things.
Quagga.CameraAccess
functions and noticed there isrelease()
method. Just curious, what does this do? Does this stop the previous camera session? If that is the case, would I call this function before changing/updating anything in theinputStream
(e.gconstraints.width
andconstraints.height
)? I tried looking at the examples in the repo but couldn't seem to find it being used in the live stream example and I couldn't find much documentation about it either.deviceId
in theinputStream
when the user selects a different camera. Similar to the question above, would I just stop the previous quagga session (by callingQuagga.CameraAccess.release()
orQuagga.stop()
) and then callQuagga.init()
with the updatedinputStream
?Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions