Play key opening iTunes even if Spotify is currently selected
I found this for you.


  Mac Media Key Forwarder
  
  Forwards media keys to iTunes or Spotify directly.
  
  You can prioritize which app you would like to control or you can go
  with the default behavior which controls the running app. The app
  runs in the menu bar.


It has some limitations.

It might not work on Mojave till (if) the developer fixes it.