Change default behaviour of play/pause button

On my Macbook, if I press the play/pause button (F8) with no other context, MacOS (Mojave) seems to default to opening up iTunes, and playing a particular track. (Maybe the first alphabetically in my entire collection, not sure). I really don't like this particular track :)

Is there anyway I could change this behaviour? For instance, opening Spotify and playing a certain playlist there?

(It's the newer generation bluetooth Apple keyboard, if that matters.)


This is a old post but the software recommend Beardedspice works fine on my Mac. Please read the full answer because it provides much more detail.