How to get "file" information from MPMediaItem

The Music macOS app shows various info about a song in the Get Info window. Most of this metadata is available in the iOS SDK via MPMediaItem. I'm wanting to access the information displayed in the File tab but I'm not seeing several pieces of data in the API. Is this possible?

□ Kind - Apple Music AAC audio file - ?
☑︎ Duration - 3:00 - playbackDuration
□ Size - 10 MB - ?
□ Bit rate - 256 kbps - ?
□ Sample rate - 44.100 kHz - ?
□ Date modified - 1/1/2001 - ?
☑︎ Date added - 1/1/2001 - dateAdded
□ Cloud status - Apple Music - ?
☑︎ Location - Cloud - isCloudItem

Replies

Hello,

As far as I know, there is no way to obtain the properties listed above via the MediaPlayer framework.

Good luck!

Hello @Jordan,

The kind of information you're referring to here is not exposed in MPMediaItem.

If having access to this information would enable new interesting use-cases in your app, please submit this idea as a feature request on Feedback Assistant with any relevant background information.

Best regards,

  • Okay I have filed FB9115323, thank you

  • Hello @Jordan,

    Thank you very much. We'll keep track of this feedback item, and discuss it internally to determine if we can offer new API support in this area.

    Best regards,

Add a Comment