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

Load 640p webp poster image by default #187

Open
paulirish opened this issue Oct 13, 2024 · 0 comments
Open

Load 640p webp poster image by default #187

paulirish opened this issue Oct 13, 2024 · 0 comments

Comments

@paulirish
Copy link
Owner

paulirish commented Oct 13, 2024

Currently lite-youtube loads the 480p jpeg by default, as that image is defined 100% of the time.
It then tries to tries to load the 640p webp, and switches to that if it exists.

see https://github.com/paulirish/lite-youtube-embed/blob/master/youtube-thumbnail-urls.md

However, the 640p webp is both higher resolution, and uses less bytes. (in almost all the cases i've found)

So.. we should probably use that as default background-image. We can do a img.src load test (that races) and if it fails, swap the bg image back to the 480jpeg.

This approach would make the most sense for videos published in the last ~4 years, and also optimizes for bytes.

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

No branches or pull requests

1 participant