Select video using UIImagePickerController in 2G / 3G

I encountered a problem in which I cannot select a video from a photo album in an iPhone 2G / 3G device. The default photo app does show videos and can play them, which in turn means that the UIImagePickerController must clearly show the videos in the photo album and select them.

I encoded this to determine if the device is able to snap a photo, record a video, select photos and select a video:

// Check if camera and video recording are available: [self setCameraAvailable:NO]; [self setVideoRecordingAvailable:NO]; [self setPhotoSelectionAvailable:NO]; [self setVideoSelectionAvailable:NO]; // For live mode: NSArray *availableTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera]; NSLog(@"Available types for source as camera = %@", availableTypes); if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { if ([availableTypes containsObject:(NSString*)kUTTypeMovie]) [self setVideoRecordingAvailable:YES]; if ([availableTypes containsObject:(NSString*)kUTTypeImage]) [self setCameraAvailable:YES]; } // For photo library mode: availableTypes = [UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; NSLog(@"Available types for source as photo library = %@", availableTypes); if ([availableTypes containsObject:(NSString*)kUTTypeImage]) [self setPhotoSelectionAvailable:YES]; if ([availableTypes containsObject:(NSString*)kUTTypeMovie]) [self setVideoSelectionAvailable:YES]; 

Received logs for a 3G device are as follows:

 2010-05-03 19:09:09.623 xyz [348:207] Available types for source as camera = ( "public.image" ) 2010-05-03 19:09:09.643 xyz [348:207] Available types for source as photo library = ( "public.image" ) 

As the state of the logs for the photo library, the equivalent of the kUTTypeMovie string is not available and therefore the UIImagePickerController does not appear (or rather excludes, if we install an array of source types, which includes kUTTypeMovie) movie files in the photo library.

I have not tested 3GS, but I am sure that this problem does not exist in it with reference to other streams.

I created an application for 3.0 (the base SDK) and 3.1, but with the same results.

This issue has already been discussed in the thread: http://www.iphonedevsdk.com/forum/iphone-sdk-development/36197-uiimagepickercontroller-does-not-show-movies-albums.html

But this does not seem to be the solution.

Any solutions to this problem?

Thanks and Regards, Raj Pavan

+5
iphone cocoa-touch uiimagepickercontroller
source share
3 answers

Since videos are always compressed after selection (raw VCR files are very large), and 2G / 3G models that are not capable of h.264 hardware encoding / decoding left them outside the UIImagePickerController API. This is unfortunate, since we all would like to select videos on these devices.

+5
source share

The default photo app shows videos and can play them

But how did you test this? 2G / 3G cannot record video. Therefore, you cannot place video files in the image picker. Or am I wrong?

The documentation explicitly states: "Because the media source may or may not be available, devices may not always support all types of sources." Therefore, the iPhone OS suggests that there can be no films and does not allow them to choose. I think so.

+3
source share

On ON 3GS, its performance is great and the 3Gs thing unfolded after SDK 3.1, so 3.0 has no processing for video-related things ..!

0
source share

All Articles