You need to make sure your browser uses video acceleration.
I've spent hours trying every unholy combination of browser/version/Wayland/x11/flags/command line arguments and still can't hardware decode a YouTube video on a pretty standard Intel igpu laptop. Something that should really just work out of the box.