-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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 poster frame support to amp-youtube #1656
Comments
Related to #1175? |
@jridgewell Yeah, I knew I had it already, but didn't find it :) |
Lets do #1657 first, though. They are very similar. |
@cramforce what do you mean by "if only the poster frame was added"? Do we expect the users to manually add I've just sent #1718 PR for addressing #1657 - If I am to follow the same logic there I'd probably check if we're in |
I'd assume we can just add one ourselves - no need for "poster" attribute or "amp-img" tag set manually. |
@mkhatib Yes, the logic is the same. The main difference is that we can compute the URL ourselves, so there is no need for an additional attribute. |
Youtube has an API for retrieving a poster frame. The URL is like this:
http://img.youtube.com/vi/{{ videoId }}/maxresdefault.jpg
If AMP is in prerender mode, we currently don't render YT embeds. We should render the poster frame instead.
You can do that by implementing
in amp-youtube and then returning true from
layoutCallback
if only the poster frame was added. When the user goes to the page,layoutCallback
should then be called again (I think :).The text was updated successfully, but these errors were encountered: