SUMMARY Media Players have categories present in their .desktop files: 'Audio;Music;Player;AudioVideo'. Any application that matches against one of these should always be prioritised over other players. SOFTWARE/OS VERSIONS KDE Plasma Version: 5.26.5
This would result in a media player not playing media getting prioritized over a video in a web browser, which is probably not what the user would expect. Let's back up. Can you describe the problem that let you to propose this as a solution?
My reasoning here is that, despite currently having YouTube open, I would want the media keys to control music playback. I also have issues with KDE Connect appearing over a local music player (especially bad with Spotify, which shows playback on all devices, which is then used by KDE Connect on a remote device, to the same device you're listening on). I appreciate your concerns, and I think the KDE Connect issue would be best solved through other means...
I think that's a case of assuming your own use cases apply more broadly than they do. A lot of people use YouTube to listen to music exclusively, as weird as it sounds. It's also valid to want to use the global media hotkeys to play and pause a running non-music YouTube video, despire having a paused music player open (this describes my use case). And since you brought up KDE connect, if we implemented what you request, then if you had a YouTube video playing in a browser while a media player was paused in the background, when your phone rings, KDE Connect would try to pause the media player that's already paused (because it has priority) rather than the playing video in the browser. You do have an option to register your preference by marking the media player as the active one in the applet, rather than letting it automatically switch between them. > I also have issues with KDE Connect appearing over a local music player This seems like an issue specific to KDE Connect and I would recommend that you file a bug there.
KDE Connect presents itself as a player as expected, it's just that I've seen it being prioritised over active local players. I'll have to see if that's just an issue with how I've been using the media player applet. I'll close this bug and get a better feel for the applet and my own use case.