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.

[amp-story-player] Story not immediately loading in player, needs user interaction

See original GitHub issue

Description

I originally mentioned this at https://github.com/ampproject/amphtml/issues/34271#issuecomment-907008438, but I think it’s a separate issue altogether.

For the WordPress story editor we’ve been receiving some reports where stories being opened in a lightbox (using amp-story-player) are not immediately visible.

There’s some interesting behavior where the amp-story-player seems to load, but the story is not visible until some user interaction (i.e. press esc or click on the element).

Only after that interaction does the embedded story in the iframe have the i-amphtml-story-standalone classname.

From what I can see, that class name is added in the buildCallback of the amp-story component, so for some reason that is not being triggered initially:

https://github.com/ampproject/amphtml/blob/e1edbde829a6ffeaba986e5cc873359bd7322049/extensions/amp-story/1.0/amp-story.js#L518-L529

/cc @ampproject/wg-stories @Enriqe

Reproduction Steps

  1. Visit https://cai2r.net/
  2. Scroll down to where a story is embedded (there’s a poster image with the headline on top of it)
  3. Click on the poster image to open the amp-story-player in the iframe
  4. See black screen
  5. Click on center of the screen or press a key or something
  6. See how the story appears

Here’s a screenshot showing the missing i-amphtml-story-standalone classname at the beginning:

Screenshot 2021-09-06 at 11 49 56

Here’s a screencast showing the issue:

https://user-images.githubusercontent.com/841956/132198130-4bcb964e-0274-4f0c-9e08-5e2ed178b055.mov

Relevant Logs

Uncaught (in promise) Error: No messaging channel: initMessagingChannel timeout
    at ia (index.js:43)
    at tb.createError (log.js:295)
    at timer-impl.js:129
    at timer-impl.js:70

Browser(s) Affected

No response

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

2108192119000

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:57 (31 by maintainers)

github_iconTop GitHub Comments

2reactions
newmuiscommented, Sep 23, 2022

We did it, y’all! 🎉 💪

Thanks for the persistence everyone!

2reactions
processprocesscommented, Sep 29, 2021

Thank you for following up @swissspidy and posting the codepen. I’m able to reproduce the bug with that and will look into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

amp-story-player doesn't load stories if they inserted later
I want to get the stories from server first then create <amp-story-player> tag and insert <a> tags in it. If I wait until...
Read more >
Creating Web Story experiences using the Web Story Player ...
The Web Story Player is the best way for you to give users a rich user experience on your sites using Web Stories....
Read more >
AMP Stories: Visual Stories for the Web (Google I/O'19)
However, the story format, while popular in some apps, is not widespread across the open web. In this talk, you'll learn more about...
Read more >
Getting started with Web Stories - Tappable
All you need to know to create the best Web Stories using Tappable. ... Use the blank canva to its full extent and...
Read more >
spec/amp-story-player.md ... - GitCode
Embed and play stories in a non-AMP website. Required Scripts, <script async src="https://cdn.ampproject.org/amp-story-player-v0.js ...
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