Very large gifs should be shown as previews

Yes @techapj can you add support for gfycat to oneboxer?

「いいね!」 4

I had added it to onebox. It looks like for some reason just white listing it like imgur didn’t worked as expected.

Definitely the first step is onebox embedding gfycat.

The next step I think would be for a plugin to do the gif -> gfycat conversion. Anyone could do this, and if gfycat support is properly added to onebox, I would do it eventually if no one else did.

「いいね!」 5

I suspect it didn’t get properly whitelisted in the HTML sanitizer.

「いいね!」 1

It seems like there is a bug with gfycat oEmbed, it always returns CooperativeScentedAnkolewatusi in the iframe.

Various links that confirms the issue:

Removing gfycat from whitelist, until this issue is resolved.

「いいね!」 4

The OpenGraph data seems to be correct, can’t that be used instead of oEmbed?

「いいね!」 2

Okay, added custom gfycat handler to use OpenGraph data endpoints instead of oEmbed:

https://github.com/discourse/onebox/pull/285

「いいね!」 4

Does this do the gif like embed, or does it require pressing play?

「いいね!」 1

It requires pressing play. Demo pic:

「いいね!」 1

This is because if gifs without sound autoplay, then gifs with sound (could) autoplay too…

gyphy gifs don’t have sound because they are converted from gifs.

The whole point is not to embed a video, but to use video like a gif.

That means the gif should loop (yes I know not all gifs loop) and auto play. At the very least, it should loop until the user presses stop.

「いいね!」 1

I understand @riking’s concern, but in this case it is totally safe to whitelist autoplay+loop for oneboxed Gifly GIF-videos as they do not have sound.

Note that Imgur also does not support sound, but as a precaution oneboxed GIF-videos are muted by default:

<video id="video" autoplay="autoplay" muted="muted" preload="auto" loop="loop" poster="//i.imgur.com/YfPjduYh.jpg">
    (...)
</video>

We should simply do the same for Gfycat.

「いいね!」 4

Doesn’t look like this is working? :frowning:

The gem needs to be updated.

@zogstrip can you please bump onebox version and update the gem?

「いいね!」 1

There you go :wink:

https://github.com/discourse/discourse/commit/f180d2202564febf8c6195684c01b6c7f51d4faa

「いいね!」 7

@techAPJ I rebuilt @chapel’s post and it seems that it isn’t looped by default?

「いいね!」 2

I believe this is now handled with @vinothkannans recent PR.

The xxxxtra large Gif was (eventually, pending background tasks) replaced with image placeholder. @vinothkannans does the tooltip work now so I can mouse over this kind of random looking generic image placeholder and get a plain English explanation of what happened?

「いいね!」 3

Let’s see if this is still working:

「いいね!」 4