I'm not trying to excuse Google, but feature detection is really hard and browsers sometimes suck with their APIs.
I just recently started using a modified version of the "h265ify" add-on that just advertises support of a few extra codecs (HEVC and surprisingly MPEG-2) to websites. With both Edge and Chrome, I do that because I know the formats work but the API doesn't indicate they do.
There's no excuse for not being able to read the user-agent strings of the top five browsers in the world, especially when 2 of them (at least) are your own code base.
I just recently started using a modified version of the "h265ify" add-on that just advertises support of a few extra codecs (HEVC and surprisingly MPEG-2) to websites. With both Edge and Chrome, I do that because I know the formats work but the API doesn't indicate they do.