I am using splitviewcontroller
for my ipad application in which I need to capture video in the detailViewController
in a dimension of 530 px width
I just found a possible way to resize UIImagPickerController video capture interface on iPad. The basic idea is to use UIPopoerController's dimension to resize the UIImagPickerController's view and then add it to your custom view.
The detailed code and description are listed below:
//In the following code, videoRecorder is an UIImagPickerController
//1. Create a container view controller and load UIImagPickerController's view
UIViewController *containerController = [[UIViewController alloc] init];
containerController.contentSizeForViewInPopover = CGSizeMake(320, 240);
[containerController.view addSubview:videoRecorder.view];
//2. Add the container view controller in a UIPopoerController and present the popover outside the visible area on the screen (you can't see it but the popover was presented)
popoverView = [[UIPopoverController alloc] initWithContentViewController:containerController];
popoverView.passthroughViews = [NSArray arrayWithObjects:self.view, nil];
[popoverView setPopoverContentSize:CGSizeMake(320, 240)];
[popoverView presentPopoverFromRect:CGRectMake(0, -1024, 1, 1) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
//3. Reset the frame of UIImagPickerController's view to meet the frame of its container - this is important to resize the UIImagPickerController's view and must do this step after the popover was presented.
[videoRecorder.view setFrame:containerController.view.frame];
//4. Add the container view controller's view to your custom view - in this example, it is 'camView' with the size 320 x 240
[camView addSubview:containerController.view];
Note : when you finish video capture or cancel it, you need to dismiss the popover and remove the container's view from your custom view.
[popoverView dismissPopoverAnimated:YES];
[[camView.subviews lastObject] removeFromSuperview];