The above sample code example works fine. But you need to replace yourself. interfaceOrientation with AVCaptureVideoOrientation.
The edited code is as follows.
if ([captureVideoPreviewLayer.connection isVideoOrientationSupported]) { [captureVideoPreviewLayer.connection setVideoOrientation:AVCaptureVideoOrientationPortrait]; }
Depending on the requirement, the orientation will look like portrait or landscape.
Updates and suggestions are welcome.
i 4322946
source share