I need to know what the Uniform Type Identifier is for an AAC audio file.
Context: I'm building an audio player app that plays DRM'd AAC files using HLS. I want to support offline playback, but I don't want to use AVFoundation's offline stuff (via
AVAssetDownloadTask
) because it'll delete the files out from under me when it needs to reclaim disk space (according to this presentation at WWDC 2016). So I'm downloading the files myself and using AVAssetResourceLoaderDelegate
(walkthrough here) to serve files from the disk instead of the network when I want to. But the player just buffers forever. I tried serving a plain, unecrypted AAC file with no HLS involvement, and it failed the same way. I tried a plain, unencrypted MP3 file, and it worked. I changed the UTI provided to loadingRequest.contentInformationRequest.contentType
in resourceLoader:shouldWaitForLoadingOfRequestedResource:
from the correct audio.mp3
to audio.aac
and it failed the same way. From this I infer that what I need is the correct UTI for an AAC file.Also posted on StackOverflow: