After the first audio is played in whatsapp this happens and I can't control spotify with my keyboards media keys.

I suppose it is a chromium behaviour that can probably be disabled somewhere...
Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.89. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!
Links: app homepage, dashboard and code for this bot.
This is what likely needs to be replicated in chromium's configuration:
https://www.omgchrome.com/chrome-google-music-media-keys/
@beppe9000 thanks for digging in!
It seems related to https://github.com/electron/electron/issues/18253#issuecomment-589542934.
It seems we could just add
app.commandLine.appendSwitch('disable-features', 'HardwareMediaKeyHandling,MediaSessionService');
to index.js and fix this. I don't think a configuration option is needed: we can't set this flag per-service (I guess it would still make sense for some services that actually play media), and most services just use it "steal" the media overlay (also happens on Linux with the MPRIS media overlay protocol).
Guess we can close this, since #1023 is merged now.
Most helpful comment
Guess we can close this, since #1023 is merged now.