当正在播放的项目跳到当前播放列表之外时,MPMusicPlayerController 的状态是什么?
我正在使用 MPMusicPlayerController,并且我已经实现了跳过曲目和上一曲目控件来控制音乐播放。当我到达当前播放列表中的专辑/播放列表的末尾时。该应用程序不再跳过曲目或转到上一曲目。
示例:专辑的第一首曲目,点击上一首曲目应用程序将停止响应并跳过曲目/播放/上一首曲目将不再响应。
示例:专辑的最后一首曲目,点击上一首曲目应用程序将停止响应并跳过曲目/播放/上一首曲目将不再响应。
我注意到在 iPod 应用程序本身上,完成播放列表后,它将返回到播放列表选择视图或返回到专辑选择视图。此时 MPMusicPlayerController 处于什么状态?当我的应用程序遇到这种状态时,如何使用它来启动 iPod 应用程序?
I'm using MPMusicPlayerController and I have implemented skip track and previous track controls to control the music playback. When I reach the end of an album/playlist that is in the now playing list. The App no longer skips track nor goes previous track.
Example: First track of album, tap on previous track the app would stop responding and skip track/play/previous track will no longer respond.
Example: Last track of album, tap on previous track the app would stop responding and skip track/play/previous track will no longer respond.
I noticed on the iPod app itself, after it finishes a playlist it'll return to the playlist selection view or it'll return to the album selection view. What state is the MPMusicPlayerController in at this point of time? How can I use it to launch the iPod app when I encounter such a state within my App?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现如果
repeatMode
设置为MPMusicRepeatModeAll
,下一首曲目将返回到播放列表中的第一项。我认为以前仍然无济于事。因此,请如上所述使用通知,或设置
repeatMode
来防止这种情况发生。I've found that if
repeatMode
is set toMPMusicRepeatModeAll
, next track will go back to the first item in the playlist. I think previous will still do nothing.So, use notifications as described above, or set
repeatMode
to prevent this from happening.根据我的经验,状态变为
MPMusicPlaybackStateStopped
在这种状态下,播放列表实际上已经消失,需要通过再次播放 iPod Music 播放器来更新。您可以使用MPMusicPlayerControllerPlaybackStateDidChangeNotification
来评估播放器的状况并执行您选择的操作。 通知编程主题:http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html#//apple_ref/doc/uid/10000043i< /a>Based on my experience, the state becomes
MPMusicPlaybackStateStopped
In this state, playlist is actually gone, and needs to be update by playing iPod Music player again. You may useMPMusicPlayerControllerPlaybackStateDidChangeNotification
to evaluate the condition of the player and do the action of your choice. Notification Programming Topics: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/Notifications/Introduction/introNotifications.html#//apple_ref/doc/uid/10000043i