There's a lovely app called Bearded Spice which also does what I want but it seems to be receiving less and less attention from the nice people who work on it. And it has never been able to recognize Apple Music since it changed its name from iTunes.
Its killer features are:
- expands the world of apps and websites that can interact with the media keys (on physical keyboards and on touchbar)
- provides more predictable controls and prioritizes which active app is affected by the shortcut press (as opposed to macOS current style of controlling the program that was last active)