ParticleCore / Iridium

Iridium is an extension built to improve your YouTube experience
Other
1.32k stars 138 forks source link

video quality setting #999

Closed simonlokk closed 1 month ago

simonlokk commented 1 month ago

Hello, First, thank you for all the work you put into this great extension. I've noticed a possible very minor issue:

If I set the video quality to 480p and that resolution is unavailable on youtube the extension does not select the nearest available resolution, but instead jumps to 1080p. This is on the latest version 2.1.1 with the latest Firefox 130, but this behavior was noticed on older versions as well.

I think it would be great if the extension selected the next lowest possible resolution (in this case 360p). Selecting a resolution limit is very useful for really old systems (like me, LOL) or metered internet, so the next lowest would work best.

Thanks for taking the time to read this and have a great weekend!

ParticleCore commented 1 month ago

This is an issue with no easy solution, at least not one that will make everyone happy. The logic currently in use is this one:

https://github.com/ParticleCore/Iridium/blob/332d07bee2302985c8699ddddf0378c5db0430b1/src/firefox/js/background-inject.js#L1800-L1819

If the selected quality is not available it will simply pick the first one from the available list. This was an intentional choice since it significantly simplified the logic in this scenario.

If I were to change the logic to fallback to the lowest quality, then it would always pick the lowest possible whenever this happens, which is often 144p. Since that was not something I would want to be happening when using YouTube, I chose the opposite.

At best I might consider implementing a new logic that will walk back and forth from the selected quality until one is met, for examples:

Effectively looks for the closest available quality option, but not necessarily the highest or lowest available, simply whichever is closest to the preferred quality.

That's the best I can come up with right now, because I do not want to add a new feature just to allow which preferred default to use, and I hope that will match what you would like to happen.

ParticleCore commented 1 month ago

Actually I just realized that was my initial intention since the description of the feature itself does mention "or closest", will address this one on the next version for sure.

simonlokk commented 1 month ago

cool... i think most who would bother to cap their quality would prefer a lower alternative option as a first choice (there are some youtube related apps that do this on the mobile side), but i totally understand not wanting to get into the complexities you were discussing. thanks again for your time and taking a look!

ParticleCore commented 1 month ago

I hear you, and makes sense. I will implement a logic that starts the closest check from the bottom first alternating with the top.

ParticleCore commented 1 month ago

@simonlokk I have been trying to look for a video that does not have a 480p quality option (or simply one that does not have an in between option), but I am not having any luck. If possible, please provide a link to one I can test the changes with.

ParticleCore commented 1 month ago

I was able to find one old video that has the 480p missing and the new logic seems to be working:

Iridium setting:

image

Resulting quality selection; closest quality option starting from lowest first alternating with highest, found the 360p and selected it:

image

video that I tested with: https://www.youtube.com/watch?v=3344iDh65AE

If the 360p could not be found then it would check for 720p next, if not found it would check for 144p next, and so on. It is checking whichever closest option is available in relation to the Iridium setting.