# Instagram embedding features and layout

**URL:** https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056
**Category:** Feature
**Tags:** embedding
**Created:** [July 16, 2022, 6:17pm UTC](https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056 "2022-07-16T18:17:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [July 16, 2022, 6:17pm UTC](https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056/1 "2022-07-16T18:17:18Z")

</div>

Hi!

I have a few questions and suggestions about Instagram posts embedding.

Here’s a post where I put three links: 1 video, 1 photo, and 1 gallery:

> **[Forum updates & features - Rework of several menus](https://unicyclist.com/t/forum-updates-features-rework-of-several-menus/271143/14)**
>
> You can now embed Instagram posts. It will show a preview. Clicking the media will redirect you to Instagram, which means that you can’t play the video directly on the forum post, but that’s better than nothing 🙂 Video: ...

### Video embedding

1. The image preview is stretched. Is it possible to prevent this?

2. There’s a tall white space on the bottom of the embed. The iframe’s height seems wrong. Is there a way to fix it?  

### Gallery embedding

The gallery embedding doesn’t use all the available width, but it does for a single image post. Can this be fixed as well?

 ![image](https://global.discourse-cdn.com/meta/original/4X/5/7/2/57268e4027cbf7797acf557d8b400a4e3d65eaac.jpeg)

* * *

In a more general way, what can Discourse customize in these embeds? Can it be customized, or is all the content style generated and provided by Instagram itself?

Also, I remember a time when Instagram posts had oneboxes where pictures were uploaded locally, like regular uploads, which prevented the onebox content to disappear if the related Instagram posts was removed. I suppose this is not the case anymore?

---

<div class="post-metadata">

### Author: ![piffy](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/piffy/32/254198_2.png) [@piffy](https://meta.discourse.org/u/piffy)
#### Post date: [July 16, 2022, 7:14pm UTC](https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056/2 "2022-07-16T19:14:31Z")

</div>

I just went through the (frankly) cumbersome task of registering a Meta app that will allow oEmbeds earlier today. I don’t know why they made the process so difficult, especially the part where they want to verify your app works in order to approve the permissions but the functionality of the app depends on the permission existing (!!??). Waiting to hear back soon

I can’t address any of the questions here myself, mostly posting to follow this topic. I did read somewhere on this meta forum that the non-onebox version of Instagram embeds do not play well with infinite scroll, specially due to the variable height. Is that what’s happening here? I’ll also mention that just a quick search for “instagram” on the discourse github repo does a good job at finding the relevant bits of code

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [September 11, 2022, 3:38pm UTC](https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056/3 "2022-09-11T15:38:08Z")

</div>

> [@Canapin](#):
>
> Also, I remember a time when Instagram posts had oneboxes where pictures were uploaded locally, like regular uploads, which prevented the onebox content to disappear if the related Instagram posts were removed. I suppose this is not the case anymore?

I’d like to add an emphasis on this.

I also wonder if it’s possible at all to embed Facebook public links. I couldn’t find a way to do so. It also doesn’t work on Discord, by the way. All it does is show a log-in invitation written in a language [not always well-chosen](https://meta.discourse.org/t/facebook-onebox-shows-wrong-language/232369), since based on the server on which Discourse is hosted, and despite several users asking about this, I don’t remember seeing any solution or workaround.

Does someone know the status of Discourse/meta regarding Instagram/Facebook embeds?

* * *

Here’s an example of a 2021 post from my forum, with properly embedded Facebook and Instagram posts with excerpts and downloaded remote images: [Desert MUNI Race Ridgercrest, Ca - #23 by jmadrigal - General - Unicyclist.com](https://unicyclist.com/t/desert-muni-race-ridgercrest-ca/127502/23?u=canapin)

It was perfect then, but now, the feature is broken (Facebook) and half-broken (Instagram). 😔

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [December 19, 2022, 10:27am UTC](https://meta.discourse.org/t/instagram-embedding-features-and-layout/233056/4 "2022-12-19T10:27:05Z")

</div>

> [@Canapin](#):
>
> Also, I remember a time when Instagram posts had oneboxes where pictures were uploaded locally, like regular uploads, which prevented the onebox content to disappear if the related Instagram posts was removed. I suppose this is not the case anymore?

I’ve found out that Discourse wasn’t able to retrieve Instagram’s image anymore, hence the iframe method that was implemented 2 years ago:  
[https://github.com/discourse/discourse/pull/14789/commits/d68859f6d8898679202193302bb40d075ba50e27](https://github.com/discourse/discourse/pull/14789/commits/d68859f6d8898679202193302bb40d075ba50e27)

* * *

Some layout issues I mention in this topic have been fixed since, but now Instagram embeds seem close to square-shaped, which crops the content:

 ![Instagram embed square-ish cropped contents](https://global.discourse-cdn.com/meta/original/4X/a/b/2/ab22e0f321da1c12459d1475e4406f3980818a70.jpeg)

Original IG links:

[https://www.instagram.com/p/Cl0v1o5S-S0/](https://www.instagram.com/p/Cl0v1o5S-S0/)

[https://www.instagram.com/p/ClyKnj8yW4B/](https://www.instagram.com/p/ClyKnj8yW4B/)
