MacOS High Sierra Media Key Enabler for iTunes
It only works with physical buttons, won't work with touchbar. The small app detects if Spotify is installed and offers to switch between controlling iTunes and Spotify.
I don't have a developer certificate so trust the app when MacOS asks. Feel free to compile the project yourself.