# קישוריות תומכות ל-TikTok ל-Onebox

**URL:** https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413
**Category:** Feature
**Tags:** pr-welcome
**Created:** [1 באפריל,‏ 2020,‏ 10:42am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413 "2020-04-01T10:42:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)
#### Post date: [1 באפריל,‏ 2020,‏ 10:42am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/1 "2020-04-01T10:42:12Z")

</div>

Anyone from Discourse know what it might take to allow for embedding of tiktok videos via onebox? It continues to grow as people look to find ways to escape a bit duringthe crisis

---

<div class="post-metadata">

### Author: ![evantill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evantill/32/116219_2.png) [@evantill](https://meta.discourse.org/u/evantill)
#### Post date: [1 באפריל,‏ 2020,‏ 1:10pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/3 "2020-04-01T13:10:24Z")

</div>

> **[Iframely URL Debugger - Open Graph, Twitter Cards, oEmbed](https://debug.iframely.com/?uri=https%3A%2F%2Fwww.tiktok.com%2F%40seeverinee%2Fvideo%2F6810376764192312581)**
>
> Check your URL against Open Graph, Twitter Cards, oEmbed specs. See what other apps see.

try to add **[www.tiktok.com](http://www.tiktok.com)** in the white list of onebox parameters

 ![Administration_-_Apel_Sophie_Barat](https://global.discourse-cdn.com/meta/original/3X/0/5/05c96eb9a90dac6321756756b0e38b571575e281.png)

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [1 באפריל,‏ 2020,‏ 1:13pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/4 "2020-04-01T13:13:36Z")

</div>

No need to whitelist - that setting is just for “inline oneboxes”. You can already onebox tiktok content by pasting it on a line by itself. Unfortunately they don’t provide an og:video value, so it’s just a link, thumbnail and description.

[](https://www.tiktok.com/@the_trickstars/video/6809983350699314437)

---

<div class="post-metadata">

### Author: ![evantill](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/evantill/32/116219_2.png) [@evantill](https://meta.discourse.org/u/evantill)
#### Post date: [1 באפריל,‏ 2020,‏ 1:13pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/5 "2020-04-01T13:13:40Z")

</div>

Result on my discourse:

 ![Essai_onebox_oembeded_-Essais-_Apel_Sophie_Barat](https://global.discourse-cdn.com/meta/original/3X/3/3/331a8724124521fe9fb60489aeafded174bc7dc3.png)

---

<div class="post-metadata">

### Author: ![charleswalter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/charleswalter/32/116433_2.png) [@charleswalter](https://meta.discourse.org/u/charleswalter)
#### Post date: [1 באפריל,‏ 2020,‏ 10:37pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/6 "2020-04-01T22:37:06Z")

</div>

Thx. I guess I was referring to embedding video like youtube. So that would require tiktok to make a change?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2 באפריל,‏ 2020,‏ 1:05am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/7 "2020-04-02T01:05:06Z")

</div>

Yes either they make a change or we write a custom tiktok plugin.

There is some precedence in the plugin route, I know twitter expand them nicely.

---

<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: [2 באפריל,‏ 2020,‏ 1:34am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/9 "2020-04-02T01:34:58Z")

</div>

Their embed is kinda on the heavy side.

So maybe we go on an approach similar to Instagram, where we build our own thing?

Just media (we can add _some_ metadata):

Embed:

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2 באפריל,‏ 2020,‏ 2:48am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/10 "2020-04-02T02:48:48Z")

</div>

Just media + some metadata looks right to me. This embed does not stop flashing after it plays and is super noisy.

---

<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: [2 באפריל,‏ 2020,‏ 8:43pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/11 "2020-04-02T20:43:17Z")

</div>

Oh, looks like we can’t do our own. TikTok, like Instagram, use short-lived URLs so if we use the media directly posts are broken in less than a day (check my post above).

On Instagram this made we gave up on trying to embed videos and we do a fancy link. Since TikTok is **just** videos, I’m not sure it’s worth the effort if we don’t do a working player like Youtube, Vimeo, etc.

---

<div class="post-metadata">

### Author: ![klh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klh/32/184826_2.png) [@klh](https://meta.discourse.org/u/klh)
#### Post date: [23 ביוני,‏ 2020,‏ 3:53pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/12 "2020-06-23T15:53:43Z")

</div>

Don’t know if they won’t lock you out, but after hitting `https://www.tiktok.com/embed/v2/VIDEO_ID?lang=en-US` with curl I get HTML that has the proper video url. You’d just have to parse that out and send it to the front-end to display. Seems pretty easy.

---

<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: [23 ביוני,‏ 2020,‏ 4:34pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/13 "2020-06-23T16:34:30Z")

</div>

> [@klh](#):
>
> proper video url

The problem is that this URL expires.

---

<div class="post-metadata">

### Author: ![klh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klh/32/184826_2.png) [@klh](https://meta.discourse.org/u/klh)
#### Post date: [23 ביוני,‏ 2020,‏ 4:36pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/14 "2020-06-23T16:36:33Z")

</div>

Yeah, but you can get it again, even after each page reload (so not a simple embed but a proper custom “widget”)

---

<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: [23 ביוני,‏ 2020,‏ 4:38pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/15 "2020-06-23T16:38:41Z")

</div>

Making a topic page block waiting for TikTok servers ?

At this point it makes more sense to use their official oEmbed with iframes.

---

<div class="post-metadata">

### Author: ![klh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/klh/32/184826_2.png) [@klh](https://meta.discourse.org/u/klh)
#### Post date: [23 ביוני,‏ 2020,‏ 4:41pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/16 "2020-06-23T16:41:51Z")

</div>

Why block? Make it work the same as their embed, but without the extra fluff that’s not needed. Multiple requests have to be made to get it to work anyway, I’d reckon this way will work faster than the official one that loads a full-blown React app.

I’d be more than happy to create a PoC plugin for this ;p

---

<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: [23 ביוני,‏ 2020,‏ 4:43pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/17 "2020-06-23T16:43:55Z")

</div>

> [@klh](#):
>
> I’d be more than happy to create a PoC plugin for this ;p

Please do and share with the community!

---

<div class="post-metadata">

### Author: ![ddf](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@ddf](https://meta.discourse.org/u/ddf)
#### Post date: [21 בספטמבר,‏ 2020,‏ 4:51pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/18 "2020-09-21T16:51:50Z")

</div>

Tiktok support oembed:

[https://developers.tiktok.com/doc/Embed](https://developers.tiktok.com/doc/Embed)

---

<div class="post-metadata">

### Author: ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)
#### Post date: [2 במרץ,‏ 2021,‏ 7:47pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/19 "2021-03-02T19:47:43Z")

</div>

[](https://www.tiktok.com/@deeptomcruise/video/6932166297996233989)

Is this still not working? See above.

---

<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: [2 במרץ,‏ 2021,‏ 9:12pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/20 "2021-03-02T21:12:36Z")

</div>

We can’t created a custom embed because TikTok uses expiring URLs for their media.

Our only option is using their Embed, which

> [@sam](#):
>
> does not stop flashing after it plays and is super noisy.

At this point the options are:

- We cave in and enable their embed into core

- Someone who cares about TikTok enough creates or sponsors a plugin that add TikTok embed support.

Any of the options are technically simple as we will just use their iframe.

---

<div class="post-metadata">

### Author: ![Terrapop](https://avatars.discourse-cdn.com/v4/letter/t/ecd19e/32.png) [@Terrapop](https://meta.discourse.org/u/Terrapop)
#### Post date: [2 במרץ,‏ 2021,‏ 10:02pm UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/21 "2021-03-02T22:02:20Z")

</div>

As the outcome only affects communities with TikTok links posted, I would rather prefer to have it in the core via iFrame, as compared to the current 100% defunct way.

---

<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: [3 במרץ,‏ 2021,‏ 12:23am UTC](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413/22 "2021-03-03T00:23:07Z")

</div>

@sam what about doing the iframe embed only when an admin adds the tiktok domain to their iframe site setting ?

[Next page](https://meta.discourse.org/t/supporting-tiktok-urls-for-onebox/146413.md?page=2)
