OneBoxed Khan Academy video not working

Hi there!

So if I post a link to Khan Academy video page, OneBox recognizes it as a vid but fails to embed properly, e.g.:

I wonder whether this is fixable somehow? Note the KA itself embeds videos from YT, so maybe that’s the problem?

I think the problem is that the OG video tag on that page links, which is a direct link to download an SWF (which is what we’re trying to embed in the video tag here).

So we’re basically forming a bad <video> tag. We should probably check to see if the og:video tag uses a valid file type for video embeds and ignore it if it doesn’t?

Even if we checked the og:video tag for youtube links, this one wouldn’t work. I think we’d also have to do something special like convert to


This could be solved adding a new Onebox engine that extracts the og:video URL and transforms it into an embeddable youtube video.

The downside of this strategy is that the number of engines will get bigger and bigger, leading to a Class explosion anti-pattern :bomb:


If we see this pattern (og:type = video + youtube link) we could special case it. But I think this is just a bad formed OpenGraph tag.

Iframely handles it, but Facebook doesn’t.