Apple Music Offline Files Have no URL?
Asked Answered
S

2

9

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 "available offline".

On the other hand, items from my original library which I uploaded to iTunes match/apple music and then make available offline don't seem to have this problem.

Is this a bug? Have I done something wrong? Anyone having similar issues?

Sewing answered 12/7, 2015 at 4:53 Comment(2)
Have you found anything new concerning this issue?Downtime
I'm having the same issue. Ever figure this one out?Deferral
M
2

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

Matchlock answered 23/1, 2016 at 12:32 Comment(0)
C
0

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://mcmap.net/q/676897/-how-to-detect-if-an-mpmediaitem-represents-a-drm-protected-audio-track-on-ios

Culm answered 7/12, 2017 at 14:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.