Hello,
I am queueing up download task on a AVAssetDownloadURLSession
- if I queue up 6-7 downloads, not all of them start straight away in the foreground, some are actually queued up and will begin, run and complete while the app is in background mode.
The HLS streams I am downloading are FairPlay protected, so I use AVContentKeySession
to fetch the keys for each download
I pass the AVURLAsset
to the key session via addContentKeyRecipient
since I don't have an skd. To my understanding, the key session won't actually kick in before I start the download , i.e. so it can download the manifest and find the skd and then I can go through the whole DRM flow - i.e. the asset download task needs to actually begin for all this to work.
Problem is, if my app is in the background, the part of my code that calls addContentKeyRecipient
is not executed, since the background session only notifies you when it has completed, or failed.
My question is - how are we supposed to fetch licenses while in the background? Does content key session provide some background support?
Apple's advice is to always preload keys, but it seems this is not always possible. Am I missing something? Thanks in advance for any assistance.