当使用 MPMediaPlaylist 填充 MPMusicPlayerController 时,如何前进到下一个项目并开始播放?
这就是我正在做的:
self.iPodController = [MPMusicPlayerController applicationMusicPlayer];
MPMediaPlaylist* playlist = [self lookupSavedPlaylist];
[self.iPodController setQueueWithItemCollection:playlist];
[self.iPodController skipToNextItem];
[self.iPodController play];
这会导致播放第一首歌曲,而不是第二首歌曲。这种有点是有道理的,但是很烦人,我希望有一个解决方法。
Here's what I'm doing:
self.iPodController = [MPMusicPlayerController applicationMusicPlayer];
MPMediaPlaylist* playlist = [self lookupSavedPlaylist];
[self.iPodController setQueueWithItemCollection:playlist];
[self.iPodController skipToNextItem];
[self.iPodController play];
This results in the first song playing, not the second. This kind of makes sense, but it's annoying and I'm hoping there's a work-around.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,如果您显式设置
nowPlayingItem
,则不会出现此问题。这是修改后的代码:Well, it turns out that if you explicitly set the
nowPlayingItem
, you won't have this issue. Here's the modified code: