这是indexloc提供的服务,不要输入任何密码
Skip to content

✨ Add firstPlay event #15074

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

Merged
merged 4 commits into from
May 4, 2018
Merged

✨ Add firstPlay event #15074

merged 4 commits into from
May 4, 2018

Conversation

alanorozco
Copy link
Member

No description provided.

@alanorozco alanorozco requested a review from aghassemi May 3, 2018 23:12
@@ -430,6 +430,20 @@ class VideoEntry {

element.signals().whenSignal(VideoEvents.REGISTERED)
.then(() => this.onRegister_());

//
Copy link
Contributor

Choose a reason for hiding this comment

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

rm

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

* Trigger event for first manual play.
* @private @const {!function()}
*/
this.triggerFirstPlayOrNoop_ = once(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make the naming and location of the method match existing timeUpdateActionEvent_ method.

Copy link
Member Author

Choose a reason for hiding this comment

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

The event is fired per-video, so it should be at the entry level. Unless you mean firstPlay should be triggered once per document?

* Trigger event for first manual play.
* @private @const {!function()}
*/
this.triggerFirstPlayOrNoop_ = once(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🙇 for adding once to our library, so useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's been handy once or twice before 🤓

*/
this.triggerFirstPlayOrNoop_ = once(() => {
const trust = ActionTrust.LOW;
const event = createCustomEvent(this.ampdoc_.win, 'firstPlay',
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

const trust = ActionTrust.LOW;
const event = createCustomEvent(this.ampdoc_.win, 'firstPlay',
/* detail */ {});
const actions = Services.actionServiceForDoc(this.ampdoc_);
Copy link
Contributor

Choose a reason for hiding this comment

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

this.actions_ should be available.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's available at the manager level, see comment above.

*/
this.triggerFirstPlayOrNoop_ = once(() => {
const trust = ActionTrust.LOW;
const event = createCustomEvent(this.ampdoc_.win, 'firstPlay',
Copy link
Contributor

Choose a reason for hiding this comment

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

const for firstPlay (mostly yo make it consistent with timeUpdateActionEvent_)

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

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