What should I know about MusicKit to list and play music?

Asked on 07/31/2024

1 search

To list and play music using MusicKit, you should be aware of a few key aspects:

  1. Generic Media Assets: In iOS 17.2, Apple introduced song and podcast assets, which are categories of assets focusing on the music and podcasts you listen to on Apple Music and Apple Podcasts. This is extended in iOS 18 to support other media applications that deliver music or podcast content to users. These assets include the title of the media, artist name, album name, app icon, and a timestamp. You can retrieve and display these assets in your app by converting them into an async image using the app icon of the app that was used to consume the media.

  2. Now Playing API: For more detailed information and control over media playback, you should refer to the Now Playing API. This API allows you to manage and control media playback within your app.

  3. Design Considerations: When designing your app, consider using movement and animation to guide users to interactive elements, such as the music library. For example, a pulsing stroke outline around the music icon can subtly guide users to tap on it. Additionally, custom gestures that mimic real-world actions (like a DJ holding headphones to one ear to preview the next track) can enhance the user experience.

For more detailed information, you can refer to the following sessions from WWDC:

These sessions provide insights into handling media assets and designing interactive experiences for music playback.