I have a video saved in apps document dir. What I need to do is find out the duration of video. i.e. how many minutes and seconds long it is. What I cannot figure out is once I have the movie URL what do I need to do to get its duration? Do I use ALAssets? But I am not sure how.
This is the code I have so far
NSString *nameSelected = [NSString stringWithFormat:@"Movie-1.mov"];
NSLog(@"nameSelected: %@ ...", nameSelected);
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES);
NSString* documentsPath = [paths objectAtIndex:0];
NSString* movieFile1 = [documentsPath stringByAppendingPathComponent:nameSelected];
NSURL *firstMovieURL1 = [NSURL fileURLWithPath:movieFile1];
//No sure how I can call this
//NSString *durationStr = [alAsset valueForProperty:ALAssetPropertyDuration];