views:

230

answers:

3

I'm using UIImagePickerController to allow my user to select a video from the asset library.

When the UIImagePickerController is initially displayed, it shows thumbnails for the various movies that have been recorded.

Once the user selects a movie, it displays a "preview" view which allows them to playback and potentially edit the selected movie.

Is there any way to avoid displaying this view and instead return the movie that was selected on the thumbnail screen?

Here is the code I'm using:

UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.mediaTypes = [NSArray arrayWithObject:(NSString *)kUTTypeMovie];
imagePicker.allowsEditing = NO;

[self presentModalViewController:imagePicker animated:YES];
A: 

Check to make sure allowsEditing is set to NO (which is the default).

progrmr
allowsEditing is set to NO, but the preview is still displayed.
Avalanchis
A: 

I'm also having that same problem. any ideas?

Bernardo Assis
This should be added as a comment to the original question, not as an answer.
Avalanchis
+1  A: 

I haven't tested this myself, though I'll be attempting this in my own application shortly. If you take a look at the UIImagePickerController showsCameraControls documentation, it alludes to the fact that if you eliminate the camera controls you can take as many photos as you want.

So theoretically if you set showsCameraControls to NO, and assign your own cameraOverlayView UIView to let the user take a photo, you can dismiss the image picker without the preview view from showing.

Michael Nachbaur
I've tested this on my own project, and I can verify that this indeed works. I take a picture using my own custom control, the camera makes the standard "ClicK" sound, but no shutter image comes up, and no preview is shown.
Michael Nachbaur