How to select and record video using UIImagePickerController for iPhone?

I want to select iPhone video for my application to download on the Internet. I am using UIImagePickerController for this.

To select a choice

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil]; [self presentModalViewController:imagePicker animated:YES]; 

It opens a library of photos and displays only content such as video.
Now I have the following questions:

  • How to get a video when I select a video, then it is ready to play, and then when I press the select button, then nothing is compressed. Even I can’t cancel it.
  • Since we have separate folders in the iphone, how do we open the video folder?

If I can choose, how can I get the video details as a delegation method

 - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo { 

and has the parameter (UIImage *) img . How to get it as a video?

+2
objective-c cocoa-touch uiimagepickercontroller
source share
1 answer

You are using the wrong delegate method. iOS 3.0 introduced imagePickerController:didFinishPickingMediaWithInfo: to replace imagePickerController:didFinishPickingImage:editingInfo: This new method gets an NSDictionary that contains several key-value pairs associated with the selected image / video; in your case you need to check the value for UIImagePickerControllerMediaURL .

+2
source share

All Articles