Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix resize #132

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix resize #132

wants to merge 1 commit into from

Conversation

turuslan
Copy link

@turuslan turuslan commented Feb 28, 2022

changes:

  • fix "top/left changed" check.
    • was comparing style.top/style.left (string with pxsuffix) with number.
  • split "top/left changed" and "width/height changed" code.
    • top/left and width/height are not related.

fixes:

  • canvas became empty because of unnecessary resize.
    • open videojs.html.
    • pause when subtitles are visible.
    • resize window by 1 pixel, video/canvas size is not changed.
    • subtitles disappear.

Signed-off-by: turuslan <turuslan.devbox@gmail.com>
@dmitrylyzo
Copy link
Contributor

dmitrylyzo commented May 7, 2022

Jellyfin's Render Ahead mode doesn't redraw the frame and is forced to resize the canvas according to the rendered viewport, so the browser scales the result itself.

So the fix works for non-cached draws (at least wasm-blend), but not for our mode.

This works for our mode (and wasm-blend) - 3840x2160 frame (canvas size) can be drawn on 1280x720 canvas (style size).
But I'm not sure about using styles for the canvas that isn't driven by the video element.

UPD: My version doesn't seem to work with self.pixelRatio != 1.
And for wasm-blend with these options:

prescaleFactor: 8,
prescaleHeightLimit: 2160*2

UPD: It turns out that when using the buttons in the Titan example to change the player size, we need to update the stylized size.
I ended up with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants