2

In the multimedia controls (in the multitasking UI) the "play" button always show the pause image even when the music is paused, everything works fine except this

this problem don't happen if the background audio comes from the Music App (i.e. the button image switch from play to pause and vice-versa as expected)

how to fix?

thanks

Enlil
  • 1,027
  • 14
  • 28
  • When does this happen? You don't have nearly enough detail in your question. – Dustin Jun 28 '12 at 18:15
  • just fire up the Music App, play a song, press home button to go back to the springboard, press home 2 times to open the task bar, swipe-right on the TB area, you'll see the multimedia controls, now tap the pause button and you'll see the image that change from pause to play. This doesn't happen in my app, I always see the pause icon/image/symbol/button, you name it :) – Enlil Jun 28 '12 at 20:53
  • Did you ever resolve this? – SG1 Sep 26 '13 at 21:51
  • @Enlil : Did u find any solution??? I have same issue. – Monika Patel Aug 04 '16 at 07:00
  • @MonikaPatel the accepted answer did the trick in 2012, but I don't know if it works on iOS 9 / 10, sorry. Give it a try. – Enlil Aug 04 '16 at 13:09

2 Answers2

0

In my case, I had to pause all the AV-related items which were "playing":

[myAVAudioPlayer pause];
[myAVAudioRecorder pause];
[[MPMusicPlayerController applicationMusicPlayer] pause];

After which, the play/pause button on the lock screen switches, and the playhead also freezes. Inverse for play.

SG1
  • 2,871
  • 1
  • 29
  • 41
0

Change MPNowPlayingInfo dictionary, set new parameter

MPNowPlayingInfoPropertyPlaybackRate to 1.0f to show pause button

MPNowPlayingInfoPropertyPlaybackRate to 0.0f to show play button

see my answer how to use this code.

Jayesh Lathiya
  • 788
  • 6
  • 18