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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(:fire:) AMP MowPlayer - Responsive Feature #19721

Merged
merged 38 commits into from Dec 31, 2018

Conversation

gopanisandip
Copy link
Contributor

I have added functionality to make our simple player and player with playlist responsive.

@torch2424
Copy link
Contributor

Traiging to @alanorozco since it involve amp-video 😄 Feel free to re-assign

Copy link
Contributor

@torch2424 torch2424 left a 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 😄

@@ -1 +1,5 @@
<<<<<<< HEAD
Copy link
Contributor

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 👍

Copy link
Contributor Author

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.

Copy link
Contributor

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') {
Copy link
Contributor

@aghassemi aghassemi Dec 10, 2018

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?

Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

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).

Copy link
Contributor Author

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!

@gopanisandip
Copy link
Contributor Author

@alanorozco Could you please take a look?

@aghassemi
Copy link
Contributor

@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.

@@ -4130,7 +4130,7 @@ function validateAttributes(
}
}
}
let missingAttrs = [];
const missingAttrs = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert this

@gopanisandip
Copy link
Contributor Author

@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
git add validator/engine/validator.js
git commit -m ""
git pull upstream master
git push

Let me know if still any changes are required.

@aghassemi
Copy link
Contributor

@gopanisandip please see the "changes" tab of this PR, there are still u related files checked in

@gopanisandip
Copy link
Contributor Author

gopanisandip commented Dec 24, 2018

@alanorozco @aghassemi I had removed all in related files changes. Could you please take a look?

@@ -1 +1 @@
- gopanisandip
gopanisandip
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@gopanisandip
Copy link
Contributor Author

@aghassemi So whats next?

@aghassemi
Copy link
Contributor

@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

@gopanisandip
Copy link
Contributor Author

@aghassemi could you please move forward with merging?

@aghassemi aghassemi merged commit bfe38f2 into ampproject:master Dec 31, 2018
noranazmy pushed a commit to noranazmy/amphtml that referenced this pull request Mar 22, 2019
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants