You can probably implement a dumb version of this where transcode a few different versions with ffmpeg (which is amazing, but takes some tinkering), use browser API's to guess the right one as a default, and give the user control if they'd like to switch.
I'd still try HLS but this may be good enough for v1, depending on what you're building.
I'd still try HLS but this may be good enough for v1, depending on what you're building.