Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Maintain aspect ratio on Desktop Playback #635

Merged
merged 4 commits into from
Mar 1, 2022

Conversation

ibeckermayer
Copy link

@ibeckermayer ibeckermayer commented Mar 1, 2022

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

Screen Shot 2022-02-28 at 20 50 00

Playback aspect ratio < recorded aspect ratio

Screen Shot 2022-02-28 at 20 49 26

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:

Screen Shot 2022-02-28 at 20 50 49

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

Isaiah Becker-Mayer added 2 commits February 28, 2022 18:51
@@ -141,20 +94,40 @@ const useDesktopPlayer = ({
canvas: HTMLCanvasElement,
spec: ClientScreenSpec
) => {
const styledPlayer = canvas.parentElement;
Copy link
Contributor

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?

Copy link
Author

@ibeckermayer ibeckermayer Mar 1, 2022

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.

Copy link
Contributor

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!

@ibeckermayer ibeckermayer merged commit a18685f into master Mar 1, 2022
kimlisa added a commit to gravitational/teleport that referenced this pull request Mar 2, 2022
a18685fe Maintain aspect ratio on Desktop Playback (gravitational/webapps#635) gravitational/webapps@a18685fe

[source: -w master] [target: -t master]
@ibeckermayer ibeckermayer mentioned this pull request Mar 7, 2022
ibeckermayer pushed a commit that referenced this pull request Mar 7, 2022
* Fix clipboard sync (#628)

* Maintain aspect ratio on Desktop Playback (#635)

* only synchronize clipboards if data was or is going to be sent (#640)

* desktop playback error handling (#638)

* smooth out progress bar (#648)
@zmb3 zmb3 deleted the isaiah/maintain-aspect-ratio branch September 9, 2022 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Maintain aspect ratio in playback recordings
3 participants