MPMusicPlayerController停止发送通知 [英] MPMusicPlayerController stops sending notifications

查看:113
本文介绍了MPMusicPlayerController停止发送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MPMusicPlayerController播放整个iPod库,我在轨道更改等时订阅了通知。这一切都正常工作

I have a MPMusicPlayerController playing the entire iPod library and I'm subscribed to the notifications when tracks change etc. This is all working correctly

当结束时到达播放列表,MPMusicPlayerController发送状态更改通知并停止。当我重新启动播放器时,音乐开始播放,但是当曲目改变时,MPMusicPlayerController不再发送通知等。

When the end of the playlist is reached, MPMusicPlayerController sends a change of state notification and stops. When I re-start the player, music begins to play again but MPMusicPlayerController no longer sends notifications when tracks change, etc.

想法?

推荐答案

经过大量的实验,这就解决了我的问题。

After alot of experimenting, here's what resolved my issue.

事实证明,通知被送去的状态被报告为停止;然而,发送播放消息只会导致另一个通知触发,并且状态仍然显示为已停止。

As it turns out, the notification was being sent and the state was being reported as "stopped"; however sending a "play" message only resulted in another notification firing and the state still appearing as "stopped".

当玩家在到达结束时停止队列,它没有完全停止,我最好的猜测是,当它停止播放时,它没有正确重置队列状态或类似的东西,因为我发现如果我在停止后发送停止消息收到通知后,我能够发送播放消息并让播放器正常重启。

While the player was stopping when it reached the end of the queue, it wasn't "completely" stopped, my best guess is that while it stopped playing, it didn't properly reset the queue state or something like that, because I found that if I sent a "stop" message after the stop notification was received, I was able to send a "play" message and have the player restart properly.

这篇关于MPMusicPlayerController停止发送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆