iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK
by Kyle Richter, Joe Keeley
Handling State Changes
Earlier in this section, three notifications were registered to receive callbacks. These notifications allow the app to determine the current state and behavior of the MPMusicPlayerController. The first method that is being watched will be called whenever the currently playing item changes. This method contains two parts. The first part updates the album artwork, and the second updates the labels that indicate the artist, song title, and album being played.
Every audio or video item being played through the MPMusicPlayerController is represented by an MPMediaItem object. This object can be retrieved by invoking the method nowPlayingItem on an instance of MPMusicPlayerController.
A new UIImage is created to represent the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access