Patents. I presume that the Facebook and Instagram apps bundle their own decoder (which Meta paid) but you need to convince other companies (or wait for OS integration for Firefox) to include xHE-AAC.
you can decode image files on web using wasm... i think perf suffers a bit though. audio i don't know, that's probably harder. you would probably lose the benefit of loudness normalization iiuc.
You need to pay for the necessary patents to include an H.265 decoder if you intend to distribute software in countries that care about silly things like software patents.
Mozilla famously relied on Cisco to gain h.264 playback, because the patent included a certain maximum total price you needed to pay after exceeding a certain amount of devices. Cisco exceeded that amount, so any additional devices they supported were practically free, and they released a free h.264 decoder plugin for Firefox. The pricing loophole has been removed out of h.265 so a Mozilla decoder would cost them a lot of money.
In theory you could add codecs to your browser just fine, but Mozilla has already indicated it's not planning on adding h.265 to their browser, focusing on AV1 support instead.
Perhaps Mozilla would welcome patches to allow forwarding h.265 streams to the OS for decoding, like Chrome does, but they're not going to put the effort in themselves. With hardware AV1 decoding finally on the rise, I don't think that's a bad decision necessarily, companies and websites opting for the patent ridden format over the open format knew what they were doing.
>Mozilla famously relied on Cisco to gain h.264 playback
No, they didn't. OpenH264 only supports Constrained Baseline profile, and is only useful for WebRTC. It's used system libraries/frameworks for H.264 video playback since long before OpenH264 came around.
I remember when I first got into this kind of stuff that you could just download a divx codec pack and put the .dlls somewhere in windows XP so that your programs could use them, why can't I do that with firefox and h.265?
Firefox doesn't use the Windows codec engine for decoding video content. I don't know why, I presume it's to keep a consistent experience (and possibly also because those codec packs used to be a major exploitation vector because they never received any security updates).
Firefox is open source, however, so there's no reason why a fork couldn't add that functionality. I personally wouldn't put any development effort into it myself and Mozilla don't seem interested, but for people who feel strongly about this there are always options.