The media keys are atrociously implemented on macOS - I don't know how they've managed it so badly, for so long, without a fix. Listening to Spotify and pressing play/pause, you'd expect the music to pause, not to suddenly be listening to additional sound, often from a video in a browser tab you last played a month ago.