Rotate an HLS stream into Landscape Mode

I’ve got an HLS format (M3u8 file) video that I would like to show to users on a web site.

Some of the videos are taken in vertical (portrait) mode, others are in landscape (horizontal) mode.

Ideally I’d be able to do something on the web client side to rotate the videos and display them “right side up”

I’m actually interested in being able to do this mid stream, without making mobile viewers rotate their phones or desktop viewers not really having an option.

I could generate new HLS assets based on new rotated mp4 files that I create let’s say with FFMPEG, but I’d rather just have something on the display side on web.

Currently using just the default Mux player in React to do this, trying to apply a -90 CSS transform is also shifting the video player controls, which looks very strange.

Looking for a lightweight client side solution, although if none exists I can do a more heavy server side flow.