You need the
ffmpeg-full platform extension.
flatpak install org.freedesktop.Platform.ffmpeg-full/x86_64. Note that if there are multiple
ffmpeg-full extensions available, you must choose the same version that firefox uses for its runtime. As of november 2021 that's the 21.08 runtime, so the command would be
flatpak install org.freedesktop.Platform.ffmpeg-full/x86_64/21.08. You may also want to
pin it (to avoid it getting removed) with
flatpak pin runtime/org.freedesktop.Platform.ffmpeg-full/x86_64/21.08.