从相机胶卷中选择的视频的网址

时间:2012-03-04 03:35:02

标签: iphone objective-c ios xcode cocoa-touch

我可以从我的应用中启动相机胶卷。我希望在用户选择视频时获取视频的URL,因为我想将其用于资产读/写。

是否可以从相机胶卷中获取所选视频的网址?如果是,怎么样?

感谢。

1 个答案:

答案 0 :(得分:3)

将UIImagePickerControllerDelegate设置为您的类,并使用此代码检索网址。

-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
     [self dismissModalViewControllerAnimated:YES];
     NSURL *assetURL = [info objectForKey:UIImagePickerControllerReferenceURL];
}

这是一个很好的资源:Accessing the Camera and Photo Library from an iOS 4 iPhone Application

相关问题