Media keys not working for iTunes high Sierra
It seems that with High Sierra Apple is trying to detect which application should be controlled by the media keys. They work fine until you use something (e.g., a browser other than Safari) and the system get confused.

This can be fixed with an open source application: BeardedSpice


  BeardedSpice is a menubar application for Mac OSX that allows you to
  control web based media players and some native apps with the media
  keys found on Mac keyboards. It is an extensible application that
  works with Chrome (Canary, Yandex, Chromium) and Safari, and can
  control any tab with an applicable media player.