-
Notifications
You must be signed in to change notification settings - Fork 37
Maintain aspect ratio on Desktop Playback #635
Conversation
…ar to its own file
…ogic which prevents a jarring movement of the progress bar on load
@@ -141,20 +94,40 @@ const useDesktopPlayer = ({ | |||
canvas: HTMLCanvasElement, | |||
spec: ClientScreenSpec | |||
) => { | |||
const styledPlayer = canvas.parentElement; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to run this logic on every PNG frame? Or can we instead run it once when we initialize the player and (optionally) run it in a window resize handler?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's only being run when we receive the client screen spec
tdp message, so since we currently don't support a dynamic resize, it just happens once at the beginning. Once we do implement resize, this will also account for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Github's UI confuses me, I looked up and it looked like this was inside tdpCliOnPngFrame
, but it's not. My eyes always glance over the light blue bars. Sorry!
a18685fe Maintain aspect ratio on Desktop Playback (gravitational/webapps#635) gravitational/webapps@a18685fe [source: -w master] [target: -t master]
Previously, desktop sessions recorded at one aspect ratio and played at another could look insane (see the screenshot in #587). These changes maintain the aspect ratio during playback.
Playback aspect ratio > recorded aspect ratio
Playback aspect ratio < recorded aspect ratio
RFD
Due to slight differences between the size available to the desktop session during recording, and the size available to the player, a session recorded and then played back in a browser window of precisely the same size may look something like this:
Note the black channels up and down the left and right size of the window, which are created by the same logic that creates the desirable, necessary black-space in the
Playback aspect ratio > recorded aspect ratio
screen shot above. I'm not ecstatic about how that looks, but am not sure precisely what to do about it (if anything).closes #587