Firefox 81 is here, and in the Flatpak too.
One of the features it brings is media controls (MPRIS). This lets you play/pause from the notification (with info), from media keys, and from headsets that support it.
I didn’t have it working by default, however…
I fired up the Flatseal app and added
org.mpris.MediaPlayer2.firefox.* to “Session Bus” → “Owns” and now it works!
There’s a commit that does this for you at https://hg.mozilla.org/mozilla-central/rev/7696ef3fe20d which should land in Firefox 82. Relevant Bugzilla issue is @ https://bugzilla.mozilla.org/show_bug.cgi?id=1648024.