ios - UIImagePickerController - turn video preview to landscape -
I am currently developing an application to record and edit the video. The hole application only supports landscape mode - so I would like to use the camera controls in the landscape but the preview screen always switches back to the portrait
I tried several ways: < P> I first saw <:> Result: Then I did use code: Result: Even when I changed the camera to preview and detected the event ] Orientation) == UINPerface Orientation Landscape Right) {Self camera UI. V.w.transform = caffeine transformmecotation (mopi_2); } And if ([[UIDwise current device] orientation) == UINPerfaceAuthentication Landscape Lift) {Self camera UI.Resforms = CGFin Transcnet Mactotation (MGII); } If (IS_WIDESCREEN) {self.cameraUI.view.frame = CGRectMake (0, 0, 568, 320); } Other {self.cameraUI.view.frame = CGRectMake (0, 0, 480, 320); }} Result: I would be really grateful for any hints or suggestions on how I can use the camera and preview in landscape mode, so that I can use my hole application without turning the device in the process (device In the tripod, while the app is used, it can not be turned on ) Thanks and good luck! UIImage Picker View here can not be used only in landscape mode What does it say about apples? Important: UIImagePickerController class only supports portrait mode. This class is intended to be used and does not support subclassing. The visual hierarchy for this class is private and should not be modified with an exception. You can provide a custom view in the camera overlay property and use that scene to present additional information or to manage the interaction between the camera interface and your code. You can read more about this here UIImagePickerController - Preview was ok because I want, but the video image (during recording) was wrong (again).
- (BOOL) StartCameraController {if ([UIImagePickerControllerSourceType is available: UIImagePickerControllerSourceTypeCamera] == No) {Not return; } Self.cameraUI = [[UIImagePickerController alloc] init]; Self.cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera; Self.cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, zero]; Self.cameraUI.allowsEditing = No; Self.cameraUI.delegate = self.parentViewController; [Self.parentViewController addChildViewController: self.cameraUI]; Self.cameraUI.view.frame = CGRectMake (0, 0, self.frame.size.width, self.frame.size.height); [Self.parentViewController.view addSubview: self.cameraUI.view]; Yes come back }
presentViewController to show the
UIImagePickerController - camera recording completely Works fine, but the preview screen is in the picture and I have to turn on my device to work with it.
- (BOOL) startCameraController {if ([UIImagePickerControllerSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera] == No) {Not return; } Self.cameraUI = [[UIImagePickerController alloc] init]; Self.cameraUI.sourceType = UIImagePickerControllerSourceTypeCamera; Self.cameraUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, zero]; Self.cameraUI.allowsEditing = No; Self.cameraUI.delegate = self.parentViewController; [Self.parentViewController presentViewController: self.cameraUI Animated: Yes Completed: ^ {}]; Yes come back }
_UIImagePickerControllerUserDidCaptureItem Manually set the view on - but I want to customize the frame dimensions of the preview scene. Shm was not.
Comments
Post a Comment