繁体   English   中英

将视频保存到设备库iOS?

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM