I'am using URLSessionDataTask
to download videos and play them (I need caching so I'am using the
func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data)
to manually handle the data and provide them to AVAssetResourceLoader
).
in order to do disk caching I must save the downloaded data to disk (when terminating the app) , so that when the user open the app again I can continue downloading the data .
I noticed that it doesn't have a downloadTask(withResumeData:)
like constructor (constructor of URLSessionDownloadTask
which pretty much does that same think , but it doesn't have the func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data)
function :D ) .
now how can I combine these two ?
thank you and sorry for the long post