Skip to content

Add poster frame support to amp-youtube #1656

@cramforce

Description

@cramforce

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

/** @override */
    prerenderAllowed() {
      return true;
    }

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 :).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions