在后台启动AVAssetExportSession [英] Starting AVAssetExportSession in the Background

查看:466
本文介绍了在后台启动AVAssetExportSession的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序进行了一些处理,在某些时候它需要调用AVAssetExportSession。

My app does some processing and at some point it needs to call an AVAssetExportSession.

如果会话已经开始,然后我对应用程序进行后台处理,一切都正常完成。但是,如果我在调用 exportAsynchronouslyWithCompletionHandler 之前对应用程序进行后台处理。我收到此错误:

If the session has already started and then I background the app, everything completes normally. However, if I background the app before calling exportAsynchronouslyWithCompletionHandler. I get this error:

AVAssetExportSessionStatusFailed错误域= AVFoundationErrorDomain代码= -11800操作无法完成UserInfo = 0x1e550db0 {NSLocalizedFailureReason = An发生未知错误(-12985),NSUnderlyingError = 0x1e574910操作无法完成。(OSStatus error -12985。),NSLocalizedDescription =操作无法完成}

是否可以在后台启动AVAssetExportSession?

Is it possible to start an AVAssetExportSession in the background?

推荐答案

实际上并非如此可能是因为您无法在后台启动新线程。如果你想在后台做很多事情,你必须在app背景之前异步启动它们。

It actually is not possible due to the fact that you can't start a new thread in the background. If you want to do a lot of things in the background you'll have to start them all asynchronously right before the app backgrounds.

这篇关于在后台启动AVAssetExportSession的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆