Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7918935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:40:57+00:00 2026-06-03T15:40:57+00:00

i am using following code to show video library -(IBAction)showVideoLibrary { UIImagePickerController *videoPicker =

  • 0

i am using following code to show 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 for receiving the selected Video Url i am using 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 i am using, i can see list of video’s present in library, but when i press “USE” button, it is showing Compressing video.. and i am unable to cancel it, and i am not getting any kind of url in the

- (void)imagePickerController: (UIImagePickerController *)picker2 didFinishPickingMediaWithInfo: (NSDictionary *)info

function.. Any ideas to solve this problem.. and get url in to the app.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T15:40:59+00:00Added an answer on June 3, 2026 at 3:40 pm

    Try it on Real iPhone Device

    here is the code for picking video from iPhone library which i have used in my project

    Just add video method from selector to your desired button

      -(void)video
         {
         UIImagePickerController *imagePicker =
         [[UIImagePickerController alloc] init];
         imagePicker.delegate = self;
         imagePicker.sourceType = 
         UIImagePickerControllerSourceTypePhotoLibrary;
    
    
         imagePicker.mediaTypes = [[NSArray alloc] initWithObjects:(NSString *)kUTTypeMovie, nil];
    
         [self presentModalViewController:imagePicker animated:YES];
    
    
         }
    
    
         -(void) imagePickerController: (UIImagePickerController *) picker
         didFinishPickingMediaWithInfo: (NSDictionary *) info 
         {
    
    
         NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
    
         if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0)
         == kCFCompareEqualTo) 
         {
    
         NSString *moviePath = [[info objectForKey:UIImagePickerControllerMediaURL] path];
    
           NSURL *videoUrl=(NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];
         // NSLog(@"%@",moviePath);
    
         if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {
         UISaveVideoAtPathToSavedPhotosAlbum (moviePath, nil, nil, nil);
         }
         }
    
    
         [self dismissModalViewControllerAnimated:YES];
    
         [picker release];
    
    
         }
    

    Do not forget to add mobile core services framework

    and to import

     #import <MobileCoreServices/UTCoreTypes.h>
    

    the string “moviepath” give you the path of the video in that iPhone then perform any desired thing with that video. You will get video path after compressing is done in string movie path and “videourl” is url for that video To play that video

     MPMoviePlayerController *player =[[MPMoviePlayerController alloc] initWithContentURL: url];   //  give here the "videourl"  
        [[player view] setFrame: [self.view bounds]];  
        [self.view addSubview: [player view]];
        [player play];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using following code to show video on my website. It is working
I am using following code to choose image from camera role picker= [[UIImagePickerController alloc]
I am using the following code to show a jQuery UI dialog when the
I'm using the following code in an attempt to show a dialog with a
I'm using following code to show loading message in JQuery mobile. But the loading
I am using the following code to show percentage using String.Format but I also
I am using following code to show my location on google maps String uri
I am using the following code to show dynamic progress dialog : public void
I'm using the following code to show a particular UITableView: the first row must
I am using the following code to show and hide two div positioned absolutely

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.