How to hide MPMediaItemPropertyPlaybackDuration slider from locked screen and Control Center?
I am working on an online radio player and need some help. When I install MPNowPlayingInfoCenter.defaultCenter().nowPlayingInfo
, I have a title, controls and a playtime slider. I donβt need this slider because I donβt have any information about the playtime, and besides, itβs not a very good control. Can someone please guide me on how to hide the playtime slider? And one more question: Since the app is an online radio player, there is no way for the user to forward or rewind the playback, so I want to hide these controls from the locked screen and Control Center. By the way, I am using Swift. Thank you in advance!
To hide the fast forward and rewind buttons, you turn off the corresponding commands in MPRemoteCommandCenter
. Here's how: fooobar.com/questions/696980 / ... .
I wish I knew how to hide the playback slider. I posted a similar question before finding yours.
I was looking for a way to hide the playtime splicing and couldn't find it. Then I played the radio from the Apple Music app and when I locked the screen I saw the duration slider. So either there is no way to uninstall it, or Apple "forgot" to uninstall it in its own Music app.
[songInfo setObject:@0 forKey:MPMediaItemPropertyPlaybackDuration];
[playingInfoCenter setNowPlayingInfo:songInfo];
When you set MPMediaItemPropertyPlaybackDuration to 0, the slider is gone.