我使用avtouchController制作了一个音乐应用程序&我想用自动播放一个接一个地播放我的下一首歌,请给我一个自动播放歌曲的步骤。
答案 0 :(得分:0)
很难从你的问题中看出来,但听起来你想要使用AVQueuePlayer。
答案 1 :(得分:0)
您应该进入设置并将播放模式设置为顺序播放模式。
答案 2 :(得分:0)
如果你正在使用AVFoundation,你可以只为你的播放器添加一个监听器,并使用结束播放方法来获取下一个音轨。你可以这样添加监听器:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[player currentItem]];
然后你创建你的方法,如下所示:
-(void)playerItemDidReachEnd:(NSNotification *)notification {
AVPlayerItem *p = [notification object];
//Fetch your next track from your plist, array, database or whatever
}