MPNowPlayingInfoCenter don't pause when playbackRate is set to 0 #344
Closed
XZB-1248
started this conversation in
Show and tell
Replies: 1 comment
-
It might be worth adding an optional argument to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I encountered an issue: when I set
MPNowPlayingInfoCenter
'sMPNowPlayingInfoPropertyPlaybackRate
to 0, the lock screen still shows the play button, but the progress no longer increases.Eventually, I found out that when calling
player.pause
, the audioEngine continued to push silences (the note forplayerNode.pause
is "Pauses audio from the current decoder and pushes silence"), which led the system to think that audio was still playing, thus it continued to display the pause button.This problem troubled me for several days, and after multiple tests, I found that the issue could be resolved by calling
player.playerNode.engine?.pause
afterplayer.pause
, andplayer.playerNode.engine?.start
beforeplayer.resume
orplayer.play
.Although it’s not recommended to directly manipulate
AVAudioEngine
, it indeed solved my problem.I hope this can help others.
Beta Was this translation helpful? Give feedback.
All reactions