moaazsidat / react-native-qrcode-scanner

A QR code scanner component for React Native.
MIT License
2.03k stars 513 forks source link

Camera preview blacks out after repeated scans #328

Open Balthazar33 opened 3 years ago

Balthazar33 commented 3 years ago

What's happening?

The camera view turns black after repeatedly scanning codes (after about three-four attempts)

How can it be reproduced?

Tried

 <QRCodeScanner
                                onRead={(e) => onSuccess(e)}
                                reactivate={false}
                                showMarker={true}
                                reactivateTimeout={5000}
                            />

and

<QRCodeScanner
                                onRead={(e) => onSuccess(e)}
                                reactivate={true}
                                showMarker={true}
                            />

Build details?

Android 10 react-native-qrcode-scanner : 1.5.4 RN: 0.63.4

Balthazar33 commented 3 years ago

On setting the cameraTimeoutprop to a few milliseconds (10000), the camera times out and the message ''Tap to reactivate camera" pops up on the screen. On clicking the pop-up, the camera preview becomes visible again. Is there any way to programmatically call the cameraTimeoutmethod? Also, is there a way to add a listener to the function (which will be called when the screen is tapped.) ?