How can I use the F8 play/pause key to control media playback in Catalyst?

I have a Catalyst app that plays audio via AVQueuePlayer, and I'd like to use the system play/pause key (F8 on my MacBook Pro keyboard) to play and pause it. It doesn't seem to work automatically, and if I hook up a UIKeyCommand using UIKeyInputF8, it works with Fn-F8, not F8 on its own.

It does seem to work in Overcast's Mac app, but I think that's an iPad app for Mac, not Catalyst, so it's probably going through whatever system pathway that the Lock Screen controls would be using on iOS.

How do I make this work on Catalyst?

Hello Mr. Jefferson. To control playback with the keyboard you need to provide handlers to the MPRemoteCommandCenter. You should also populate the MPNowPlayingInfoCenter with information about the media your app is playing. Becoming a now playable app and Playing Custom Audio with Your Own Player are two sample code projects that illustrate this.

How can I use the F8 play/pause key to control media playback in Catalyst?
 
 
Q