I am using the following code to display a video library
-(IBAction)showVideoLibrary { UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; videoPicker.delegate = self; videoPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; videoPicker.mediaTypes =[[NSArray alloc] initWithObjects: (NSString *)kUTTypeMovie,nil]; if(self.popoverController!=nil) { [self.popoverController release]; } self.popoverController = [[UIPopoverController alloc] initWithContentViewController:videoPicker]; popoverController.delegate = self; popoverController.popoverContentSize=CGSizeMake(320,1000); [popoverController presentPopoverFromRect:CGRectMake(0,0,10,10) inView:self.view permittedArrowDirections:nil animated:YES]; }
and to get the selected video url I use the following function
- (void)imagePickerController: (UIImagePickerController *)picker2 didFinishPickingMediaWithInfo: (NSDictionary *)info { NSString *mediaType = [info valueForKey:UIImagePickerControllerMediaType]; if([mediaType isEqualToString:@"public.movie"]) { NSLog(@"came to video select..."); NSURL *videoUrl=(NSURL*)[info objectForKey:@"UIImagePickerControllerMediaURL"]; NSLog(@"Got Movie Url==%@",videoUrl); }
this is the code that I use, I see a list of videos present in the library, but when I click the "USE" button, it shows "Compress video". And I cannot cancel it, and I do not receive any type of URL in
- (void)imagePickerController: (UIImagePickerController *)picker2 didFinishPickingMediaWithInfo: (NSDictionary *)info
. Any ideas to solve this problem .. and get the application url.
Thanks.
vensan
source share