react-native-camera icon indicating copy to clipboard operation
react-native-camera copied to clipboard

Preview on android doesn't show up right away

Open bvv218 opened this issue 8 years ago • 3 comments

When picture is taken on android, you can still take another picture until preview is shown up. It takes around 4 seconds before the preview is shown. I have been using <Camera> as well as <RNCamera> and this issue persists on both of them. This doesn't happen on iOS. Here is what I currently have:

renderCamera() {
    return ( 
      <RNCamera
        ref={(cam) => {
          this.camera = cam;
        }}
        captureQuality={RNCamera.constants.CaptureQuality.high}    
        playSoundOnCapture={false}
        aspect={RNCamera.constants.Aspect.fill} 
        captureTarget={RNCamera.constants.CaptureTarget.temp} 
        touchToFocus={true}
        defaultOnFocusComponent={true}
         onFocusChanged={() => {console.log("focusChanged");}}
        cropToPreview={true}
            >
             </RNCamera>
<TouchableOpacity 
            onPress={() => {
            this.takePicture(); 
            }} 
            >
        <Icon 
        name="camera"   
        size={40}  
        style={styles.icon} 
        />
        </TouchableOpacity>
)
}

...

  takePicture() {
    this.camera.capture()
      .then((data) => {console.log(data);
        this.setState({ path: data.path});
      })
      .catch(err => console.error(err));
  }

...

 renderImage() {
    return (
        <Image
          source={{
            uri: this.state.path }}  
        />
)
}

bvv218 avatar Jan 22 '18 18:01 bvv218

+1

ejswenson15 avatar Feb 20 '18 00:02 ejswenson15

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and i will leave this open.

stale[bot] avatar Jun 01 '19 04:06 stale[bot]

Closing this issue after a prolonged period of inactivity. Fell free to reopen this issue, if this still affecting you.

stale[bot] avatar Jun 08 '19 05:06 stale[bot]