-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Description
Description
Stories send a viewer message storyContentLoaded for our definition of "initial content is loaded and playback is ready". It is only sent when the visibilitystate is visible and never when prerender, which we do need now.
The event is blocked by storyLayoutPromise here:
amphtml/extensions/amp-story/1.0/amp-story.js
Lines 991 to 998 in ca6f01c
| storyLayoutPromise | |
| .then(() => | |
| this.whenInitialContentLoaded_(INITIAL_CONTENT_LOAD_TIMEOUT_MS) | |
| ) | |
| .then(() => { | |
| this.markStoryAsLoaded_(); | |
| this.initializeLiveStory_(); | |
| }); |
We do need to run this code after this.initializePages_(), but no need to block on this.getAmpDoc().whenFirstVisible(), cf:
amphtml/extensions/amp-story/1.0/amp-story.js
Lines 941 to 944 in ca6f01c
| const storyLayoutPromise = Promise.all([ | |
| this.getAmpDoc().whenFirstVisible(), // Pauses execution during prerender. | |
| this.initializePages_(), | |
| ]) |
cc @ampproject/wg-stories
Alternatives Considered
Additional Context
No response
Reactions are currently unavailable