开发者

iOS4 UIImagePickerController doesn't suport mediaTypes = [NSArray arrayWithObject:(NSString *) kUTTypeMovie]?

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 UIImagePickerContr开发者_开发问答oller 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜