Youtube Lite
-
So, with @psychobunny wanting to pass on his youtube plugin, I've decided to release mine for anyone to use.
You can install it by typing
npm install nodebb-plugin-youtube-lite
###Why Lite?###
This plugin lazyloads youtube videos on an as needed basis. It connects to youtubes API and pulls the thumbnail, and only loads the video when you click to view it, this plugin would be great for "youtube topics" where people post multiple videos.
###Screenshots###
###Issues###
Currently the video doesn't load when you first post, I'm working on it now though.iPad users will need to click play twice on videos, as iOS blanket ignores the autoplay command. (Autoplay is enabled so that once the video is loaded, it plays)
Questions?
-
Did you end up figuring out the correct hook btw?
-
@psychobunny Not yet, but my laptops overheating slightly, so didn't want to lose the post. If you spot anything wrong with it while I'm cleaning the fan, mind submitting a PR. I'll look when my laptops cleaned.
-
https://github.com/a5mith/nodebb-plugin-youtube-lite/blob/master/plugin.json#L8
callbacked
is deprecated, I imagine it's still on my own plugin as well (having it in won't make a difference any time soon, it'll just spit out a warning, I think)And yeah, the composer hook itself looks good to me
-
Ok, looking at this now,
action:composer.posts.reply
is the only one that fires when a new post is made. However i'm not sure if it's happening too early. As the video doesn't load.Latest version is currently 0.0.3.
npm install nodebb-plugin-youtube-lite@latest
###Changes###
Adjusted z-index bug that caused title and play button to appear over the composer
Changed how the video loads in preperation for me working out how hooks work. (Videos won't stop and refresh when a new video is posted) -
@Hưng-Thành-Nguyễn said:
@a_5mith this only works with logged in users? I have try withouth logged in and they just show nothing?
Works for me as a guest on my site. There's certainly no code that would stop guests from viewing. Tried refreshing the page?
-
@Hưng-Thành-Nguyễn said:
@a_5mith oh, sorry. I don't know why but my forum not showing any widgets with not logged in users.
Some plugins not showing, either.
Really weirdIf you still have an issue after you've resolved that issue, I'll take a look. But I promise it works.
-
@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...