Apple Music Offline Files Have no URL?

霸气de小男生 提交于 2019-12-12 07:49:15

问题


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?


回答1:


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




回答2:


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



来源:https://stackoverflow.com/questions/31364485/apple-music-offline-files-have-no-url

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!