2

如何使用 AVPlayer 立即开始下一首歌曲?我有从 iPod 库中选择的歌曲集MPMediaItemCollection

现在我如何使用 AVPlayer 来一一播放歌曲列表?

4

1 回答 1

6

要回答您的第一个问题,您可以使用 Notification 与

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(songFinished:)
                                             name:AVPlayerItemDidPlayToEndTimeNotification
                                           object:[yourAVPlayer currentItem]];

-(void)songFinished:(NSNotification *)notification
{
     //Do your next stuff here;
}
于 2011-09-12T11:01:08.303 回答