Users reported that video embeds from Facebook and other sites (including adult sites and Reddit) fail in Discourse, displaying broken players or error messages—and worse, removing the original URL entirely. pnoeric highlighted this as a serious usability issue, especially since Facebook links are commonly shared. Testing across browsers (Firefox, Safari, Chrome, iOS) confirmed the issue: videos appear but won’t play. techAPJ clarified that Facebook videos are not officially supported due to restrictive OpenGraph metadata (e.g., expiring video URLs). A quick workaround was suggested: add www.facebook.com to the onebox domains blacklist to prevent broken embeds techAPJ. david proposed using Facebook’s twitter:player meta tag for embedding, which techAPJ confirmed works after fixing URL encoding issues. codinghorror approved the fix, and techAPJ later implemented Facebook video oneboxing via iframe. Reddit video embeds were also fixed by showing a poster image with a play button overlay techAPJ. While blacklisting is a viable short-term fix, pnoeric advocated for Discourse to gracefully fallback to plain links when embeds fail, preserving the original URL. codinghorror noted that blacklisting problematic domains is manageable. The fixes now ensure Facebook and Reddit videos embed properly without breaking the user experience.
The problem also shows up with a few adult sites where members were trying to share links; I did a quick test where I pasted a bunch of video URLs from different places several of the major adult sites also do not work.
This seems like a relatively serious bug, only in that it impacts embeds for Facebook. My (less-tech-savvy) members like to share links to things on Facebook in part because it’s so popular and universal. Plus, if someone posts that URL to a message, it gets parsed into something that doesn’t work, and the original URL is gone. So you can’t even go to that URL if you wanted to… it’s not available at all any longer.
So… is it possible to tell Discourse to NOT try to auto-embed videos at those domains? I was looking for a setting like ‘blacklist URLs with these words from embedding media’ where I could add those domains. (Or perhaps a whitelist of approved URLs like youtube and vimeo, to help head off future issues with new sites.)
If not that, is there a quick fix I can do on my forums to help?
Yes, I would say that is critical. It’s not a big deal to me if Discourse doesn’t support Facebook video. It’s a big deal to me when a member pastes a link (hardly unusual) and it produces an error message… and the original link is gone. I have several messages like this in my forum now. Us admins are manually fixing them as we see this but obviously that’s not a great solution.
I believe this is a serious bug, only in that Facebook (along with other videos sites I’ve tested it with) is wildly popular.
I would love to figure out a quick fix… let me know if I can help?
The quickest fix here would be to add www.facebook.com to the setting: onebox domains blacklist. That way onebox will not try to embed facebook.com videos.
BTW a reminder that this happens on other sites besides Facebook; a member tried to post a link to a video page on xvideos.com and it failed as well. (NSFW warning! That is VERY MUCH an adult site!) I tested it with a handful of other sites and found the same.
I don’t think the link will expire because the URL is basically pointing at a facebook plugin that will embed video for whatever video link we pass in href parameter.
Note that the failing video onebox usually indicates that the error is in the site you are trying to embed. In case of Facebook, it was Facebook being too restrictive and allowing video playback for a certain time only.
We usually work around these errors only for sites that are very popular (example: Instagram) so that the wider community can reap the benefits. If the site is not popular and you need to embed them on your site then the recommended way is to create a custom plugin adding custom Onebox engine for that site.
Hmm. Is there a way to whitelist domains that onebox will try to embed? If not, it seems like we have this situation:
I run a community forum where members like to link to sites with videos. (These could be any sites, of course… we don’t know right now.)
If a site has an error in their code that prevent embedding from working, Discourse mangles the embed (ugly), and worse yet, removes the original URL so others can’t see what the OP was trying to share.
Doesn’t it seem like step 2 should be “If a site has an error in their code that prevent embedding from working, Discourse stops trying to embed and instead just lets the link pass through?”
I can’t fix this with the blacklist because I don’t know what domains are impacted by this, and of course, any site could have this issue in the future. Just like we saw here with Facebook.
Ok, that’s fine. I don’t have a great sense of how much of a problem this is; manually handling them is a great solution if there aren’t many domains with this problem.
I still think Discourse should handle malformed external data in a more graceful way besides “create giant error message and remove the most important content from the OP’s post”-- and I think you probably do too. But for now blacklisting is an acceptable workaround. Thank you.