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

Shifting video player on x2 speed shortcut #2229

Closed
0x0017 opened this issue May 1, 2024 · 4 comments
Closed

Shifting video player on x2 speed shortcut #2229

0x0017 opened this issue May 1, 2024 · 4 comments
Labels
Bug Bug or required update after YouTube changes Exemplary! worth reading /repeating. good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ YouTube changed

Comments

@0x0017
Copy link

0x0017 commented May 1, 2024

Required:
Appearance → Comments
Sidebar ✔

Bug:
When using standard shortcuts for x2 speed, be it “hold space” or “hold LMB on player”, the player window shifts to the upper right corner.
The bug is not present when using “Shift + <” and “Shift + >” to change playback speed.
Persist on both private and default modes.
Resolution: 1920x1080
Browser: Firefox 125.0.2 | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0)
OS: Windows 10

improvedtube.json

default.mp4
@0x0017 0x0017 added Bug Bug or required update after YouTube changes good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ labels May 1, 2024
@ImprovedTube ImprovedTube added the Exemplary! worth reading /repeating. label May 2, 2024
@ImprovedTube
Copy link
Member

thanks! @0x0017 (this must be another report with a solution in mind.)
(hi! @D-Rekk (only if you like))

@raszpl
Copy link
Contributor

raszpl commented Jun 29, 2024

eeeew this stupid layout
happens in here

function resizePlayer() {
const width = video.offsetWidth + 24;
const player = document.querySelector("#player.style-scope.ytd-watch-flexy");
document.getElementById("primary").style.width = `${width}px`;

as soon as I saw setTimeouts I knew it is broken :)

@ImprovedTube
Copy link
Member

hi @raszpl! The feature was much appreciated and written before youtube's "hold space for x2 speed" was released #1697.

Limiting the scope of a features gives peace of mind if(ImprovedTube.storage.comments_sidebar === true){ feature }
resizePlayer could be limited too some way like if ( !user_interacted ) { ... } yet instead of true we could define it event.key
or say if (last_input != " ") and so on #2431 (comment)
(and remove avoid many event listeners #1634)
yet more specifically video.offset width seems to be 0 for that a moment so video.offset != 0

A well timed resizePlayer() function was going to fix our player size:max-width too, yet maybe that's not necessary anymore? /youtube-changed back?

ImprovedTube added a commit that referenced this issue Jul 17, 2024
@ImprovedTube
Copy link
Member

(fixed) hi! @0x0017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug or required update after YouTube changes Exemplary! worth reading /repeating. good first issue A GitHub standard for inviting (new) contributors *Congratulations in advance!* help wanted Just an old github standard we add automatically. (The team can remove it when working on it.) up-for-grabs (a github standard for inviting new contributors) - Welcome! ♥ YouTube changed
Projects
None yet
Development

No branches or pull requests

3 participants