Reputation: 1513
can any one help me please i just want to pick video from iphone which already recorded with help of uiimagepicker controller. i want to copy my apps document directory. ---------------------------------- prashant
Upvotes: 2
Views: 337
Reputation: 44633
I am unsure of what you mean with no time duration. But you can do the copying/moving in the UIImagePickerDelegate
method.
- (void) imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info {
NSURL *movieURL = (NSURL*)[info objectForKey:UIImagePickerControllerMediaURL];
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSURL *saveURL = [NSURL fileURLWithPath:[documentsDirectory stringByAppendingPathComponent:@"movie.mov"]];
NSError *error;
if (!([[NSFileManager defaultManager] moveItemAtURL:movieURL toURL:saveURL error:&error])) {
NSLog(@"Error saving: %@", [error localizedDescription]);
}
[picker dismissModalViewControllerAnimated:YES];
}
Upvotes: 1