开发者

how to import video from iphone with no time duration

开发者 https://www.devze.com 2023-03-04 06:09 出处:网络
can开发者_JAVA技巧 any one help me please i just want to pick video from iphone which already recorded with help of uiimagepicker controller.

can开发者_JAVA技巧 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


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];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消