I am implementing HLS downloader using AVAssetDownloadTask. I can't find a way to resume download if I restart the application in middle of download. The download always starts from beginning on app restart. I cannot find any mention of resuming downloads in the documentation of AVAssetDownloadTask. Let me know if anyone has successfully been able to resume download using AVAssetDownloadTask. Thanks
Found this PDF titled "Offline Playback with FairPlay Streaming and HTTP Live Streaming" explaining how to resume downloads.
Found the following in a paragraph titled: "Resume Download"
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.
So you would need to cancel the download, then save the local NSURL of the partial download passed to the didFinishDownloadingTo delegate. The cancelled download can the be resumed by passing it the local NSURL of the partially downloaded file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With