How to detect remote audio buttons on macOS?
问题 In the article Handling External Player Events Notifications Apple says that you need to do this: • Use the shared MPRemoteCommandCenter object to register handlers for the events you wish to handle and to disable the events you are not interested in receiving. • Begin playing audio. Your app must be the Now Playing app. An app does not receive remote control events until it begins playing audio. Test that your app is properly receiving and handling remote control events with Control Center,