Retain original URL for embedded media

Kirby

Well-known member
When posting a URL like https://www.youtube.com/watch?v=DHradnt7rQk XenForo turns this into [MEDIA=youtube]DHradnt7rQk[/MEDIA]

This works fine to embed the content - as long as provider youtube is available and enabled in XenForo.

If it is disabled or no longer available (maybe because it was provided by an Add-on that was removed) nothing would be displayed - which is not helpful at all for the average user.

I therefore suggest to modify the BB code so the original URL can be retained, maybe smth. like

Code:
[MEDIA="youtube,DHradnt7rQk"]https://www.youtube.com/watch?v=DHradnt7rQk[/MEDIA]

This way, if the provider is not available for whatever reason, XenForo could still display the link which would allow visitors to access the embedded content via that URL (if it is still available on the source of course).
 
Upvote 13
S9E Media Sites offers a variant of this as an option for a while now and I can totally see why this is going to be so useful in a lot of cases.


I believe his version is even more useful as it would also try to unfurl the link! Definitely worth considering as a native feature.
 
Last edited:
Preserving the original URL really desirable considering a lot of media embeds are moving targets and just aren't stable.

I funded the S9E Media Sites option which added an "embed" flag to the standard [url] tag which really helps having a graceful fallback when the embed dies or needs updating.
 
I funded the S9E Media Sites option which added an "embed" flag to the standard [url] tag which really helps having a graceful fallback when the embed dies or needs updating.
The idea is nice, but implementing this in an Add-on causes its own issues (untested so I might be wrong):
  1. Install s9e Media Sites
  2. Enable the option
  3. Post a YouTube video URL
  4. Uninstall s9e Media Sites
=> The YouTube video is no longer embedded, it's just a link.

And there is no waterproof way to get around this as the Add-on has know knowledge where [url] BB codes with embed might be used.

Therfore I really think smth. needs to be implemented in core, especially as the new internal embeds (why was yet another new BB code itroduced for this anyay?) do offer a fallback which seems pretty inconsistent.
 
The idea is nice, but implementing this in an Add-on causes its own issues (untested so I might be wrong):
  1. Install s9e Media Sites
  2. Enable the option
  3. Post a YouTube video URL
  4. Uninstall s9e Media Sites
=> The YouTube video is no longer embedded, it's just a link.
True, but installing it will make the links work again.

But this is still better UX if a media site gets delete, it'll just render as a link instead of a bb-code blob which is useless for everyone.

And there is no waterproof way to get around this as the Add-on has know knowledge where [url] BB codes with embed might be used.

Therfore I really think smth. needs to be implemented in core, especially as the new internal embeds (why was yet another new BB code itroduced for this anyay?) do offer a fallback which seems pretty inconsistent.
I'm not sure why the embed bb-code exists separately from url. I'll probably patch that out in an add-on.

Maybe update the suggestion to migrate embed/media to the url tag?
 
True, but installing it will make the links work again.
Yeah, but that obviously isn't an option if the intent is to no longer use it ;)

But this is still better UX if a media site gets delete, it'll just render as a link instead of a bb-code blob which is useless for everyone.
I don't disagree here, just wanted to point out that depending on an Add-on for such a (IMHO pretty important) feature might not be a good idea in the long run.

I'm not sure why the embed bb-code exists separately from url.
I don't know either, doesn't make much sense to me that we now have 3 different BB codes ([url], [media] and [embed] ) for a posted URL.

Maybe update the suggestion to migrate embed/media to the url tag?
Makes sense, maybe I'll try that via a report (as editing time has already passed).
 
Last edited:
Back
Top Bottom