App-level volume for MusicKit ApplicationMusicPlayer on Mac Catalyst

Our music player plays library and Apple Music catalog content with MusicKit's ApplicationMusicPlayer. On the Mac, we want a volume slider that changes only our app's playback level, like the slider in Music.app.

We found no supported way to do this:

  • ApplicationMusicPlayer and MusicPlayer have no volume property.
  • The audio plays in com.apple.MediaPlayer.RemotePlayerService, not in our process, so we cannot change the stream level.
  • MPVolumeView and the deprecated MPMusicPlayerController.volume control the system output volume, not the app's level.
  • AVPlayer cannot play Apple Music catalog content.

Questions:

  1. Is there a supported API to set the playback volume of ApplicationMusicPlayer on macOS or Mac Catalyst?
  2. If there is none, what does Apple recommend for Mac apps that need an app-level volume control for MusicKit playback?

No way to do this as far as I’m aware :(

I filed FB21042385 requesting this at the end of the last year, feel free to dupe!

App-level volume for MusicKit ApplicationMusicPlayer on Mac Catalyst
 
 
Q