我想使用 iPhone 应用程序捕获视频。在这个视频文件中,我想存储本地应用程序。如何将此文件保存在本地。请帮我。
提前致谢
你能行的 :
-(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];
NSData *videoData = [NSData dataWithContentsOfURL:videoURL];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *tempPath = [documentsDirectory stringByAppendingFormat:@"/vid1.mp4"];
BOOL success = [videoData writeToFile:tempPath atomically:NO];
[picker dismissModalViewControllerAnimated:YES];
}