HLS VOD Download Resume after Wifi/LTE Change

Hello there,

Our application has HLS VOD download option. Users can download VOD which has DRM protection and watch content when device is offline.

We use aggregateAssetDownloadTask to download HLS VOD. We want to resume download after Wifi/LTE change but it does not resume. Download is starting from beginning.

We use some token algorithms to start download. That's why, our playlist url and chunks urls may change. But playlist and chunk urls' content is unique.

If user start to download via Wifi and changed to LTE. Download request responds 403 Forbidden because of some token algorithms after some time

func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)

AVAssetDownloadDelegate function triggered by system. If we resume it does not resume at this point. It is starting from beginning if we start new download process for same content.

Is there any way to resume unfinished HLS Download processes? Thanks

We advise against rapidly mutating content that is eligible for download retry, as it can lead to a fragile solution. For further information, please refer to our recommendations on the HTTP Live Streaming (HLS) authoring specification for Apple devices.

If this solution is still desired, we suggest exploring the STABLE-RENDITION-ID and STABLE-VARIANT-ID attributes. This approach decouples the variant identity from its CDN location. To facilitate the refresh of the Multi-Variant-Playlist (MVP), you can rely on the HTTP cache-control headers. AVFoundation will attempt to retry expired MVP, but it will default to the cached playlist if a new MVP cannot be retrieved. To achieve the re-download behavior of the MVP, use the HTTP headers Cache-Control: must-revalidate, along with max-age.

HLS VOD Download Resume after Wifi/LTE Change
 
 
Q