When one enables the controls on a stream via the context menu, it reveals that the local stream is mirrored – which is a feasible setting in itself, coming from
|
transform: isLocal && isFrontFacing ? 'rotateY(180deg)' : '', |
However all the controls are mirrored as well, which makes a really awkward interface 😉
As a workaround i applied a rule such as
video::-webkit-media-controls {
transform: scaleX(-1)
}
(btw that does the same job as rotateY(180deg) – not sure which is faster to the GPU or preferable in general).
Workaround works fine in Firefox and WebKit-based browsers – until you enter fullscreen mode: In Firefox it's the least bad, controls are fine in fullscreen but become mirrored when exiting fullscreen for a while, until the browser catches up again. In Chromium the controls are effectively mirrored in fullscreen which sort of negates the point of the workaround.
Worse: in both Firefox and Chromium the mirroring of the video stream is not active in fullscreen mode – the picture flips back and forth between non-mirrored and mirrored mode when switching between fullscreen and non-fullscreen mode.
The mirroring also is not applied when using picture-in-picture mode.
I understand from my issue title this technically are two separate issues, but i believe they are two birds that can only be killed with the same stone. I experimented with ::fullscreen-css rule to now avail – i believe it only works on HTML elements along with their content, but seems not to work the video-element itself, presumably b/c it is rendered natively by the client.
We could probably best solve both issues by providing custom controls along with a wrapper around <video> which should react fine to ::fullscreen-styles.
Some interesting article on how this is done: https://css-tricks.com/custom-controls-in-html5-video-full-screen/