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

Request: way for amp-instagram embeds to resize themselves #5032

Closed
rafaelhbarros opened this issue Sep 15, 2016 · 12 comments
Closed

Request: way for amp-instagram embeds to resize themselves #5032

rafaelhbarros opened this issue Sep 15, 2016 · 12 comments

Comments

@rafaelhbarros
Copy link

rafaelhbarros commented Sep 15, 2016

Please walk through the following steps for reporting an issue about AMP:

Instagram embeds that contain height bigger than the default will overflow with a scrollbar.
It would be nice if it could resize itself after loading.

Unfortunately, we don't store the dimensions of the image on our CMS ahead of time, and loading them on a per-request basis is too expensive.

How do we reproduce the issue?

Here is an example of embed that causes the effect:

<amp-instagram width="400" height="400" data-shortcode="/p/BJ5sKT0g4S7/" layout="responsive">
@poscar
Copy link
Contributor

poscar commented Sep 15, 2016

@jasti Here's the issue mentioned on our call. Let us know if you have any questions or need any other details.

Thanks!

@cramforce
Copy link
Member

To fix this we'd need a contact with instagram.
CC @adewale in case he knows anyone there.

@adewale
Copy link
Contributor

adewale commented Sep 16, 2016

I've let Instagram know.

@poscar
Copy link
Contributor

poscar commented Oct 12, 2016

Any updates on this one? :)

@jridgewell
Copy link
Contributor

/cc @adewale

@adewale
Copy link
Contributor

adewale commented Oct 14, 2016

Sorry but we haven't made any progress with the Instagram folks. I'll ping them again.

@src-code
Copy link
Contributor

Has this one hit a dead-end? I'd love to have this one resolved, as we too have large amounts of Instagram-embedded content without image dimension data, so we're currently forced to assume a worst-case portrait aspect ratio, or suffer scroll bars.

@cramforce
Copy link
Member

I took a look and instagram is sending the data already (Test case http://output.jsbin.com/tozokoj/quiet See console).

So, this would be a simple change to amp-instagram.js

@src-code
Copy link
Contributor

Am I right in thinking this component would have to be wrapped in a 3p iframe ala Twitter/Facebook in order to properly map the messages to the specific embed instance? I might make an attempt at implementing this one...

@cramforce
Copy link
Member

@src-code Nope, no need for major changes. Just install a postMessage receiver from the current component (similar to amp-youtube and other video player) and handle the message they are sending.

@src-code
Copy link
Contributor

Ok, took a stab at implementing this one (#7705), would love feedback!

@jridgewell
Copy link
Contributor

Closed by #7705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants