iOS 保存第三方摄像头当前播放的图像,获取到视频的路径后,将视
2023-02-20 本文已影响0人
wodeph
//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(@"保存视频成功");
}
}