# Giphy onebox for animated gifs

**URL:** https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478
**Category:** Feature
**Created:** [3월 23, 2016, 1:50오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478 "2016-03-23T13:50:19Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [3월 23, 2016, 1:50오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/1 "2016-03-23T13:50:19Z")

</div>

Hey all,

I know some people were working on a gif plugin. However, I suggest to add [http://giphy.com](http://giphy.com) support to the onebox plugin as long as we do not have a proper plugin (and we might want to keep it for later as well).

Giphy provides all (most?) gifs as well as mp4. Unfortunately, the mp4 url does not end on mp4, but on html5. So that is why it does not work automatically.

---

<div class="post-metadata">

### Author: ![Koinu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/koinu/32/120781_2.png) [@Koinu](https://meta.discourse.org/u/Koinu)
#### Post date: [5월 24, 2016, 6:38오전 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/2 "2016-05-24T06:38:57Z")

</div>

Instead of oneboxing Giphy, I’d almost be more interested in seeing installation-local support for looping short videos:

- Discourse (plugin) would transcode mp4 / webm versions of gifs and attach them to the post. When viewing the post, only one of the formats—the best one supported by the browser—would actually be rendered.
- Animated gifs from Giphy and elsewhere would automatically be downloaded and attached, the same as ordinary images. Within the bounds of sanity checking, the various formats from upstream would be grabbed instead of transcoding locally and potentially worsening quality.

This is almost certainly a _very_ low priority feature, but It’d still be nice to have. 🙂

* * *

This old thread is related, but misses a key point of what I’d like to see. That being ideally these looping videos should have a user experience that is _exactly_ identical to directly attaching a .gif, aside from automagically consuming less bandwidth (and/or being higher quality).

Showing video player controls and invoking “video” presentation semantics is… very 😬.

> [@Should Discourse convert GIFs to mp4 video files?](https://meta.discourse.org/t/should-discourse-convert-gifs-to-mp4-video-files/16739/):
>
> Just read about this neat trick that Twitter is doing with GIFs: [http://blog.embed.ly/post/89265229166/what-twitter-isnt-telling-you-about-gifs](http://blog.embed.ly/post/89265229166/what-twitter-isnt-telling-you-about-gifs) Perhaps this is something Discourse would like to mimic in the future. And for the watercooler: If a video format does everything GIF does and more, and with better compression, are the days of the GIF numbered?

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [5월 24, 2016, 9:16오전 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/3 "2016-05-24T09:16:15Z")

</div>

In the meanwhile I suggest to embed giphy gifs. It cannot be so difficult to  
write a plugin for onebox. The data is already there:

> **[Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed](https://debug.iframely.com?uri=http%3A%2F%2Fgiphy.com%2Fgifs%2Fcheezburger-penguin-ice-22zIpaS7fhqU)**
>
> Check your URL against Open Graph, Twitter Cards, oEmbed specs. See what other apps see.

Have a look at the opengraph.

Best,  
Robert

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [8월 17, 2017, 10:25오전 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/4 "2017-08-17T10:25:06Z")

</div>

I prepared a giphy html5 video version, but it does not work due to the being stripped out autoplay at some point for any reason. Also, I do not know if autoplay would be a good idea performance wise in topics with many autoplay videos…

> **[GitHub - rriemann/onebox at giphy\_video](https://github.com/rriemann/onebox/tree/giphy_video)**
>
> giphy\_video

[https://github.com/rriemann/onebox/commit/f3f45faa04b57501c0a89d92bd8923c367f81e59](https://github.com/rriemann/onebox/commit/f3f45faa04b57501c0a89d92bd8923c367f81e59)

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [10월 3, 2017, 10:39오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/5 "2017-10-03T22:39:10Z")

</div>

It looks like the current giphy support in Discourse might be broken? On my site, this plays correctly for five minutes as long as it’s pointing to an external host, then when Discourse tries to mirror it in S3 locally after 5 minutes as normal with image uploads, it won’t animate anymore.

[https://media.giphy.com/media/xT9IgII4kip7a2C97W/giphy.gif(image larger than 10 MB)](https://media.giphy.com/media/xT9IgII4kip7a2C97W/giphy.gif)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [10월 3, 2017, 10:44오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/6 "2017-10-03T22:44:17Z")

</div>

Nope, that is new functionality. Any external image larger than (x) will be blocked as a bandwidth hog (for mobile, etc) unless you explicitly allow it in your site settings.

You will see a placeholder and have to click through on it to see the giant 40 megabyte plus image, rather than having it hotlinked live.

---

<div class="post-metadata">

### Author: ![axfelix](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/axfelix/32/65166_2.png) [@axfelix](https://meta.discourse.org/u/axfelix)
#### Post date: [10월 3, 2017, 11:19오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/7 "2017-10-03T23:19:46Z")

</div>

Ah, OK! thanks for the quick response; that makes sense.

Would it be easier to _not_ try to mirror images beyond a certain size threshold in that case?

---

<div class="post-metadata">

### Author: ![notriddle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/notriddle/32/133055_2.png) [@notriddle](https://meta.discourse.org/u/notriddle)
#### Post date: [10월 3, 2017, 11:22오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/8 "2017-10-03T23:22:55Z")

</div>

“Bandwidth hog” doesn’t just mean for the forum. It’s mostly for the user’s benefit.

---

<div class="post-metadata">

### Author: ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)
#### Post date: [9월 18, 2018, 12:53오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/9 "2018-09-18T12:53:08Z")

</div>

> [@codinghorror](#):
>
> Any external image larger than (x) will be blocked as a bandwidth hog (for mobile, etc) unless you explicitly allow it in your site settings.

Could it be that this feature is broken? Let’s see (I’m pasting `https://media.giphy.com/media/Lcn0yF1RcLANG/giphy.gif` below):

[https://media.giphy.com/media/Lcn0yF1RcLANG/giphy.gif(image larger than 10 MB)](https://media.giphy.com/media/Lcn0yF1RcLANG/giphy.gif)

Edit: okay, this is strange: discourse handles this gif in rather unpredictable ways. The first time I published this post, there was absolutely nothing in the rendered post. Then I added it to transparently mention the url I’m pasting and that produced a broken image placeholder the size of the actual image. The editor preview here on meta consistently shows a small broken image icon (not the size of the image).

On another site that I’m administering, the editor always shows the actual animated gif but the rendered post shows no trace of the image at all. Except when I rebuild the post-html, the url shows up as a link for a split second before it disappears again.

And finally, while I typed the above, the broken image placeholder in the post has disappeared from the rendered post. So at least after some time, the rendered posts look the same across sites, but still, something is wrong here.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 18, 2018, 7:42오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/10 "2018-09-18T19:42:03Z")

</div>

Can you verify this has not regressed @vinothkannans?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [9월 18, 2018, 7:53오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/12 "2018-09-18T19:53:05Z")

</div>

I wonder if it’s part of Giphy’s effort to make it very difficult to hotlink gifs? the link [The Wire Wow GIF - Find & Share on GIPHY](https://media.giphy.com/media/Lcn0yF1RcLANG/giphy.gif) isn’t an actual link to a gif (it used to be!), it’s a giphy page with an embedded webp.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [10월 7, 2018, 1:15오후 UTC](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/13 "2018-10-07T13:15:57Z")

</div>

This is now fixed as per below commit. @tophee now the large image placeholder is displaying in [your post](https://meta.discourse.org/t/giphy-onebox-for-animated-gifs/41478/9).

[https://github.com/discourse/discourse/commit/c499872597e608bcc23de56fc853dcd8f5079a16](https://github.com/discourse/discourse/commit/c499872597e608bcc23de56fc853dcd8f5079a16)
