Downloaded Apple Music song's assetURL is nil

Right now, my app plays songs from the user's iCloud Music Library through an AVPlayer, so I can have more control over the volume and other things. I do this by finding the MPMediaItem of the song I want through predicates, and I extract the assetURL of the song and feed that to the AVPlayer ot play. This means that the song has to be downloaded to the device to play, since there will be no assetURL if it's not downloaded.


I just recently got into trying to make the same sort of thing work with Apple Music. After I add a song from Apple Music to my Library, and download it, the assetURL is still nil. Therefore, I can't play the song through the AVPlayer.


How can I get the assetURL of a downloaded song from Apple Music?

Replies

I'm also seeing this same issue. Anyone have any other ideas? There's no real other property on MPMediaItem that would otherwise make sense to use...