0

I want to hide all the controls on the locked screen when an app is playing in the background. However, I want the audio related information to be displayed all the time.

I read about MPRemoteCommandCenter but we can't implement the below code because when you try to disable all then the screen starts showing 3 controls (toggle button, next track, previous track)

MPRemoteCommandCenter *rcc = [MPRemoteCommandCenter sharedCommandCenter];
[[rcc skipForwardCommand] setEnabled:NO];
[[rcc skipBackwardCommand] setEnabled:NO];
[[rcc nextTrackCommand] setEnabled:NO];
[[rcc previousTrackCommand] setEnabled:NO];
[[rcc skipForwardCommand] setEnabled:NO];
[[rcc skipBackwardCommand] setEnabled:NO];
rcc.playCommand.enabled = NO;
rcc.pauseCommand.enabled = NO;

Is there any other way to achieve what I am expecting? Currently play pause button is visible. enter image description here

EDIT: My question is not a duplicate of How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter because I want to hide. The answer given on the other question disables the controls.

Community
  • 1
  • 1
A_G
  • 2,260
  • 3
  • 23
  • 56
  • Possible duplicate of [How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter](http://stackoverflow.com/questions/38993801/how-to-disable-all-the-mpremotecommand-objects-from-mpremotecommandcenter) – stek29 May 16 '17 at 08:12
  • My question is not a duplicate of How to disable all the MPRemoteCommand objects from MPRemoteCommandCenter because I want to hide. The answer given on the other question disables the controls. – A_G May 16 '17 at 08:18
  • 1
    How is disabling controls different from hiding them? – stek29 May 16 '17 at 11:24
  • @stek29 Disabled controls can be visible, but greyed out for example. Hidden controls are not visible. – Losiowaty May 16 '17 at 15:40
  • @AsthaGupta I highly doubt it is possible, sadly. – stek29 May 16 '17 at 20:16

0 Answers0