HLS stream download getting stuck

Trying to download an encrypted HLS stream we faced the following issue:

When we start a new download, calling resume() function of AVAssetDownloadTask, the download process gets stuck (not every time) and neither of urlSession(_:assetDownloadTask:didFinishDownloadingTo:) or urlSession(_:task:didCompleteWithError:) delegate functions (AVAssetDownloadDelegate) are getting called.

There are cases where not even the urlSession(_:assetDownloadTask:didLoad:totalTimeRangesLoaded:timeRangeExpectedToLoad:) delegate function is getting called.

Any suggestions on how to troubleshoot?

Any updates on this?

Please file FeedbackSystem bug report with a sysdiagnose and a test app reproducing the issue.

HLS stream download getting stuck
 
 
Q