Why are you sometimes allowed to link to Youtube and other times not?

Sometimes I’m able to include a link to a YouTube video in a thread. These are plain unformatted URLs, and they are typically converted to a preview with summary by the software which is super helpful.

Other times when I include a YouTube link, I get an error when trying to submit the post. The error says “An error occurred: Sorry, you can’t embed media items in a post.” and that blocks you from submitting the entire post unless you remove it. There is no way that I can figure to bypass that error by removing the auto-generated preview (which I assume is the source of the issue). I’m obviously not using an embed tag or anything comparable. The only option is to convert the link to a formatted link using the editor which then omits the preview and summary and obscures the destination of the link from the reader.

I assume this is a transient bug in the software, but I’m curious is anyone has any workarounds or info about it.

For testing purposes, this is the link that’s currently triggering the error.

//https://www.youtube.com/watch?v=F9udC1oqu10

(broken intentionally by adding backslashes)

Interesting.

Hiding the preview window did not work. But appending an & did.

Thanks.

It’s not about the preview (or lack thereof), it’s about how long that link is sitting there before you submit the post. IME, if you don’t hit the post/reply button within a few seconds, the youtube link won’t work, ever. If/when that happens, slightly adjusting the URL (ie appending a suffix so it starts at the 1 second mark) will ‘fix’ it, but you still have to be quick about it.

What works best, at least for me, is to write your post and after you’re done, then paste the youtube link and hit submit right away. If there’s more than one youtube link, write the post (or at least the part with the links) in a different program, then paste the whole thing here and hit submit, again, right away.

I went quick.

It worked!

Sorry for the Georgian song about spring.

Hiding the preview prevents Discourse from generating the thumbnail for the video, which is the real cause of the bug. Hiding the preview didn’t work for Omniscient because they already tried to post the video. Discourse did its thing and broke that specific URL forever. But you can generate an infinite number of variations by appending &1, &2, etc.

If you are the first to post a video, then hiding the preview will work and you don’t have to be quick about it.

Maybe for you, not for me. I rarely have the preview window on (and never while I’m typing) and I have the problem with youtube links all the time. At least for me, the youtube problem is unrelated to anything involving the preview window.

Then someone else posted the video (it doesn’t have to be you). Or you’re editing your own post, in which case it’ll always happen, preview or not.

Well I never posted a link or a video so I am enjoying my momentary success lol.

Will practice from this point on.

URL forever ruined? That’s brutal.

Will this work. No preview, just letting the link sit here for a few seconds before I hit submit:

Strange, that’s never worked for me before.

I wonder if there’s a variation in behavior based on which browser you’re using.

It’s not completely impossible that some browsers might render the preview even when hidden. That would depend on how the preview is hidden and how the browser behaves.

But Joey_P tried it above on a fresh video and it worked as I described. So I expect that the seeming variability is just due to some other effect, like the video having already been posted by someone else.

It took us a while to figure out the bug due to everyone having a slightly different experience, not to mention misreporting. But I am very confident now that it works as I described in the link above.

It’s the same in Chrome and Edge in Windows, as well as Safari on iOS. Oh and Edge and Chrome in Android also, based on my experience at least.

I have not tested in Firefox since I haven’t used that browser for many years, so it’s possible that it works different on it. Or Opera, which I haven’t used in more than 20 years (and that was on Mac OS X, before Safari even existed, heck even Mozilla didn’t exist yet).

Moderating

Since this is discussed in other threads in Site Feedback, let’s close this.

Please direct all further comments to the already existing Site Feedback threads.