如何在MPMusicPlayer上控制播放状态功能

时间:2010-11-30 14:01:43

标签: iphone mpmusicplayercontroller

如何在MPMusicPlayer中控制播放状态功能....例如我想要打开

ipod播放列表文件,当下一首曲目结束时没有可用的项目...

iphone怎么可能.....请帮帮我......

1 个答案:

答案 0 :(得分:0)

这是我的一些代码:

    MPMediaQuery *everything = [MPMediaQuery songsQuery];

[everything setGroupingType: MPMediaGroupingPlaylist];

self.playlists = [NSMutableArray arrayWithArray:[everything collections]];

...

    NSArray *songsList = [[self.playlists objectAtIndex: currentPlayListIndex] items];

int nowIndex = [songsList indexOfObject:nowPlayingViewController.nowPlayingItem];

if(++nowIndex >= [songsList count]) 
    nowIndex = 0;

if(![self playItem: [songsList objectAtIndex:nowIndex]])