Full screen AvCapture session in iphone 4s

I am developing an AvCapture session to add camera overlays on the camera screen. I added AvCaptureVidePreview layer as

AvCaptureVideoPreviewLayer*layer = [[AvCaptureVideoPreviewLayer alloc] iniWithSession:session];
layer.frame = self.view.layer.bounds;

      

but the camera preview is not full screen in case of iPhone 4S. It works great on iPhone 5.

+3


source to share


1 answer


CGRect bounds=view.layer.bounds;
layer.videoGravity = AVLayerVideoGravityResizeAspectFill;
layer.bounds=bounds;
layer.position=CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds));

      



maybe it can help you ..

+5


source







All Articles