Conversation
7705f24 to
128ebc4
Compare
|
Hi @chadladensack. Thanks for opening your PR again. I see you're still making changes so please ping me here once this is good to go! |
|
Validator changes look good. |
|
Hey @alanorozco, when I opened this new PR, the travis build was failing due to a node version update that existed in the master branch. The only difference between this PR and the original was the master merge in 128ebc4. We don't anticipate any modifications to the PR. If you notice anything during the review, let me know and I can jump on them right away. |
alanorozco
left a comment
There was a problem hiding this comment.
Thanks! Looks good, only a few change requests.
| this.muted_ = false; | ||
|
|
||
| /** @private {?boolean} */ | ||
| this.hasAmpSupport_ = false; |
There was a problem hiding this comment.
This one took me a second to figure out :) Consider renaming to frameHasAmpSupport_.
There was a problem hiding this comment.
I guess the amp-powr-player component would always have AMP support lol. +1 for the rename.
| this.playing_ = false; | ||
| } | ||
|
|
||
| if (redispatch(element, eventType, { |
There was a problem hiding this comment.
nit: define as top-level constant so the dictionary doesn't get recreated each time a message gets received.
| '<amp-powr-player> %s', | ||
| el); | ||
|
|
||
| const src = 'https://player.powr.com/iframe.html?' + |
There was a problem hiding this comment.
Nit: use addParamsToUrl:
const srcPrefix = 'https://player.powr.com/iframe.html';
const srcParams = dict({
'account': account,
'player': this.playerId_,
});
if (video) {
srcParams['video'] = video;
}
if (terms) {
srcParams['terms'] = terms;
}
const src = addParamsToUrl(srcPrefix, srcParams);There was a problem hiding this comment.
Solid idea. Makes it a lot easier to follow.
|
Thanks for your changes! Looks pretty solid to me. /to @aghassemi for a second pair of eyes and we should be good to go! |
aghassemi
left a comment
There was a problem hiding this comment.
Looks very close to finish line. A few requests. Thanks!
| @@ -0,0 +1,446 @@ | |||
| /** | |||
| * Copyright 2015 The AMP HTML Authors. All Rights Reserved. | |||
| ' Ensure it has the iframe plugin.', this.playerId_); | ||
| }, 3000); | ||
|
|
||
| this.playerReadyResolver_(this.iframe_); |
There was a problem hiding this comment.
This is resolving the ready promise too early. You wanna resolve inside your onReady. Maybe this was meant to be inside the timer above?
There was a problem hiding this comment.
Good catch. Moved the resolve into onReady_.
| this.playerReadyResolver_ = deferred.resolve; | ||
|
|
||
| // Warn if the player does not have video interface support | ||
| this.readyTimeout_ = Services.timerFor(window).delay(() => { |
There was a problem hiding this comment.
timer should start after the iframe is loaded. I think <1000ms between iframe loaded and readyMessage received should be enough to detect whether player is supporting the interface or not.
There was a problem hiding this comment.
This readyTimeout_ was meant to prompt the publisher to configure their powr player to use the required iframe plugin.
We recently modified the amp-powr-player iframe src ( https://player.powr.com/iframe.html) to automatically include the player iframe plugin, rendering readyTimeout_ obsolete. I'll be removing it shortly.
| @@ -0,0 +1,233 @@ | |||
| /** | |||
| * Copyright 2015 The AMP HTML Authors. All Rights Reserved. | |||
| @@ -0,0 +1,62 @@ | |||
| # | |||
| name: "data-terms" | ||
| mandatory_oneof: "['data-video', 'data-terms']" | ||
| } | ||
| attrs: { name: "[data-referrer]" } |
There was a problem hiding this comment.
no need to list data- unless mandatory or wanna enforce pattern for the value.
There was a problem hiding this comment.
This one would be necessary since it's an amp-bind attribute and not just a data- attribute value.
There was a problem hiding this comment.
Just to make sure we're all on the same page, I will leave data-referrer in the validation since it's an amp-bind attribute.
honeybadgerdontcare
left a comment
There was a problem hiding this comment.
validation looks good with some change requests.
| @@ -0,0 +1,62 @@ | |||
| # | |||
| # Copyright 2016 The AMP HTML Authors. All Rights Reserved. | |||
There was a problem hiding this comment.
Please make sure years in the licenses are the current year. In this case it should be 2018 not 2016.
| mandatory_oneof: "['data-video', 'data-terms']" | ||
| value_regex: "[0-9a-zA-Z-]+" | ||
| } | ||
| attrs: { |
There was a problem hiding this comment.
nit: please list attributes alphabetically by name, IOW data-terms should go before data-video.
| name: "data-terms" | ||
| mandatory_oneof: "['data-video', 'data-terms']" | ||
| } | ||
| attrs: { name: "[data-referrer]" } |
There was a problem hiding this comment.
This one would be necessary since it's an amp-bind attribute and not just a data- attribute value.
…ssing the external resource.
* cl/219531121 Revision bump for ampproject#17481 * cl/219850294 Allow `http` scheme for links in email spec * cl/219866890 Revision bump for ampproject#19043 * cl/219867113 Revision bump for ampproject#18981 * cl/219877087 Make ESlint happy. * cl/219882876 Fix lint for ampproject#19096
This is an
amp-powr-playercomponent to implement a Powr player as outlined in #18960.