-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add transformer for adding poster image placeholders to video embeds (e.g. YouTube) #1187
Comments
Thanks for filing. This looks very useful! Is the placeholder image URL scheme an official API? |
De facto official, I believe. See https://stackoverflow.com/a/2068371/93579. |
If the This further relates to ampproject/amp-toolbox-php#10: if we identify that |
The poster image URLs are also utilized in the |
Did you test whether this causes a double download of the poster image because of origin keyed caching? |
That's a great point. No, I didn't test that. |
I looked into this. It doesn't matter in this case as the AMP runtime also injects the poster image (which causes a double download anyway). |
Great! (?) |
Something that we do in the WordPress plugin when converting a YouTube iframe into
amp-youtube
is automatically supply the poster image placeholder, which can greatly reduce LCP since YouTube videos are heavy andamp-youtube
doesn't implement a facade.So instead of:
We generate:
With Optimized AMP and hero image prerendering, this is further optimized as the poster becomes a hero image:
(Caveat: It seems currently only the PHP implementation of
PreloadHeroImage
is identifying such placeholders as hero image.)It seems generally useful to have an optimizer transformer that does this for all
amp-youtube
components that lack aplaceholder
, and to do the same for other popular components which have an easily-determined poster image.The text was updated successfully, but these errors were encountered: