码迷,mamicode.com
首页 > 移动开发 > 详细

ios保存录制好的视频 图片 到相簿

时间:2016-03-09 10:47:06      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

注:使用 UIImageWriteToSavedPhotosAlbum 保存图像, UISaveVideoAtPathToSavedPhotosAlbum 保存视频. 4.0后使用 writeImageToSavedPhotosAlbum:metadata:completionBlock: 保存元数据.

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {       

    NSString* path = [[info objectForKey:UIImagePickerControllerMediaURL] path];

    // 保存视频

    UISaveVideoAtPathToSavedPhotosAlbum(path, self, @selector(video:didFinishSavingWithError:contextInfo:), nil);

    [self dismissModalViewControllerAnimated:YES];

 }

 

// 视频保存回调

- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo: (void *)contextInfo {

    NSLog(@"%@",videoPath);    

    NSLog(@"%@",error);

}

 

ios保存录制好的视频 图片 到相簿

标签:

原文地址:http://www.cnblogs.com/yan-chao-zhi/p/5256993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!