I'm working on online radio player and need some help.
When I set MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo
I have title, controls and playback duration slider. I don't need this slider because I have no info about playback duration and moreover it is not a very good looking control.
Can somebody prompt me how to hide playback duration slider?
And one more question: since the app is online radio player, the user have no ability to forward or rewind the playback, so I want to hide this controls from locked screen and Control Center either.
By the way I'm using Swift.
Thanks in advance!

- 1,571
- 1
- 24
- 36

- 1,768
- 2
- 16
- 24
4 Answers
In case its a live stream you can set the MPNowPlayingInfoPropertyIsLiveStream
property true
. Instead of the slider a 'LIVE' label will be displayed.

- 86
- 5
-
1MPNowPlayingInfoCenter.default().nowPlayingInfo = [MPNowPlayingInfoPropertyIsLiveStream: true] – Matea Apr 29 '20 at 10:56
To hide the forward and rewind buttons, you disable the relevant commands in MPRemoteCommandCenter
. Here's how: https://stackoverflow.com/a/28925369.
I wish I knew how to hide the playback slider. I posted a similar question before finding yours.

- 1
- 1

- 638
- 3
- 13
I was searching for a way to hide the playback duration slier too and couldn't find any. Then I played a radio from Apple Music app and when I locked the screen I could see the duration slider. So either there is no way to remove it or Apple "forgot" to remove it on their own Music app.

- 1,662
- 1
- 19
- 26
[songInfo setObject:@0 forKey:MPMediaItemPropertyPlaybackDuration];
[playingInfoCenter setNowPlayingInfo:songInfo];
When you set MPMediaItemPropertyPlaybackDuration to 0, the slider is gone.

- 1,444
- 19
- 23
-
-
This was 4 years ago, it may have changed behavior since I made this answer. – John Franke May 20 '22 at 14:00