I am using react-native-camera-hooks in my app, but it takes forever to get a photo from the camera. In the code below, takePicture() promise takes about 15 seconds to resolve. It takes no time to take photo from native camera on the same phone. What am I doing wrong here?
import { useCamera } from 'react-native-camera-hooks'
const [{cameraRef}, {takePicture}] = useCamera(null);
const handleCapture = async () => {
var options = { base64: true, fixOrientation: true, quality: 0.4, skipProcessing: true };
try {
const data = await takePicture(options);
} catch (error) {
console.log(error)
}
}
<RNCamera
ref={cameraRef}
type={cameraType}
style={styles.cameraPreview}
captureAudio={false}
flashMode={flashMode}
>
<TouchableOpacity onPress={handleCapture} />
</RNCamera>
from RN camera realy slow
No comments:
Post a Comment