NodeBB does not support HTML5 video
-
In the topic list:
But it does too, because when I go in to the topic I see the the posted video of a kitten averting the looks of its caretaker just fine.
I would surmise that it is in fact NodeBB who do not support HTML5 video.
-
@Mikael_Svahnberg Or maybe NodeBB is putting in only plain text from the latest post in the topic list to "give a preview" and for the post in question:
That just happens to be the only "plain text" in the post.
-
Hmm.
Yup! NodeBB is definitely doing it wrong, content inside <video> tags should always be ignored in HTML5.
-
@Mikael_Svahnberg I can only hope that this is "fixed" in such a way that causes hordes of videos to autoplay on the forum home page.
-
User Agent Accessibility Guidelines Overview
User agents include browsers, browser extensions, media players, readers and other applications that render web content.
Meaning the rule you point out is for web browsers. If a web application pulls the content out from the
<video>
tag for displaying elsewhere, it's not necessarily wrong for doing so. Whether it should be considered right to do is not something I'm going to argue though.
-
@Polygeekery said in NodeBB does not support HTML5 video:
@Mikael_Svahnberg I can only hope that this is "fixed" in such a way that causes hordes of videos to autoplay on the forum home page.
I think nodeBB should send the video to a CDN which converts it to an animated gif.
-
Hmm. Seems to me if it just said something more like "video not loaded", it'd be fine: You'd expect the video to not load in the recent post preview, but if you still saw that in the full post you'd probably know that something went wrong.
...actually, since
:before
and:after
are actually considered "content", and supporting browsers do not render the content of a<video>
element, this should work in any browser that supports:after
but not<video>
:video:after { content: 'Your browser does not support HTML5 video.'; display: block; }
Then you could just leave the
<video>
element empty, and there wouldn't be any text content for the recent topic list to grab.Or... maybe I'm overthinking this. You could just put a placeholder "broken video" image inside the
<video>
tag, and then the recent topic list would ignore that because it's an image.
-
@ChaosTheEternal said in NodeBB does not support HTML5 video:
Meaning the rule you point out is for web browsers. If a web application pulls the content out from the
<video>
tag for displaying elsewhere, it's not necessarily wrong for doing so. Whether it should be considered right to do is not something I'm going to argue though.Fair enough, in general. In this specific instance, though, when the entire purpose of what it's doing it to forward it on to a web browser, it's reasonable to say that it should follow web browser rules wherever possible.
-
@anotherusername said in NodeBB does not support HTML5 video:
if it just said something more like "video not loaded"
The point of the text is to convey something to people who are using a browser that does not support HTML5 video. Saying "video not loaded" doesn't necessarily convey that. How often you'll hit that in this day and age... well, how many people are worse than @Lorne-Kates?
@anotherusername said in NodeBB does not support HTML5 video:
since :before and :after are actually considered "content"
And then you have a localization issue in your CSS instead of only on the page itself. And we already know how great NodeBB is with localization...
@masonwheeler said in NodeBB does not support HTML5 video:
reasonable
Like I said, NodeBB isn't wrong with what it is doing, but I'm not going to argue that it's right, but it may very well take more effort to make the topic list preview drop content from certain tags entirely than to just leave it doing what it is doing.
-
@ChaosTheEternal NodeBB is transforming HTML into plain text. I'd say that pretty much counts as rendering, since it involves almost the same steps and logic.
-
@anonymous234 said in NodeBB does not support HTML5 video:
@ChaosTheEternal NodeBB is transforming HTML into plain text.
true.
@anonymous234 said in NodeBB does not support HTML5 video:
I'd say that pretty much counts as rendering, since it involves almost the same steps and logic.
"Parse this text as a SGML tree, walk tree in standard order, collect all text nodes in a single string, return"
no, that doesn't sound much like rendering an HTML page for display.
-
@accalia said in NodeBB does not support HTML5 video:
"Parse this text as a SGML tree, walk tree in standard order,
collect all text nodes in a single stringstrip out non-whitelisted nodes without removing child nodes, return"That's what it looks like it does, given this is the preview vs. the actual post content, as seen from Chrome Dev tools:
-
@ChaosTheEternal said in NodeBB does not support HTML5 video:
And then you have a localization issue in your CSS instead of only on the page itself. And we already know how great NodeBB is with localization...
In general, perhaps. But if it doesn't translate your post, or the video you posted, why should it translate the content inside the
<video>
tag? It's part of your post. Literally baked into the HTML.I mean... it doesn't even try, currently.
-
@anotherusername said in NodeBB does not support HTML5 video:
why should it translate the content inside the
<video>
tag?Because that is content that NodeBB (or a plugin for it, in this case, iframely) is generating. It makes sense to not localize or translate content made or linked by a user, because that's not NodeBB's content.
-
@ChaosTheEternal It's not generating it when a user requests the post, though. It's generating it when a user posts the post. Once it's baked into the post, it doesn't get localized. Like my screenshot showed, the content of the text node inside the
<video>
doesn't get localized at all.Putting it in the CSS would make it easier to localize. The text wouldn't be baked into the post, and you could have a .css file for each localization.
-
@anotherusername said in NodeBB does not support HTML5 video:
It's generating it when a user posts the post.
No it isn't.
Here's the whole content of the post that this thread is in reference to, but neutering iframely from handling it.
https://i.imgur.com/mFE7kTJ.gifv
NodeBB does not (AFAIK) store the "cooked" version of a post in the DB, that was Discourse. NodeBB at most caches what was generated, but if the post goes out of cache, it will be regenerated when it is fetched. The text "Your browser does not support HTML5 video." is not a part of the user generated content, which means it should be localized, or at least present a localizable token. It doesn't (or if it does, it always localizes it to English), and that's on the plugin.
And while I had a thought that at the point the post is cached that it'd be too late to "localize non user content", NodeBB does some post processing of the posts, thanks to the @-index trick (minus the dash, needed to neuter it) where the position number for the post in the loaded block replaces that text as content in the post or in their sig.
-
@ChaosTheEternal said in NodeBB does not support HTML5 video:
NodeBB does not (AFAIK) store the "cooked" version of a post in the DB, that was Discourse. NodeBB at most caches what was generated, but if the post goes out of cache, it will be regenerated when it is fetched.
Correct.
-
@ChaosTheEternal said in NodeBB does not support HTML5 video:
well, how many people are worse than @Lorne-Kates?
Just @mikeTheLiar