Skip UIImagePickerController Preview View?
Asked Answered
F

2

11

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];
Furtek answered 1/7, 2010 at 12:30 Comment(3)
Still haven't found a solution to this. Anyone have any ideas?Furtek
Did you get any answers? I want to do the same thing.Drongo
Did anyone got the correct solution?Hereafter
H
5

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.

Heeley answered 15/9, 2010 at 17:15 Comment(2)
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.Heeley
This does not answer the question asked. The question is about selecting a video, not taking one. Plus, setting the showsCameraControls to false causes an exception is the sourceType is .PhotoLibraryKaufmann
S
0

Perhaps that helps. You could listen with the NSNotificationCenter on @"_UIImagePickerControllerUserDidCaptureItem". If the user select the item, you could dismiss the imagePicker and do your thumbnail stuff.

I had a similar issue, to remove an overlay on the preview view and could solve it with this approach.

Suilmann answered 27/5, 2014 at 22:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.