UIImagePickerController conflicts with AVCaptureSession video preview

I have AVCaptureVideoPreviewLayerand AVCaptureSessionto display a preview of the video on the screen.

Separately, I have UIImagePickerControllerto capture images (using UIImagePickerControllerOriginalImage).

My problem is that when I take a picture with UIImagePickerController, watching the video AVCaptureSessionfreezes.

How to prevent the preview of the video when I take a picture with UIImagePickerController?

+4
source share
1 answer

PBJViewcontroller, viewcontroller.

:

[self rejectViewControllerAnimated: YES : nil];

UIView * movieVW = [[UIView alloc] initWithFrame: CGRectMake (0,44, 1024, 724)];

[previewBaseView addSubview: movieVW];

_videoPlayerController = [[PBJVideoPlayerController alloc] init];

_videoPlayerController.delegate = self;

_videoPlayerController.view.frame = movieVW.frame;

 NSString *myString = [outputURL absoluteString];

_videoPlayerController.videoPath = myString;

 [previewBaseView addSubview:_videoPlayerController.view];
+1

All Articles