Embedding redesigned reddit topics with video

How can we embed reddit videos in our post? For example this post:

Link here

Has an embed code like this:

<blockquote class="reddit-card" data-card-created="1588774544"><a href="https://www.reddit.com/r/VALORANT/comments/gdyrsg/i_also_decided_to_edit_at_2am/">I also decided to edit at 2AM</a> from <a href="http://www.reddit.com/r/VALORANT">r/VALORANT</a></blockquote>
<script async src="//embed.redditmedia.com/widgets/platform.js" charset="UTF-8"></script>

How about this?


Which does this:

Oh. That’s no good. You want the video to play in discourse, not bump you to Reddit.

1 Like

Yeah we want to if possible play it right there like YouTube and Vimeo.

Haha you two want that, but have you considered what Reddit wants?

Since they changed their whole philosophy and started the v.redd.it thing it is not the same anymore.

All OpenGraph and Twitter Card tags give us a static image. Reddit is pretty clear on only allowing a static image to be embedded.

If you did further, you find that the video is in a DASH container, so audio and video are separate files. Getting that to play on Discourse means, at least, using a custom JS video player.

1 Like

Actually Reddit is allowing this:
5-6-2020 6-21-57 PM

When you press on the Embed button it provides the following:

My issue is how to allow that to display in my post in my Discourse site.

I tried the old.reddit share and it’s just an image too. Is that the new reddit UI?

Yeah its the new one.

1 Like

Oh looks like they are outsourcing it to embed.ly.

Digging into it, appears that using the post ID can be used to construct a working iFrame after all.

Unless @techAPJ wants to take it, I’d say #pr-welcome

<iframe src="https://old.reddit.com/mediaembed/gdyrsg" width="690" height="388">



@Falco, can we figure out something that doesn’t autoplay the video?

Edit: If we forcibly apply allow="autoplay 'none'" to the iframe element in the html sanitizer, that might fix this (on new browsers only).

Also none of the buttons on the player work (e.g. pause, full screen, etc)