Native Mobile Apps

Native Mobile Apps [Paid] 2023.04.22

No permission to buy ($149.00)
I cannot even see threads on your app.
After debug with your app I can give conclude some add-ons in your site has rendered HTML which not support in app.

Example:

Code:
<span data-s9e-mediaembed="youtube"><span><iframe allowfullscreen="" scrolling="no" allow="autoplay" style="background:linear-gradient(0deg,rgba(0,0,0,0) 0,rgba(0,0,0,0) 72%,rgba(0,0,0,.04) 79%,rgba(0,0,0,.1) 83%,rgba(0,0,0,.25) 88%,rgba(0,0,0,.67) 100%),url(https://i.ytimg.com/vi/n2-EfRgR34E/hqdefault.jpg) 50% 50% / cover" src="https://www.youtube.com/embed/n2-EfRgR34E" data-s9e-mediaembed-c2l="youtube" data-s9e-mediaembed-c2l-oembed-id="n2-EfRgR34E" data-s9e-mediaembed-c2l-src="https://www.youtube.com/embed/n2-EfRgR34E?autoplay=1"></iframe></span></span>

To support best for app it's should only return as follow:

Code:
<iframe allowfullscreen="" scrolling="no" allow="autoplay" style="background:linear-gradient(0deg,rgba(0,0,0,0) 0,rgba(0,0,0,0) 72%,rgba(0,0,0,.04) 79%,rgba(0,0,0,.1) 83%,rgba(0,0,0,.25) 88%,rgba(0,0,0,.67) 100%),url(https://i.ytimg.com/vi/n2-EfRgR34E/hqdefault.jpg) 50% 50% / cover" src="https://www.youtube.com/embed/n2-EfRgR34E" data-s9e-mediaembed-c2l="youtube" data-s9e-mediaembed-c2l-oembed-id="n2-EfRgR34E" data-s9e-mediaembed-c2l-src="https://www.youtube.com/embed/n2-EfRgR34E?autoplay=1"></iframe>
 
Hi, I'm the author of the add-on that generates this HTML. What would you need from me to be able to fix it on your side? Those span elements serve a purpose and I can't just remove them but I'd be happy to help you handle that markup better. The simplest way could be to simply remove the parts you don't need from the HTML, maybe by running something like the following code in a post-render code listener:
PHP:
$html = preg_replace(
	'(<span data-s9e-mediaembed=[^>]++><span[^>]*+>(.*?)</span></span>)s',
	'$1',
	$html
);

Would that be a solution for you?
 
Last edited:
Hi, I'm the author of the add-on that generates this HTML. What would you need from me to be able to fix it on your side? Those span elements serve a purpose and I can't just remove them but I'd be happy to help you handle that markup better. The simplest way could be to simply remove the parts you don't need from the HTML, maybe with something like the following:
PHP:
$html = preg_replace(
    '(<span data-s9e-mediaembed=[^>]++><span[^>]*+>(.*?)</span></span>)s',
    '$1',
    $html
);

Would that be a solution for you?
What's purpose if you return in API? It's other clients not for XenForo itself. I guess it should only do something in XenForo client itself. Also it should be like XenForo did with embed media sites when render for API.
 
I don't know what "in API" means here. This is just what I use for the _media_site_embed_youtube template. The default template that comes with a new XenForo install is similar, but it uses div elements instead:
HTML:
<div class="bbMediaWrapper">
	<div class="bbMediaWrapper-inner">
		<iframe src="https://www.youtube.com/embed/{$id}?wmode=opaque{{ $start ? '&start=' . $start : '' }}{{ $list ? '&list=' . $list : '' }}"
				width="560" height="315"
				frameborder="0" allowfullscreen="true"></iframe>
	</div>
</div>

There is no special consideration for the context in which the template is rendered.
 
@JoshyPHP API introduced since XenForo 2.0. Is it? You can see some behaviors in XF\BbCode\Renderer\ApiHtml it will rendered under API context.

Also the app has well behavior with div tag. It's rendered as View component while span as a Text and Text is plain.
 
As far as I can tell, the ApiHtml renderer renders media sites the same way as the Html class it extends. I don't know what a "View component" is, I assume this is something you use in your add-on. I use span to wrap iframes for convenience, because its behaviour with regards to CSS and HTML is closer to that of a default iframe. Both elements are phrasing content.
 
As far as I can tell, the ApiHtml renderer renders media sites the same way as the Html class it extends. I don't know what a "View component" is, I assume this is something you use in your add-on. I use span to wrap iframes for convenience, because its behaviour with regards to CSS and HTML is closer to that of a default iframe. Both elements are phrasing content.
That right! Almost bb-codes are same behavior with Html renderer that why I recommend you give a simply render for your bb-codes, it doesn't effect to existing html which using in threads, posts, etc...
 
I'm sorry but I can't understand what you're trying to say. Both XenForo's default media sites and mine use the same rendering pipeline and more or less the same markup. The only difference is the name of the element used as a wrapper around iframes. If your application needs a specialized renderer, it will be best implemented in your add-on. Possibly by extending the ApiHtml renderer and overriding renderTagMedia (although it could negatively affect other add-ons that rely on that renderer) or maybe more safely within your add-on, before you start processing the HTML. I don't know how your add-on works but I assume it takes the HTML and transforms it into something usable as/in a native app. Is there something preventing your from modifying the HTML as I proposed above, at the beginning of that process?
 
Top Bottom