Your app needs to update the control state, enable/disable, based on its control state.
I have this function that handles a change in the player state
/// updates the media player controls to reflect the new player status
/// - Parameter status: player status flags
func updateUI(status: PlayerStatus) {
ModuleData.singleton.mediaCommandCenter.playCommand.isEnabled = status.intersects(with: .play)
ModuleData.singleton.mediaCommandCenter.stopCommand.isEnabled = status.intersects(with: .stop)
ModuleData.singleton.mediaCommandCenter.pauseCommand.isEnabled = status.intersects(with: .pause)
ModuleData.singleton.mediaCommandCenter.nextTrackCommand.isEnabled = status.intersects(with: .skipForward)
ModuleData.singleton.mediaCommandCenter.togglePlayPauseCommand.isEnabled = status.intersects(with: [.stop, .play, .pause])
ModuleData.singleton.mediaCommandCenter.previousTrackCommand.isEnabled = status.intersects(with: .skipBackward)
ModuleData.singleton.mediaCommandCenter.skipForwardCommand.isEnabled = status.intersects(with: .skipBackwardTime)
ModuleData.singleton.mediaCommandCenter.skipBackwardCommand.isEnabled = status.intersects(with: .skipBackwardTime)
ModuleData.singleton.mediaCommandCenter.seekForwardCommand.isEnabled = status.intersects(with: .seekForward)
ModuleData.singleton.mediaCommandCenter.seekBackwardCommand.isEnabled = status.intersects(with: .seekBackward)
}
The status values are a bit mask enum with various controls enabled/disabled.