Skip to content

Load 640p webp poster image by default #187

@paulirish

Description

@paulirish

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions