//videoPath为视频下载到本地之后的本地路径
- (void)saveVideo:(NSString*)videoPath{
if(videoPath) {
if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(videoPath)) {
//保存相册核心代码
UISaveVideoAtPathToSavedPhotosAlbum(videoPath,self,@selector(video:didFinishSavingWithError:contextInfo:),nil);
}
}
}
//保存视频完成之后的回调
- (void)video:(NSString*)videoPathdidFinishSavingWithError:(NSError*)errorcontextInfo:(void*)contextInfo {
if(error) {
NSLog(@"保存视频失败%@", error.localizedDescription);
}
else{
NSLog(@"保存视频成功");
}
}
网友评论