1

Hi I am trying to switch between the rear and front facing cameras if i start he session with the front facing camera it works but with the other way way round the AVCapturepreview layer is not visible and just presents a blank screen.

Crashalot
  • 33,605
  • 61
  • 269
  • 439
blueStar
  • 293
  • 4
  • 16

1 Answers1

3

First stop the preview session. When stopped (use the delegate for this) set the camera device you want and restart the preview session. In code:

[[PBJVision sharedInstance] stopPreview];
//implement the following deluge ate
- (void)visionSessionDidStopPreview:(PBJVision *)vision{

vision.cameraDevice = PBJCameraDeviceFront;
[vision startPreview];
}
Mike242424
  • 46
  • 2