Youtube Lite
-
@Hưng-Thành-Nguyễn said:
@a_5mith yeah, it's working now, bro. It's because of shoutbox plugin, which disabled all function. Thanks man
Ah yeah, make sure it's up to date. I believe that issue was fixed.
-
@Hưng-Thành-Nguyễn said:
Btw, shoutbox is not working with not logged in users, either.
I think that's intentional...
-
@Hưng-Thành-Nguyễn said:
@a_5mith I can't find the option for that.
I have to hide its widget manual.My mistake, there isn't one, I just have hide from anonymous users ticked from the widgets menu.
-
@a_5mith yeah, even in new version he has made it can hide from the anonymous and not break the forum. But it's funny that this plugin will not work if I place shoutbox's widget in global header. Still have to disable it for anonymous.
Anw, that's the solution for now -
-
This is my two cents. This is a fix for users when paste yt videos with
&something
library.js:
(function(module) { "use strict"; var YoutubeLite = {}, embed = '<div class="js-lazyYT" data-youtube-id="$1" data-width="640" data-height="360"><iframe class="lazytube" src="//www.youtube.com/embed/$1"></iframe></div>'; var regularUrl = /<a href="(?:https?:\/\/)?(?:www\.)?(?:youtube\.com)\/(?:watch\?v=)(.+)">.+<\/a>/g; var shortUrl = /<a href="(?:https?:\/\/)?(?:www\.)?(?:youtu\.be)\/(.+)">.+<\/a>/g; var embedUrl = /<a href="(?:https?:\/\/)?(?:www\.)youtube.com\/embed\/([\w\-_]+)">.+<\/a>/; var longUrl = /<a href="(?:https?:\/\/)?(?:www\.)?(?:youtube\.com)\/(?:watch\?v=)(.+)&.+">.+<\/a>/g; YoutubeLite.parse = function(data, callback) { if (!data || !data.postData || !data.postData.content) { return callback(null, data); } if (data.postData.content.match(embedUrl)) { data.postData.content = data.postData.content.replace(embedUrl, embed); } if (data.postData.content.match(longUrl)) { data.postData.content = data.postData.content.replace(longUrl, embed); } if (data.postData.content.match(regularUrl)) { data.postData.content = data.postData.content.replace(regularUrl, embed); } if (data.postData.content.match(shortUrl)) { data.postData.content = data.postData.content.replace(shortUrl, embed); } callback(null, data); }; module.exports = YoutubeLite; }(module));
-
@RazorAxis said:
I am trying to put some css in to make these resposive with no such luck, anyone have a css code that works? Thanks.
Remove these two lines.
nodebb-plugin-youtube-lite/static/style.less at master · a5mith/nodebb-plugin-youtube-lite
Lazyloads Youtube Videos on your NodeBB Forum. Contribute to a5mith/nodebb-plugin-youtube-lite development by creating an account on GitHub.
GitHub (github.com)
-
So the following happened:
We over at BitBangers were discussing about forking this plugin and adding a prefix to allow of just posting the link in the shoutbox, and not the enormous embed view. So I started doing that.
When I was done, I remembered that in 0.6.x there are a couple parsing hook changes and that it won't matter because the shoutbox will use
parse.raw
, and this plugin listens toparse.post
.I still pushed it to my repo so do with it what you want
In short, if you prefix a youtube url with a
!
, it'll show something like this. Clicking on the icon will toggle the embed view.Choosing
!
as prefix probably wasn't the best idea but you can easily change it in the regex.