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

Improve video poster image URL based on actual dimensions #1575

Closed
swissspidy opened this issue Oct 3, 2024 · 2 comments · Fixed by #1595
Closed

Improve video poster image URL based on actual dimensions #1575

swissspidy opened this issue Oct 3, 2024 · 2 comments · Fixed by #1595
Assignees
Labels
[Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) [Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@swissspidy
Copy link
Member

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?

@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Oct 3, 2024
@swissspidy swissspidy added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) labels Oct 3, 2024
@westonruter
Copy link
Member

@swissspidy Yeah, we could use Optimization Detective to determine the widest possible width for the video element and then use that width to pick the image size. For smaller viewport widths the poster image size would still be too large, but at least it wouldn't be the full size.

@westonruter westonruter added the [Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) label Oct 3, 2024
@westonruter
Copy link
Member

As with #1183, I think this makes sense as part of the Image Prioritizer plugin. Let's see if we can get merged #1498 quickly so you can build on it perhaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Enhanced Responsive Images Issues for the Enhanced Responsive Images plugin (formerly Auto Sizes) [Plugin] Image Prioritizer Issues for the Image Prioritizer plugin (dependent on Optimization Detective) [Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Done 😃
Development

Successfully merging a pull request may close this issue.

2 participants