Skip to content
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

✨[amp-story-player] Install viewer integration script when inside the player #26719

Merged
merged 5 commits into from
Feb 11, 2020

Conversation

Enriqe
Copy link
Contributor

@Enriqe Enriqe commented Feb 10, 2020

Tracker #26308
Task #26694

@Enriqe Enriqe self-assigned this Feb 10, 2020
@@ -1016,6 +1016,7 @@ export class AmpStory extends AMP.BaseElement {
.then(() => {
this.markStoryAsLoaded_();
this.initializeLiveStory_();
this.initializeStoryPlayer_();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the timeout before the amp-story-player and its messaging API throws and error because the AMP document didn't respond to the handshake?

What happens on the amp-story-player side if the amp-story.js script takes a few seconds to load, and then the this.whenPagesLoaded_(PAGE_LOAD_TIMEOUT_MS)) times out?

Copy link
Contributor Author

@Enriqe Enriqe Feb 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the timeout before the amp-story-player and its messaging API throws and error because the AMP document didn't respond to the handshake?

20000 ms

What happens on the amp-story-player side if the amp-story.js script takes a few seconds to load, and then the this.whenPagesLoaded_(PAGE_LOAD_TIMEOUT_MS)) times out?

While the script is loading we would show the loader/poster image of the first story, and the story will be displayed when the script is loaded. If this.whenPagesLoaded_(PAGE_LOAD_TIMEOUT_MS)) times out, it would display an error in the console (which we haven't set yet), but it doesn't block laying out the story.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, my question was about the amp-story-player. It was triggering some errors if the amp-viewer-integration script was not loaded, wouldn't it trigger the same errors if the amp-viewer-integration is loaded too late?
What's the timeout on the player side of the viewer, before it throws one of these errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see what you mean... Yeah it will throw if no messaging channel has been initialized in 20s...

Were you thinking of adding additional an additional timeout at the player level?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the story doesn't load in 20s we have a problem, that sgtm :)) Thanks for investigating

@lgtm-com
Copy link

lgtm-com bot commented Feb 10, 2020

This pull request fixes 1 alert when merging 4f26d11 into da1fb54 - view on LGTM.com

fixed alerts:

  • 1 for Unreachable statement

@@ -1016,6 +1016,7 @@ export class AmpStory extends AMP.BaseElement {
.then(() => {
this.markStoryAsLoaded_();
this.initializeLiveStory_();
this.initializeStoryPlayer_();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the story doesn't load in 20s we have a problem, that sgtm :)) Thanks for investigating

extensions/amp-story/1.0/amp-story.js Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Feb 11, 2020

This pull request fixes 1 alert when merging 519206c into deed39a - view on LGTM.com

fixed alerts:

  • 1 for Unreachable statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants