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!

+3


source to share


3 answers


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.

0


source


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.



0


source


[songInfo setObject:@0 forKey:MPMediaItemPropertyPlaybackDuration];
[playingInfoCenter setNowPlayingInfo:songInfo];

      

When you set MPMediaItemPropertyPlaybackDuration to 0, the slider is gone.

0


source







All Articles