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 8588067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:43:25+00:00 2026-06-11T22:43:25+00:00

I saved the captured video in document directory as shown below and now I

  • 0

I saved the captured video in document directory as shown below and now I want to display the thumbnails and play the same video.How to do this ?

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

{    
    NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];

    [self dismissModalViewControllerAnimated:NO];

// Handle a movie capture
if (CFStringCompare ((__bridge_retained CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo)
{
    NSArray  *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDir  = [documentPaths objectAtIndex:0];
    NSString *movieName = [NSString stringWithFormat:@"%@.mov",[CoreDataFunctions getNameForVideoForDate:[CalendarFunctions getCurrentDateString]]];
    NSString *moviePath    = [documentsDir stringByAppendingPathComponent:movieName];
    NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL];
    NSData * movieData = [NSData dataWithContentsOfURL:movieURL];
    NSLog(@"%@",moviePath);
    if([movieData writeToFile:moviePath atomically:NO])
    {
        if(![CoreDataFunctions saveVideoInfoInDatabaseForDate:[CalendarFunctions getCurrentDateString]])
        {
            NSLog(@"Video was saved in doucment directory but could not be saved in core data");
        }
    }
    else
    {
        NSLog(@"Video could not be saved to the document directry");
    }
}
}
  • 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-11T22:43:26+00:00Added an answer on June 11, 2026 at 10:43 pm

    Get videos from doc dir like this

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSError * error;
    NSArray *directoryContents =  [[NSFileManager defaultManager] 
                              contentsOfDirectoryAtPath:documentsDirectory error:&error];
    
    //Take all images in NSMutableArray
    NSMutableArray *arrVideoImages = [[NSMutableArray alloc]init];
    for(NSString *strFile in directoryContents)
    {
       NSString *strVideoPath = [NSString stringWithFormat:@"%@/%@",documentsDirectory,strFile];
       UIImage *img = [self getThumbNail:strVideoPath];
       [arrVideoImages addObject:img];
    
    }
    

    Also add this method:

    -(UIImage *)getThumbNail:(NSString)stringPath
    {
      NSURL *videoURL = [NSURL fileURLWithPath:stringPath];
    
      MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
    
        UIImage *thumbnail = [player thumbnailImageAtTime:1.0 timeOption:MPMovieTimeOptionNearestKeyFrame];
    
        //Player autoplays audio on init
        [player stop];
        [player release];
        return thumbnail;
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saved my project.apk file, and I was reading this document: http://developer.android.com/guide/publishing/app-signing.html#setup and they
I have this strings saved in my mysql database in format like: /uploads/attachments/18/105/WordPress_3_Cookbook.pdf Now,
I want to play video file on blakcberry by programming My source : url
I got this error when I wrote the code mentioned below.Basically I want to
Basiclly, I want to capture audio/video. Run it through a mp4 muxer and save
Let's say that I created a video with something like Camtasia and saved it
I have this Code to Capture a image and Display it back in ListView
I'm able to save the captured image from a barcode scanner using this code:
how to play a video in iPhone sdk using MPMoviePlayerViewController,here i capture video through
Captured video with AVCam Sample Project, but it is huge at 1080x720 resolution. How

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.