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

Do not duplicate the listeners when using media based advancement start/stop methods. #17289

Conversation

gmajoulet
Copy link
Contributor

Do not duplicate the listeners when using media based advancement start/stop methods.

Because the PAUSED_STATE calls the MediaBasedAdvancement.start and MediaBasedAdvancement.stop methods, it can happen that we duplicate the media advancement listeners (timeupdate and ended).
That's bad for performance, but led to a bug where it'd call the switchTo method multiple times when the video ends, breaking the story navigation.

  • Ensure we don't duplicate the media based advancement event listeners
  • Ensure navigation doesn't break if we try to navigate to the already active page

@gmajoulet gmajoulet requested a review from Enriqe August 3, 2018 20:02
@gmajoulet gmajoulet force-pushed the no_duplicate_listeners_media_based_advance branch from 0819c1c to ae47f8a Compare August 3, 2018 20:33
@gmajoulet gmajoulet force-pushed the no_duplicate_listeners_media_based_advance branch from ae47f8a to 6a6cd84 Compare August 3, 2018 21:22
@gmajoulet gmajoulet merged commit b23e08f into ampproject:master Aug 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants