# OneBoxed Khan Academy 视频无法播放

**URL:** <https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443>\
**Category:** Support\
**Created:** [2019年三月1日 15:11 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443 "2019-03-01T15:11:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![danekhollas](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danekhollas/32/79637_2.png) [@danekhollas](https://meta.discourse.org/u/danekhollas)\
**Post date:** [2019年三月1日 15:11 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/1 "2019-03-01T15:11:36Z")

</div>

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.:

[https://cs.khanacademy.org/computing/computer-science/internet-intro/internet-works-intro/v/what-is-the-internet](https://cs.khanacademy.org/computing/computer-science/internet-intro/internet-works-intro/v/what-is-the-internet)

> **[Client Challenge](https://cs.khanacademy.org/computing/computer-science/internet-intro/internet-works-intro/v/what-is-the-internet)**

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

---

<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:** [2019年三月1日 17:12 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/2 "2019-03-01T17:12:19Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)\
**Post date:** [2019年三月1日 17:27 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/3 "2019-03-01T17:27:49Z")

</div>

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 💣

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2019年三月1日 19:16 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/4 "2019-03-01T19:16:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2022年四月6日 18:35 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/5 "2022-04-06T18:35:57Z")

</div>



---

<div class="post-metadata">

**Author:** ![dax](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dax/32/244677_2.png) [@dax](https://meta.discourse.org/u/dax)\
**Post date:** [2022年四月7日 16:27 UTC](https://meta.discourse.org/t/oneboxed-khan-academy-video-not-working/110443/6 "2022-04-07T16:27:35Z")

</div>


