gpt4 book ai didi

iphone - 如何将录制的视频保存到相册?

转载 作者:可可西里 更新时间:2023-11-01 05:01:17 26 4
gpt4 key购买 nike

以下代码是将相机拍摄的图片保存到相册中。

if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) 
{
image = [info objectForKey:UIImagePickerControllerEditedImage];
UIImageWriteToSavedPhotosAlbum(image, self,
@selector(image:finishedSavingWithError:contextInfo:),
nil);
}

如何将重新编码的视频保存到相册中?

最佳答案

检查下面的代码...

   - (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);

}

关于iphone - 如何将录制的视频保存到相册?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9991332/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com