It seems that the property MPMediaItemPropertyAssetURL
on a MPMediaItem
returns null when the file is one that was from Apple Music and has been made \
It seems that Apple Music files are DRM-protected and subscription based, so probably Apple prohibits the use of references to these assets due to rights management.
Reference: https://forums.developer.apple.com/thread/7389
Things have changed a little and this isn't true anymore. MPMediaItemPropertyAssetURL
is not nil on iOS 11 for songs saved offline via Apple Music but AVPlayer
is unable to play them since they are still DRM protected. The same song returns MPMediaItemPropertyAssetURL
nil on iOS 9.
If you are interested in checking for DRM protected songs or in playing such songs, you can read my detailed answer here: https://stackoverflow.com/a/47694472/4331787