/**
视频保存到相册
@param videoPath 视频path
@param saveHandle 回调
*/
-(void)saveVideoWithVideoPath:(NSString *)videoPath handle:(void(^)(BOOL,NSError *))saveHandle;
//将视频保存到相册
-(void)saveVideoWithVideoPath:(NSString *)videoPath handle:(void(^)(BOOL,NSError *))saveHandle{
[[PHPhotoLibrary sharedPhotoLibrary]performChanges:^{
//写入video到相册
PHAssetCreationRequest *creationRequest = [PHAssetCreationRequest creationRequestForAsset];
PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init];
[creationRequest addResourceWithType:PHAssetResourceTypeVideo fileURL:[NSURL fileURLWithPath:videoPath] options:options];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
saveHandle(success,error);
}];
}
网友评论