question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Story Player] AMP validator failures for <amp-story-player> for responsive layout

See original GitHub issue

Given this amp-story-player example, which is taken from the docs but replacing fixed with responsive:

  <amp-story-player layout="responsive" width="360" height="600">
    <a
       href="https://preview.amp.dev/documentation/examples/introduction/stories_in_amp/"
       style="--story-player-poster: url('https://amp.dev/static/samples/img/story_dog2_portrait.jpg')"
    >
      Stories in AMP - Hello World
    </a>
  </amp-story-player>

If an amp-story-player is transformed via the Node.js AMP Optimizer, the result is this:

<amp-story-player layout="responsive" width="360" height="600" class="i-amphtml-layout-responsive i-amphtml-layout-size-defined" i-amphtml-layout="responsive">
  <i-amphtml-sizer style="display:block;padding-top:166.6667%;"></i-amphtml-sizer>
  <a href="https://preview.amp.dev/documentation/examples/introduction/stories_in_amp/" style="--story-player-poster: url('https://amp.dev/static/samples/img/story_dog2_portrait.jpg')"> Stories in AMP - Hello World </a>
</amp-story-player>

This results in another validation error:

Tag 'i-amphtml-sizer' is disallowed as child of tag 'amp-story-player'. Child tag must be one of ['a'].

See example in AMP Playground.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
westonrutercommented, Jan 19, 2021

Specifically, it accounts for the responsive layout but not the intrinsic one. In the responsive layout, the sizer looks like:

<i-amphtml-sizer style="display:block;padding-top:166.6667%;"></i-amphtml-sizer>

Whereas in the intrinsic layout, the sizer looks like:

<i-amphtml-sizer class="i-amphtml-sizer">
    <img alt aria-hidden="true" class="i-amphtml-intrinsic-sizer" role="presentation" src="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwMCIgd2lkdGg9IjM2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=">
</i-amphtml-sizer>

I’ll open a new issue specifically for the intrinsic layout.

1reaction
westonrutercommented, Sep 26, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrate stories in AMP pages
The AMP Story Player enables you to integrate stories that users are able to tap or click through, inside of a web page....
Read more >
Amp-img ALT problems with “” | WordPress.org
When I examine the Console error, I see that the AMP plugin is causing the problem. There is a mismatch caused by the...
Read more >
Newest 'amp-story' Questions - Stack Overflow
I am using AMP story player but it is not autoplay bydefau it. Even I set autoplay is true. It works when I...
Read more >
AMP Stories: Everything You Need To Know (Complete Guide)
With AMP Stories, Google is offering a beautiful place at the top of ... the AMP validator and report if the page passes...
Read more >
amp-iframe examples and tricks
Embedding iframes in AMP As we talked before, Accelerated Mobile pages of AMP ... AMP layouts provided as values to its layout attribute:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found