0

Is there a way to pick only landscape orientation videos from library in objective C ? Does the mediaTypes property has a way to pick only those vides that were recorded in landscape mode? Is there a way to show only landscape recorded videos from library in popOver? Or is there any workaround? This apple doc does not meet my requirement.

UIImagePickerController *mediaUI = [[UIImagePickerController alloc] init];
mediaUI.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;

mediaUI.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, nil]; //Any way to pick only landscape videos? Or is there any workaround?
mediaUI.allowsEditing = YES;
mediaUI.delegate = self;
self.popoverController = [[UIPopoverController alloc]
                                              initWithContentViewController:mediaUI];

self.popoverController.delegate = self;

[self.popoverController presentPopoverFromRect:CGRectMake(250, self.videoMenuView.frame.origin.y-10, 40, 40) inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES];
Deepak Thakur
  • 3,453
  • 2
  • 37
  • 65
  • calculate the width and height, if Width > height, obvioulsly the image is in landscape mode – Debanjan Chakraborty Nov 25 '14 at 10:24
  • @DebanjanChakraborty How do I use http://stackoverflow.com/questions/4627940/how-to-detect-iphone-sdk-if-a-video-file-was-recorded-in-portrait-orientation in my code? – Deepak Thakur Nov 25 '14 at 10:25
  • mediaUI.delegate = self; Check if the UIImagePickerDelegate callback for didFinishPicking comes or not – Debanjan Chakraborty Nov 25 '14 at 10:27
  • Yes I am aware of that, but is there anyway to show only landscape recorded videos in the photo library? We calculate it only after we finish picking media and not before it loads in the popOver. – Deepak Thakur Nov 25 '14 at 10:29
  • So, you need to access your gallery via AssetLibrary, get the images, filter via the condition and save in an array. In that case You won't be using UIImagePicker in UIPopOver, probably a UITableView or a UICollectionView to represent those selected elements. Obviously, you need to that before the popObver is opened – Debanjan Chakraborty Nov 25 '14 at 10:35

0 Answers0