iOS - Setting total max size limit for downloads with AVAssetDownloadURLSession

371 views Asked by At

I am creating an app to download audio tracks and videos with AVAssetDownloadURLSession and AVAssetDownloadTask. What I would love to do is set a threshold for downloads.

Say, the threshold is 5GB then total downloads would never exceed 5GB.

I went through the WWDC videos and said API documentation but was unable to find anything as such which will allow me to set a certain limit.

It would be great if any of you genius minds can point me to if the above scenario is possible with Apple APIs or I'll have to write my own implementation.

1

There are 1 answers

0
M. LeRouge On

You could take a rough guess by multiplying the variant bitrate by the duration of AVAsset