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
iphone cocoa-touch uiimagepickercontroller
Raj pawan gumdal
source share