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
(:fire:
) AMP MowPlayer - Responsive Feature
#19721
Conversation
…l upstream master
Traiging to @alanorozco since it involve |
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.
Will let @alanorozco do the review, but noticed something 😄
extensions/amp-mowplayer/OWNERS.yaml
Outdated
@@ -1 +1,5 @@ | |||
<<<<<<< HEAD |
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.
We should remove merge conflict issues 👍
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.
Hi i have resolved conflicts. Could you do more review? so that we can more forward.
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.
Hello, thank you for fixing the merge conflicts!
I'll let @aghassemi and @alanorozco handle the rest of the review, as they are much more familiar than I am with the video players in AMP. Thank you for your contribution however! 😄
@@ -228,6 +230,10 @@ class AmpMowplayer extends AMP.BaseElement { | |||
|
|||
const {element} = this; | |||
|
|||
if (eventType === 'set_aspect_ratio') { |
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.
This equates to a height
change which is not always allowed. attemptChangeHeight
is the API to use here.
@gopanisandip could you explain what this PR is trying to do?
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.
It looks like this is doing something very similar to layout=responsive
? padding-top
hack and all :)
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.
@alanorozco @aghassemi Let me explain what we need is : We have player with playlist so in that case aspect ration of player is not always 16:9 because we have feature in mowplayer.com so that user can choose position of playlist like right side of player and bottom of player. so in that case we have 2 different aspect ratio. Also if user choose right position of playlist than also we have it in bottom in mobile device.
so when ever player load or screen rotate at that time we event will be fired from iframe with new aspect ratio and in this way we can make it responsive. This event will calculate padding-Top based on internal content of player.
This is not limited to playlist only we have another version of player which have different aspect ration based on screen resolution aspect ration will change.
Please check this screenshot links :
http://prntscr.com/ltbzev
http://prntscr.com/ltbzpq
http://prntscr.com/ltbzu3
http://prntscr.com/ltbzxw
http://prntscr.com/ltc030
Could help me to figure out this? Problem here is we don't have fixed aspect ratio.
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.
Got it. See @aghassemi's comment above. You need to calculate the fixed height based on the component's width (basically height = width * scale
, where scale is the value received as padding-top
divided by 100
).
Then you can attemptChangeHeight(height)
. The runtime may reject the request to change height, and that would be working as intended (It's one of AMP's core promises that content should not shift vertically under certain conditions).
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.
Got it. Thanks will change it!
@alanorozco Could you please take a look? |
@gopanisandip Changes look good but there are couple of unrelated files checked in (iltorb@2.4.1, node) and a unrelated change. Please revert those. Thanks. |
validator/engine/validator.js
Outdated
@@ -4130,7 +4130,7 @@ function validateAttributes( | |||
} | |||
} | |||
} | |||
let missingAttrs = []; | |||
const missingAttrs = []; |
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.
please revert this
@alanorozco Could you please check now. i reverted validator/engine/validator.js file. I had used following commands to revert file and take latest pull. git checkout validator/engine/validator.js Let me know if still any changes are required. |
@gopanisandip please see the "changes" tab of this PR, there are still u related files checked in |
ac95c28
to
cc14750
Compare
@alanorozco @aghassemi I had removed all in related files changes. Could you please take a look? |
extensions/amp-mowplayer/OWNERS.yaml
Outdated
@@ -1 +1 @@ | |||
- gopanisandip | |||
gopanisandip |
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.
-
should not be removed from this file.
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.
Ok this is reverted. Ideally there should not be any change on this file but due to conflicts previously we have this file got updated.
Anyway, Could you please take a look again in this PR and let me know if any changes required.
@aghassemi So whats next? |
@gopanisandip Lint is failing on the CI, please run gulp lint locally and fix the issue, after that CI checks should be green and I will merge the PR |
@aghassemi could you please move forward with merging? |
* Added code for amp-mowplayer extension * Fixed lint errors * Removed satisfies/requires pairs * Fixed link errors and removed unused method * Added JsonObject type casting * Added json typecast * Added username in OWNERS.yaml * supported layout in validator files needed by match IsFixedSize * autoplay attribute was missing * Update validator-amp-mowplayer.protoascii * Update validator-amp-mowplayer.protoascii * Update validator-amp-mowplayer.protoascii * Regenerated .out file * added resposive feature via postMessage * Fixed lint errors * Removed Conflicts * Resolved conflicts in owners.yml * Added attemptHeightChange * Revert "Added attemptHeightChange" This reverts commit aebd8ea. * Reveted in expected change and added attemtheightchange * Revert unwanted changes * Revert OWNERS.yaml * Changes in parameter * Fixed Lint errors and check type
I have added functionality to make our simple player and player with playlist responsive.