Firefox Media Keys!

Setting media.hardwaremediakeys.enabled in “about:config” allows me to play/pause Overcast and YouTube at last (tested on Firefox 74 and macOS 10.15.4). Switching to Music shows that this works as expected: the latest media played can be controlled by the keys. (via gHacks)