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

Feature: upgrade thumbnail quality #236

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

fire332
Copy link
Collaborator

@fire332 fire332 commented Dec 19, 2024

This PR adds an option to upgrade the quality of thumbnail images that is disabled by default. It doesn't upgrade thumbnails for shorts or if it's from an A/B test (I'm not sure A/B test thumbnails even have a higher quality than hqdefault).

It works by detecting thumbnail elements, parsing their URLs from their background-image inline style, rewriting the URL to use a higher quality version & with WebP if supported, loading the image in the background, and finally swapping the images out if it loads successfully.

This PR is built on top of #235. That should be merged before this one. Re-based changes onto main.

Fixes #175, fixes #196, fixes #231

@fire332 fire332 force-pushed the thumbnail-quality branch 2 times, most recently from 1ece14b to 81ca63d Compare December 19, 2024 18:19
@cremor cremor mentioned this pull request Dec 20, 2024
@Gartorf

This comment was marked as off-topic.

@fire332
Copy link
Collaborator Author

fire332 commented Dec 22, 2024

Thank you! Will this be in the next release or how do I install this fix onto my 0.3.4 version? (Newbie question I know!)

With Node.js 22 LTS installed:

  • Use git to clone my fork on this branch, or download it here and extract it.
  • Open the folder in terminal and run these commands:
    1. npm install
    2. npm run build && npm run package
    3. Use webOS Dev Manager to install the .ipk file.

@Kaiman8-art

This comment was marked as off-topic.

@fire332 fire332 added this to the v0.3.5 milestone Dec 23, 2024
@fire332 fire332 marked this pull request as ready for review December 25, 2024 06:34
@FabioPedretti
Copy link

Any reason this is disabled by default?
If there is a side effect maybe add a note about it in the desc?
Thanks.

@fire332
Copy link
Collaborator Author

fire332 commented Dec 27, 2024

It is disabled by default because:

  • It'll load the high quality thumbnail as well as whatever thumbnail Youtube loads which is extra data.
  • High quality thumbnails makes animations feel stuttery, the degree varies with which TV you have.
  • It doesn't replace thumbnails from A/B tests so it'll look jarring having high quality and low quality thumbnails side by side.

@fire332 fire332 merged commit c8438a5 into webosbrew:main Dec 27, 2024
1 check passed
@fire332 fire332 deleted the thumbnail-quality branch December 27, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants