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?
Users are discussing an issue where OneBox fails to properly embed Khan Academy videos, despite recognizing them as videos. danekhollas provides an example link and suspects the problem stems from Khan Academy embedding YouTube videos via SWF, which OneBox can’t handle. awesomerobot confirms the issue: the og:video tag points to an outdated YouTube SWF URL (http://www.youtube.com/v/...), which doesn’t work in modern <video> tags. They suggest validating the file type or transforming the URL to a standard YouTube watch link. Roman proposes creating a new Onebox engine to rewrite the og:video URL into an embeddable YouTube format, but warns this could lead to a “Class explosion” as more engines are added. Falco suggests a special-case fix for YouTube links when og:type = video, but notes this may be due to malformed OpenGraph tags — while Iframely handles it, Facebook does not. The core issue is that the current OneBox logic doesn’t adapt legacy YouTube SWF URLs into embeddable formats.
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 http://www.youtube.com/v/Dxcc6ycZ73M, 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 http://www.youtube.com/v/Dxcc6ycZ73M to https://www.youtube.com/watch?v=Dxcc6ycZ73M
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 ![]()
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.