0

I'm using the Apple's sample code for AVFoundation, here, https://developer.apple.com/library/ios/samplecode/AVCam/AVCam.zip

I've go through the many threads and beat my mind with google too but that doesn't help.

iPhone AVFoundation camera orientation

iOS AVFoundation Video Capture Orientation Options

Force camera view in landscape with orientation lock on

Orientation deprecated in iOS 6

Wired behaviour of UIImagePickerController while capturing photo this was my previous question for the same error but with UIImagePickerController then I decide to use AVFoundation functions.

See the (error) screenshot,

enter image description here

It started the camera in portrait and wrong camera preview.

Note, setting orientation in code doesn't help. That only rotated (wrongly) camera preview.

Any help/suggestion?

Community
  • 1
  • 1
Hemang
  • 26,840
  • 19
  • 119
  • 186

1 Answers1

0

Make sure that your project allows both Potrait and Landscape mode, You can't handle the UIImagpickerController only in landscape mode on iPhone

go through this in Developer forum:

https://developer.apple.com/library/ios/documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html#//apple_ref/doc/uid/TP40007070-CH3-DontLinkElementID_1

Important: The UIImagePickerController class supports portrait mode only. This class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified, with one exception. You can assign a custom view to the cameraOverlayView property and use that view to present additional information or manage the interactions between the camera interface and your code.

Geet
  • 2,427
  • 2
  • 21
  • 39
  • thanks for answer, but I'm aware of this. That's why I'm switching to `AV Foundation` framework. Anyways I asked a question on that too. Just for your reference, [you can check that here](http://stackoverflow.com/questions/24409530/wired-behaviour-of-uiimagepickercontroller-while-capturing-photo). – Hemang Jun 26 '14 at 10:34