fix(android): stop preview if pauseAfterCapture is set to true (#1933)

Fixes #1930
This commit is contained in:
SimonErm 2018-11-20 13:29:45 +01:00 committed by Laurin Quast
parent bc3d86a686
commit 71b10c1ac8

View File

@ -410,10 +410,15 @@ class Camera1 extends CameraViewImpl implements MediaRecorder.OnInfoListener,
if (options.hasKey("pauseAfterCapture") && !options.getBoolean("pauseAfterCapture")) {
camera.startPreview();
mIsPreviewActive = true;
if (mIsScanning) {
camera.setPreviewCallback(Camera1.this);
}
}else{
camera.stopPreview();
mIsPreviewActive = false;
camera.setPreviewCallback(null);
}
if (mIsScanning) {
camera.setPreviewCallback(Camera1.this);
}
mCallback.onPictureTaken(data);
}
});