我正在使用AVAssetDownloadTask实现HLS下载器.如果我在下载过程中重新启动应用程序,我找不到恢复下载的方法.下载始终从应用程序重启开始.我在AVAssetDownloadTask的文档中找不到任何恢复下载的提及.如果有人使用AVAssetDownloadTask成功恢复下载,请告诉我.
谢谢
谢谢
解决方法
找到了这份标题为
“Offline Playback with FairPlay Streaming and HTTP Live Streaming”的PDF,解释了如何恢复下载.
AVAssetDownloadTask provides the ability to resume prevIoUsly stopped
downloads under certain circumstances. To do so,simply instantiate a
new AVAssetDownloadTask with an AVURLAsset instantiated with a file
NSURL pointing to the partially downloaded bundle with the desired
download options,and the download will continue restoring any
prevIoUsly downloaded data.
因此,您需要取消下载,然后保存传递给didFinishDownloadingTo委托的部分下载的本地NSURL.取消下载可以通过传递部分下载文件的本地NSURL来恢复.