raingart / Nova-YouTube-extension

Apache License 2.0
218 stars 11 forks source link

[Bug] "Unshort Video" + "Pin Player while Scrolling": Floating Player is too big #188

Open muescha opened 3 months ago

muescha commented 3 months ago

Setup:

What I see:

What I expect:

Possible solution:

Debug Info:

Example URL

Setup:

Screenshots

raingart commented 3 months ago

I can't reproduce this bug.

in theory, the mini version is formed from two pairs of variables

const miniSize = NOVA.aspectRatio.sizeToFit({
    // 'src_width': movie_player.clientWidth,
    // 'src_height': movie_player.clientHeight,
    'src_width': NOVA.videoElement.videoWidth,
    'src_height': NOVA.videoElement.videoHeight,
    'max_width': (window.innerWidth / user_settings.player_float_scroll_size_ratio),
    'max_height': (window.innerHeight / user_settings.player_float_scroll_size_ratio),
 });

try uncommenting this line and checking. Invalid data may be transmitted https://github.com/raingart/Nova-YouTube-extension/blob/43e60f84878035f2bbe4b2dc5247fb33ba38394e/plugins/common.js#L860

how is it happening for me: https://github.com/user-attachments/assets/7bec1b79-404e-43ac-8315-8ed0783790b6

muescha commented 3 months ago

thx for the video: in my case I had the value set to: 1.2 (in your video is 2.5) maybe there is a "treshhold" where it is not "crashing the things"

muescha commented 3 months ago

I will dig into it a little with debugging

muescha commented 3 months ago

this are the debug values:

{
    src_width: 1080, 
    src_height: 1920, 
    max_width: 800, 
    max_height: 802.5
}

aspectRatio: 0.41796875

did you need more values?

raingart commented 3 months ago

Yes, this turns out not to be a bug, but a strange solution. It was necessary to indicate that the value should be in more understandable values, for example, percentages. if you hover over it option, the tooltip shows: title: 'Less value - larger size', - which is completely unintuitive.

I think I'll just limit the value to min=2

It remains as a legacy. This is how I originally implemented it. Because I didn’t guess what to use as a reference value. That is, a percentage of what? And then many users may have configured their values. They need to be somehow convected and new ones. And the solution in other scripts is to select from a list of static values. I'll leave it as it is

muescha commented 3 months ago

but restricting it to min 2 is also not good - because I like the floating a little bit more big.

more intuitive would be a % value. Like the size should be 80% of the original width. or 20% of the original width/height.

GaabluhnMowd commented 3 months ago

This may not be a solution for you depending on your usage, but if you also select "Player force resize 16:9", any shorts played will retain the same height/width as all other videos in the mini player.