s9e Media BBCodes pack

s9e Media BBCodes pack 20190411

No permission to download

colcar

Active member
Hi @JoshyPHP, a few times now I get the occasional report from my forum users that either;

a) only one half of an embedded tweet is loading (top half only loads)
or
b) embedded twitter video is stuttery and jumpy whereas the same tweet will be fine on twitter itself

This isn't the case for all users and doesn't seem to be limited to a specific browser/device either but I'm hoping you've heard of this happening before and can advise. Thanks! (y)

EDIT: Here's a thread on my forum just in case you want to check it out - https://onlyonecardiff.city/threads/best-post-match-reactions-burnley-away.9026/
 

JoshyPHP

Well-known member
@colcar I occasionally receive similar reports but they come and go and I've never been able to reproduce the behaviour. I've read that iOS Safari had some issues with redimensioning iframes but it works fine in Apple's iPhone simulator and I don't have a native iOS device to test it on. My best guess would be some kind of browser issue related to messaging.

Embedded tweets don't use the same player as the main site. That could explain the difference in performance, especially on mobile.
 

JackieChun

Well-known member
What happens when this add-on is uninstalled? Do the posts become unreadable? For example, what will happen to the post below, which was made while the add-on was still installed?

Code:
Check out this funny Twitter post, guys.
[MEDIA=twitter]1117641451008081922[/MEDIA]
 

JackieChun

Well-known member
Joshy, not sure I understand. Do you mean visitors will be seeing this raw code if the add-on is uninstalled?
 
Last edited:

JackieChun

Well-known member
So no way to reinstate virgin posts? Does that mean big forums are hooked on this add-on forever? I'm not saying that's necessarily a bad thing, but it's good to be able to plan your dependencies in advance and know a way out, especially with big projects.
 

JoshyPHP

Well-known member
The way XenForo works, old links are replaced with a MEDIA BBCode, which means they're lost forever. If you remove a media site (by uninstalling an add-on for example) you can either edit old posts or provide your own media site to display some kind of link.

Alternatively, XenForo has an option somewhere to add some markup when embedding a media site, which by default re-adds the old link. That only applies to posts submitted after the option is enabled.
 

JackieChun

Well-known member
Joshy, two questions.

First, I'm looking at the description of the BBCode replacement add-on that you've linked above. It looks like XenForo's native code for YouTube links is:

Code:
[media=youtube]ZSW4LDAHIeU[/media]
But isn't that identical to your add-on's syntax? If yes, does that mean that uninstalling the add-on will not hurt YouTube (and possibly other) links?

Second, in the discussion of the 2.0 version of this add-on, you wrote that uninstalling the 2.0 version will reinstate XenForo's native code. Does that mean that an admin can take the following steps in order to reinstate links without the add-on:
1) Uninstall the 1.5 version of s9e
2) Upgrade XenForo from 1.5 to 2.0
3) Install the 2.0 version of s9e
4) Uninstall the 2.0 version of s9e

Or am I missing something?
 

JoshyPHP

Well-known member
Yes, basic videos use the same syntax as the YouTube media site that are installed by XenForo by default. However, the default YouTube media site is overwritten by the one contained in this add-on. When the add-on is uninstalled, its own version of the YouTube media site is removed. For convenience, the add-on automatically reinstalls the default media sites when it is uninstalled. Features supported by this add-on but not supported by the default media sites won't work.

No, unless you use the XenForo feature that specifically adds a link below media embeds, links are lost forever, always, for all media sites and all add-ons.
 

JackieChun

Well-known member
If that's true, then my earlier example with a Twitter status should still work even without the s9 add-on, shouldn't it?

I actually had no idea that XF 2.0 supported so many media sites out of the box. This particular forum that I'm upgrading only uses Imgur, YouTube, Twitter, and reddit. Is there a big difference int he way the s9 embeds media from these 4 sites versus XenForo 2.0's native support?
 

JoshyPHP

Well-known member
If you remove the Twitter media site and you don't replace it, it doesn't work. If you uninstall something, it's not there anymore.

It depends on what you mean. The XF2 add-on generally supports the markup created by a default XF2 installation. The add-on uses a completely different approach to embed Twitter, Imgur and Reddit. There's some info in the FAQ:
Q: What is https://s9e.github.io and how is it used?
A: It has become a popular pattern among social websites such as Facebook and Twitter to provide embeddable content not in the form of an iframe but as JavaScript. There are several issues with this approach; Firstly, some of them only work during the initial page load and not in the post's preview. Secondly, it gives the third party content providers complete control over the current page. To sidestep those issues, this add-on uses a separate iframe that acts as a sandbox. This iframe is hosted on GitHub as a small (<1 KB) static HTML file. You can view an example of it on this page.
 

JoshyPHP

Well-known member
No, I don't know why it would behave like this. Probably some kind of faulty detection of the screen size or something like that. The embeds created by the add-on are set to not exceed to width of the screen so whatever causes that issue is almost certainly buried somewhere in Imgur's code and we can't change it.
 

nathanmiller

New member
No, I don't know why it would behave like this. Probably some kind of faulty detection of the screen size or something like that. The embeds created by the add-on are set to not exceed to width of the screen so whatever causes that issue is almost certainly buried somewhere in Imgur's code and we can't change it.
Ah okay, thank you!
 
Top