如何将录制的视频保存到相册中? [英] How to save recorded video into photo album?
本文介绍了如何将录制的视频保存到相册中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下代码是保存从相机到相册的图像。
Following code is to save image took from camera into photo album.
if ([mediaType isEqualToString:(NSString *)kUTTypeImage])
{
image = [info objectForKey:UIImagePickerControllerEditedImage];
UIImageWriteToSavedPhotosAlbum(image, self,
@selector(image:finishedSavingWithError:contextInfo:),
nil);
}
如何将重新编码的视频保存到photoAlbum?
How to save Recoded video into photoAlbum?
推荐答案
检查以下代码......
Check Below code...
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
if ([mediaType isEqualToString:@"public.movie"]){
// Saving the video / // Get the new unique filename
NSString *sourcePath = [[info objectForKey:@"UIImagePickerControllerMediaURL"]relativePath];
UISaveVideoAtPathToSavedPhotosAlbum(sourcePath,nil,nil,nil);
}
这篇关于如何将录制的视频保存到相册中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文