It's bizarre how blatent this is. Google has so much power over web standards that Mozilla have to work really hard to make firefox work, but YouTube don't bother being subtle or clever and just write 'if Firefox, get stuffed' in plain text for everyone to see.
this isn't much different than when microsoft added code specifically to break windows 3.1 when run under dr-dos instead of their own ms-dos. https://en.wikipedia.org/wiki/AARD_code
Google has been doing this kind of thing for a while. If you try to use Google Meet in Firefox, you can’t use things like background blurring. Spoofing Chrome works in that situation as well.
You can change your user agent string, the text your browser uses to tell the web site you're looking at what browser it is, either via your F12 developer tools menu or via an extension.