Open drigos opened 4 years ago
Same question - how to turn off/on camera?
@drigos @yeungma What do you mean by that? Do you want to stops video stream? OR phyisycally turn camera off?
Hi, I don't know how to turn off camera by code. Just can do that by closing the app or browser tab.
On Wed, Nov 4, 2020, 01:40 Ruslan Kyba notifications@github.com wrote:
@drigos https://github.com/drigos @yeungma https://github.com/yeungma What do you mean by that? Do you want to stops video stream? OR phyisycally turn camera off?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kybarg/react-qr-scanner/issues/21#issuecomment-721277943, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQJNB3LGNFANDJ7KIIFX7LSOA6CFANCNFSM4M5T7MTQ .
The cam turn off when you unmount component
this works for me in my react project
set a hook eg. const [camera, setCamear] = useState(false);
assign a button to toggle this hook, then use this hook to control 《QrReader》 in the render section {camera && 《QrReader》 }
Is there a way to turn camera off and on?