-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Allow prerendering amp-video poster #1718
Conversation
0c52c23
to
f2251f9
Compare
const posterAttr = this.element.getAttribute('poster'); | ||
|
||
if (!posterAttr) { | ||
console/*OK*/.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to spam readers with warnings? Should it be protected by devmode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. Will add development condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we protect it by devmode, lets make it an error :)
Ok, as discussed face to face, we'll be using build callback to create and append the required dom for prerendering. For example, in the case of In a similar manner we're going to address the @dvoytenko let me know if I missed anything. I'll get the change ready and update this PR. |
@mkhatib sg |
f2251f9
to
203c7f1
Compare
@@ -16,8 +16,6 @@ limitations under the License. | |||
|
|||
### <a name="amp-facebook"></a> `amp-facebook` | |||
|
|||
**Status: Component landed, but does not validate.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cramforce This is no longer the case right?
203c7f1
to
90ccded
Compare
@dvoytenko PTAL, I am not sure this is the best way to do the tests, so if there's a better way happy to use that. |
@@ -36,11 +36,31 @@ export function installVideo(win) { | |||
} | |||
|
|||
/** @override */ | |||
layoutCallback() { | |||
buildCallback() { | |||
/** @private @const {?HTMLVideoElement} */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq, how is this nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be, I just kept the same annotation type previously used, will update this to be not nullable (that's {!...} right?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep thats right 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. It should be non-nullable with !
.
@dvoytenko thanks for all the comments 😄 PTAL |
return loadPromise(video).then(() => { | ||
setStyles(video, {visibility: ''}); | ||
return loadPromise(this.video_).then(() => { | ||
setStyles(this.video_, {visibility: ''}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove as well since we are not hiding it above. Basically we don't need then
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
I think we are all good. Just one more comment. |
65c467a
to
64d9dbd
Compare
Done. Thanks again 👍 |
LGTM. Please fix linter errors. |
64d9dbd
to
27f28d0
Compare
27f28d0
to
5f0dc86
Compare
Added a small change to fix the flakey test that we talked about and rebased with master. Will merge this after tests run. |
Allow prerendering amp-video poster
Not entirely sure this is the way to go about this, but happy to take another stab at this
Closes #1657