Youtube "short" videos type embedding/oneboxing not working


Youtube video embedding works on my forums, but not short videos (those with /shorts/ in the URL) like this one:

The onebox request returns a 404 error.

Regular youtube video embedding works.
I don’t encounter this issue on try.discourse or meta.
I suppose it comes from a site setting not properly configured.

Any clue?

Youtube oneboxing is something custom we created. Someone needs to submit a #pr-welcome for shorts compatibility. Moving to #feature

In the meantime you can always add the manual iframe URL to the allowed iframes site setting:

It’s a tall one tho :rofl:


Maybe it’s because of the location of the server, like it was/is here Youtube embeddings have stopped working for servers in Europe

1 Like

Thanks for the clarification!

Could you just tell me what URL should I add in allowed iframes in order to have the video shown as you did? It would perfectly do the job for now, even if it’s tall indeed.

As for the video height, it’s possible to make it less tall by setting a max-height with CSS on the iframe. The issue is that the iframe has no attribute of any kind that specify that it’s a short (vertical) vidéo. :confused:

<iframe width="672" height="1194" src="" frameborder="0" allowfullscreen="">

Thank you Falco.

I guess I’m going close, but I’m still a bit confused.

So, I’ve added this URL in the allowed iframes.

But then, what should I do in order to make the video appear?

If I write in my post, it won’t work.
If I write <iframe></iframe>, it won’t work.
If I write, it will work, but will display the short video with standard youtube video width/height ratio (which is OK for me, though I’d prefer having another ratio and not having to manually write “embed” in the URL):

Right click a shorts video and select “Copy embed code”. That is what I meant by “manual embed code”, sorry I wasn’t clear.


Also, replacing /shorts/ by watch?v=, the default URL of a Youtube video, works.

So, in youtube, on, doing right click → Copy video URL will work since it returns which is correctly displayed on Discourse (with the regular wide ratio though).

1 Like