Their implementation is designed to make it extremely difficult to swap in other codecs from a plugin or straightforward patchset. You'd have to fully fork at least Gecko and XULRunner, and extend Firefox. Due to their strong Trademark policies, your fork couldn't use their names or logos (see also: Iceweasel).