Skip to content

Improve video poster image URL based on actual dimensions #1575

@swissspidy

Description

@swissspidy

Feature Description

On my recent blog post just noticed that my videos are as wide as the content width, but the poster image is still the full size URL. This could be improved by using a more appropriate image size. The video[poster] attribute doesn't support srcset or anything, so this needs to be done differently.

We could:

  1. Detect width of the video
  2. Check the poster URL and get the attachment ID from that URL
  3. Get a smaller sized version of that image and use that as the poster instead.

@westonruter Something for Optimization Detective?

@joemcgill @mukeshpanchal27 Something that could perhaps also be done with the thing you're looking into where we take a block's layout into account for image sizes?

Metadata

Metadata

Assignees

Labels

[Plugin] Enhanced Responsive ImagesIssues for the Enhanced Responsive Images plugin (formerly Auto Sizes)[Plugin] Image PrioritizerIssues for the Image Prioritizer plugin (dependent on Optimization Detective)[Plugin] Optimization DetectiveIssues for the Optimization Detective plugin[Type] EnhancementA suggestion for improvement of an existing feature

Type

No type

Projects

Status

Done 😃

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions