Reputation: 822
I'm using MPMusicPlayerController and I have implemented skip track and previous track controls to control the music playback. When I reach the end of an album/playlist that is in the now playing list. The App no longer skips track nor goes previous track.
Example: First track of album, tap on previous track the app would stop responding and skip track/play/previous track will no longer respond.
Example: Last track of album, tap on previous track the app would stop responding and skip track/play/previous track will no longer respond.
I noticed on the iPod app itself, after it finishes a playlist it'll return to the playlist selection view or it'll return to the album selection view. What state is the MPMusicPlayerController in at this point of time? How can I use it to launch the iPod app when I encounter such a state within my App?
Upvotes: 1
Views: 1356
Reputation: 1325
I've found that if repeatMode
is set to MPMusicRepeatModeAll
, next track will go back to the first item in the playlist. I think previous will still do nothing.
So, use notifications as described above, or set repeatMode
to prevent this from happening.
Upvotes: 3
Reputation: 3200
Based on my experience, the state becomes MPMusicPlaybackStateStopped
In this state, playlist is actually gone, and needs to be update by playing iPod Music player again. You may use MPMusicPlayerControllerPlaybackStateDidChangeNotification
to evaluate the condition of the player and do the action of your choice. Notification Programming Topics: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html#//apple_ref/doc/uid/10000043i
Upvotes: -1