react-qr-reader icon indicating copy to clipboard operation
react-qr-reader copied to clipboard

Torch not working

Open georgggg opened this issue 2 years ago • 4 comments

I am using the QrReader component successfully, but the torch (environment camera light) is not turning on when configured using the "constraints" prop of the component (tested Android and iOS devices). I am defining such property as follows:

constraints={{'torch' : true, facingMode: 'environment'}}

According to https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints the torch property should be a boolean value. Is this MediaTrack Constraint actually being taken care of in this component?

georgggg avatar Sep 21 '22 12:09 georgggg

same issue . I have tried

constraints={{ facingMode: "environment", advanced: [{ torch: true }] }}

but it doesn't work

danielmachado99 avatar Oct 14 '22 05:10 danielmachado99

Is there any update on this? I'm facing the same issue

geeekgod avatar Jan 09 '23 12:01 geeekgod

Is there any update on this? I'm facing the same issue

I've been doing research on this for about a week. I don't believe its possible with IOS from what I've read due to apple.

Webbwhite98 avatar Jan 09 '23 14:01 Webbwhite98

@Webbwhite98 According to my knowledge of MediaTrackConstraints torch property is not available in video tracks. I feel that's the reason we can't pass the torch as props in the QR reader component.

geeekgod avatar Jan 11 '23 14:01 geeekgod