diff --git a/Source/CameraPreview.Droid/CameraController.cs b/Source/CameraPreview.Droid/CameraController.cs index 16e57fb..e924832 100644 --- a/Source/CameraPreview.Droid/CameraController.cs +++ b/Source/CameraPreview.Droid/CameraController.cs @@ -104,7 +104,13 @@ private void SetUpCameraOutputs(int width, int height) // We don't use a front facing camera in this sample. var facing = (Integer)characteristics.Get(CameraCharacteristics.LensFacing); - if (facing != null && facing == (Integer.ValueOf((int)LensFacing.Front))) + if (facing != null && facing == (Integer.ValueOf((int)LensFacing.Front)) && + !CameraPreviewSettings.Instance.ScannerOptions.UseFrontCameraIfAvailable.GetValueOrDefault()) + { + continue; + } + if (CameraPreviewSettings.Instance.ScannerOptions.UseFrontCameraIfAvailable.GetValueOrDefault() && + facing != null && facing != (Integer.ValueOf((int)LensFacing.Front))) { continue; }