How to turn the camera light (torch) off?
Asked Answered
M

0

10

I'm creating an app to read barcodes. I'm using QuaggaJS as a barcode reader library. My problem is that I can turn the torch on, but I can't turn it off.

var track = Quagga.CameraAccess.getActiveTrack();
track.applyConstraints({advanced: [{torch:true}]}); //Torch is on
track.applyConstraints({advanced: [{torch:false}]}); //Torch still on :(

Is there a way to turn the torch off?

Monophyletic answered 16/2, 2019 at 19:9 Comment(2)
did you manage to find a solution ?Scapular
The stream restart is only the trick that helped me to overcome this issue (android 8 xiaomi)Rothschild

© 2022 - 2024 — McMap. All rights reserved.