[英]Saving captured video to iOS library with CameraManager & Swift
[英]Saving video to device library iOS?
我在设备没有足够的空间将NSDocumentsDirectory中存在的视频文件保存到照片库的地方遇到了此问题。
问题是,UISaveVideoAtPathToSavedPhotosAlbum保存时不会引发任何错误。
UISaveVideoAtPathToSavedPhotosAlbum(session.outputURL.path, self, @selector (video:didFinishSavingWithError:contextInfo:), nil); //session is AVAssetExportSession
- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
[MBProgressHUD hideHUDForView:self.view animated:YES];
if(error) //else part is executed every time...
{
ALERT_WITH_MESSAGE([@"Your composition could not be saved to your device library. Error: " stringByAppendingString:error.description]);
}
else
{
ALERT_WITH_MESSAGE(@"Your composition has been saved to your device library.");
}
}
如果您的意思是ALERT_WITH_MESSAGE未显示,请尝试注释[MBProgressHUD hideHUDForView:self.view animation:YES]; 或添加一些延迟... {此HUD本身被当作警报来对待}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.