Schweet. Houston, we have a work-around!
You are a gentleman and a scholar. A devious scholar, but a scholar nonetheless.
Schweet. Houston, we have a work-around!
You are a gentleman and a scholar. A devious scholar, but a scholar nonetheless.
I slightly worry that this workaround is costing the forum money. If each time we tweak the URL, the forum caches a new thumbnail (which is stored locally), then we’re wasting storage with redundant images.
On the other hand, perhaps it’s smart enough to hash the image data and de-dupe redundant thumbnails. If that’s the case, the waste isn’t all that bad (just some URL text). I don’t know if Discourse is actually doing that, though.
Any cache is going to be space- and time-limited. It’s not like Discourse is storing e.g. complete YouTube vids as if they were a CDN.
Certainly not full vids, but I was thinking thumbnails at least. On closer inspection, that’s not the case: the thumbnail shown in the preview window goes to YouTube:
https://img.youtube.com/vi/WJq4jWSQNd8/hqdefault.jpg
So really, I’m not sure what’s being cached that is confusing Discourse into thinking there is embedded media. It may just be a bit of HTML. But whatever it is, it takes Discourse a bit to fetch/parse it.
Ironically, this was not remotely fixed. The other day I had a video restart at least 6 times as I scrolled down. Incredibly annoying.
… and the link did post properly above but errored when I tried to edit the post.
I’ve seen a few links to this thread from other threads, but the information is a bit scattershot, so I think it’s worth summarizing.
The bug occurs because Discourse now sees a YouTube preview–that is, the inline video as compared to a bare link–as a “media item”. We don’t allow media items on this site for cost reasons, but in this case it’s a bug because the video is hosted elsewhere. And this is new behavior.
Discourse takes a few seconds to convert a bare link into a preview. That is the window of opportunity for a video post. So one fix is to just paste in your video links at the very end, and click “reply” as soon as you can. It will work if you click the button before the image appears in the preview.
You can extend that window by hiding the preview box (the “<<” button on desktop) beforehand. But once you post, the link will be converted, and you will be unable to either edit your post or post the link again.
The preview is based on the exact text of the URL. This is global, so if someone else posted the same URL anywhere else, you’ll be blocked because the preview has already been generated. But, you can bypass this by tweaking the URL slightly. On YouTube, you can always append a “&1”, “&2”, etc. to the end, and just keep incrementing if you need a new one (say, if you want to edit your post a bunch of times).
For anyone that’s interested in posting videos at all, just paste the YouTube link on its very own line. Discourse will do the rest. For example, your post should look something like:
Here's that cute cat video:
https://www.youtube.com/watch?v=eYlTO1jP_BY
Any thoughts?
If you need to edit your post, and get blocked by the bug above, then tweak the URL like so:
Here's that cute cat video:
https://www.youtube.com/watch?v=eYlTO1jP_BY&1
Any thoughts?
There’s no preview window in the mobile version of the site and this doesn’t work, sadly.
Just tried it and it worked for me. Not sure about mobile.
Note that this doesn’t avoid the problem when either editing a post or when linking to a video that someone else already posted. If the exact URL text has been posted anywhere, it’s too late.
“Preview” doesn’t exist in the mobile version of the site, so it’s like suggesting that a turtle unfurl its wings and fly to get somewhere.
But it’s an interesting tip for the desktop version of the site.
Well, ok, but it’s not necessary on the mobile site (I just tested this above to be sure), because there’s no preview. Everything I said still applies, aside from the lack of “<<” button: as long as the preview has not been created yet, the video will post. You get this by default on mobile, and on desktop by disabling the preview box. Editing, etc. work the same.
And by “mobile”, I mean using the mobile browser on a phone. I’m not sure if tablets work differently, or if there’s a native Discourse app.
So, for the folks who like to construct a post in order - if they put the link in, type for another half-hour, and then add the &1 just before submitting, it should work?
Sure, if you’re using “turtle” in the old-fashioned sense.
That’s right. The preview will turn back to a bare link temporarily, and if you hit reply before Discourse converts that to a picture, it’ll work.
I just tried on a tablet, and it does have a preview box. So I expect that to work the same as on desktop. Probably a screen width/area thing.
Thanks @Dr.Strangelove, for figuring that out and explaining it so well.
It works. Thanks!
I tried to add this line to an edit of my post above, but that failed and I got the error. Expected behavior of the bug.