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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌鈾伙笍Delegate autoplay using signal #15952

Merged
merged 3 commits into from Jun 12, 2018

Conversation

alanorozco
Copy link
Member

@alanorozco alanorozco commented Jun 11, 2018

  • Keeps interfaces cleaner
  • Fixes race condition where amp-story loads before amp-video, so amp-story needed to install the VideoManager service.
  • Since the VideoManager service no longer has to be bundled in the amp-story binary, its size reduces from 340134 to 303611 bytes before gzip.

@@ -35,6 +35,7 @@ import {LoadingSpinner} from './loading-spinner';
import {MediaPool} from './media-pool';
import {PageScalingService} from './page-scaling';
import {Services} from '../../../src/services';
import {VideoServiceSync} from '../../../src/service/video-service-sync-impl';
Copy link
Contributor

Choose a reason for hiding this comment

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

This is okay if it somehow makes your life easier, but generally speaking only P0 issues need to be resolved in 0.1. Any new features and fixes can happen in 1.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can revert 0.1 but that means supporting two delegation APIs at once.

If stability of 0.1 is a concern I don't mind doing the change (noting that 0.1 will still be bloated by the video service).

if (this.unlistener_) {
this.unlistener_();
}
this.unlistener_ =
playbackObservable.add(isPlaying => this.trigger_(isPlaying));
this.video.pause();
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this right? Isn't it possible that amp-story-page has already called play() and this will pause it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! This will not be called if the signal was already received.

(Note that video/autoplay.js is under experimental use by flag video-service).

@alanorozco alanorozco merged commit 2c64e31 into ampproject:master Jun 12, 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.

None yet

4 participants