0

i have a radio app and integrated with carplay. In Carplay Dashboard, i only see the album cover image and stop button. I want to show play/pause and skip buttons in Dashboard. Can you help me if you know anything about this station?

1 Answers1

0

You need to use the MPRemoteCommandCenter to access remote media control commands. Check out the docs for MPRemoteCommandCenter here.

You can then enable and disable certain commands for car play by setting or unsetting isEnabled and by adding a target for certain commands using addTarget.

For example, to add a pause command with a target and to disable the seek backward command you would do something like this:

let commandCenter = MPRemoteCommandCenter.shared()

commandCenter.pauseCommand.addTarget { (_) -> MPRemoteCommandHandlerStatus in

    // Pause your media player

    return .success
}

commandCenter.seekBackwardCommand.isEnabled = false
JTODR
  • 318
  • 2
  • 10