[nodebb-plugin-soundcloud] SoundCloud embed plugin
-
It is working for me, too.
But it throws a pretty nasty error, nonetheless.I suspect that the
self
in question is intended to be the WebWorker in use there. WebWorker.postMessage, as opposed to window.postMessage (which the global self is set to at the time of the error being thrown), allows the second parameter to be optional.'use strict'; /*global require, module, self*/ (function(module) { var templates = { cache: {}, globals: {} }, helpers = {}, loader, worker; var regexes = { ... }; if (typeof self !== 'undefined' && self.addEventListener) { self.addEventListener('message', function(ev) { var data = ev.data; self.postMessage({ // THROWING ERROR result: !data.block ? templates.parse(data.template, data.object) : templates.parse(data.template, data.block, data.object), signature: data.signature }); }, false); }
-
You can clone my personal soundcloud plugin from github.
It's more or less the same, but it supports sets and tracks, and the play button is blue, but look in library.js and remove the additional parameters if you don't want them.
-
@rbeer said:
@a_5mith said:
I'm using it on 0.7.0, so yes. Well, it will until @julian commits the change that breaks every plugin I've made.
plugin-youtube-lite?
Or is there really something incoming?I need to update all of my plugins at some point. However I'm currently overseeing a migration at work, so time isn't something I have a lot of. Accepting pull requests though, I believe it's just a
A change to how the regexp handles link parameters like no follow. -
@Kalbaskin @a_5mith
Both plugins are fine.
The second parameter was just overlooked in templates.js, but fixed: https://github.com/psychobunny/templates.js/issues/34
Updating templates.js solves the problem for me:npm update templates.js
-
@rbeer i have It does not work:
npm update templates.js
npm http GET https://registry.npmjs.org/templates.js
npm http 200 https://registry.npmjs.org/templates.js
npm http GET https://registry.npmjs.org/templates.js/-/templates.js-0.2.7.tgz
npm http 200 https://registry.npmjs.org/templates.js/-/templates.js-0.2.7.tgz
npm http GET https://registry.npmjs.org/templates.js/0.2.7
npm http 200 https://registry.npmjs.org/templates.js/0.2.7
npm http GET https://registry.npmjs.org/templates.js/-/templates.js-0.2.7.tgz
npm http 200 https://registry.npmjs.org/templates.js/-/templates.js-0.2.7.tgzSoundCloud embed plugin is not work =(
-
@Kalbaskin
Well, that's odd.
Does your browser's JS log show errors/warnings?
Does the post with the soundcloud link look like the screenshots?Just to be sure: What does the
"version"
field in/yourNodeBB/node_modules/templates.js/package.json
say? -
-
Console.log('soundcloud')
Add that to line 8 of library.js.
Then post a soundcloud link and look in console for that text as a log. I'm on a mobile so can't check myself just yet. But will do shortly.
I don't think it's the sound cloud plugin. But need to rule it out.
-
@Kalbaskin
Did you look for it in the nodeBB output? (./nodebb start
, then./nodebb log
; or./nodebb dev
; I would suggest the later for debuging.)
If you add the line as @a_5mith asked you to, the text does not show up in your browser's console, but rather in the log output of your server, since the file in question is executed on server, not client side.I tested both plugins against nodeBB 0.7 and they work as expected.
@Kalbaskin said:
Content: "link text" - instead of player soundcloud.
This looks like none of the plugins (soundcloud, soundcloud-35hz) are activated.
What does your ACP under Extend -> Plugins show? I imagine that having both plugins (soundcloud and soundcloud-35hz) active at the same time could cause some hickups.
When you start your nodeBB with./nodebb dev
, do you see any errors or a line that says:24/6 07:35 [18969] - verbose: [plugins] Loaded plugin: nodebb-plugin-soundcloud
or
24/6 07:35 [18969] - verbose: [plugins] Loaded plugin: nodebb-plugin-soundcloud-35hz
respectively.Which of the two plugins do you want to use, anyway?
I'm quite sure that this is not a bug in either of the plugins you're facing now.