以下代码是将相机拍摄的图片保存到相册中。
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/