In my application,I want to open the camera in Video mode.So I write the following codes
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[window addSubview:viewController.view];
[window makeKeyAndVisible];
UIImagePickerController *ipc;
ipc = [[UIImagePickerController alloc] init];
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.mediaTypes = [NSArray arrayWithObject:(NSString *) kUTTypeMovie];
[viewController presentModalViewController:ipc animated:YES];
return YES;
}
This code is good for iPhone 3.1.3 but, on iOS4 does not work. Can I use UIImagePickerController as a Video on iOS4?
I'm new on iphone develop but i had the same problem and I solved that problem setting the mediaTypes like this
NSArray* mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]
ipc.mediaTypes = mediaTypes;
This allow you to have acces to the video and photo, i hope this help you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With