开发者

How to control Next Track Item on MPMusicPlayer

In MPMusicPlayer i want to display MPMediaPickerView if the Next Track item are finished.... How this is possib开发者_运维知识库le on phone....Please help me....


Watch for MPMusicPlayerControllerNowPlayingItemDidChangeNotification, and in your selector method, check the playbackState for MPMusicPlaybackStateStopped, do other checking (maybe nowPlayingItem?), and present your view.

NSNotificationCenter * notifications = [NSNotificationCenter defaultCenter];
    [notifications addObserver:self selector:@selector (trackDidChangeWithNotification:)
                          name:MPMusicPlayerControllerNowPlayingItemDidChangeNotification
                        object:self.iPodController];

.....

-(void)handleNextTrackNotification {
    if ([self.iPodController playbackState] == MPMusicPlaybackStateStopped) {
        // do whatever logic checks
        // present view
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜