I am capturing video using following code:
UIImagePickerController *ipc = [[UIImagePickerController alloc] init];
ipc.sourceType = UIImagePickerControllerSourceTypeCamera;
ipc.delegate = self;
//need to handle delegates methods
//
ipc.allowsEditing = YES;
ipc.videoQuality = UIImagePickerControllerQualityTypeMedium;
ipc.videoMaximumDuration = 30.0f; // 30 seconds
//temporary duation of 30 seconds for testing
ipc.mediaTypes = [NSArray arrayWithObject:@"public.movie"];
// ipc.mediaTypes = [NSArray arrayWithObjects:@"public.movie", @"public.image", nil];
[self presentModalViewController:ipc animated:YES];
//this controller allows to record the videos
and I can save recorded video to album using following code
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
// recover video URL
NSURL *url = [info objectForKey:UIImagePickerControllerMediaURL];
// check if video is compatible with album
BOOL compatible = UIVideoAtPathIsCompatibleWithSavedPhotosAlbum([url path]);
// save
if (compatible){
UISaveVideoAtPathToSavedPhotosAlbum([url path], self, @selector(video:didFinishSavingWithError:contextInfo:), NULL);
NSLog(@"saved!!!! %@",[url path]);
}
[self dismissModalViewControllerAnimated:YES];
[picker release];
}
but I need to retrieve that file from album and need to store into document directory?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…