New JavaScript plugin (via Duktape)

307 views
Skip to first unread message

Lorenzo Miniero

unread,
Jun 1, 2018, 11:21:17 AM6/1/18
to meetecho-janus
Hi all,

after the Lua plugin, I've created a new plugin that allows you to write your application logic via JavaScript as well, using Duktape as an engine. Pretty much WIP (I only started a couple of days ago), even though it's already functionally complete. You can find all the relevant details in the PR text:


Feedback welcome, especially from those familiar with Duktape! (I did a lot of guessing and so there may be stupid choices in the code)
Lorenzo

Mirko Brankovic

unread,
Jun 2, 2018, 4:12:55 AM6/2/18
to meetecho-janus
Great work! 
All those languages ... what is next php? ;)

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Diego Requena González

unread,
Jun 4, 2018, 2:27:32 AM6/4/18
to meetecho-janus
Do you mean that we can write our custom plugins or create a new ones based in old ones (e.g. videoroom) for janus-gateway as if we were writing a nodejs plugin?

That would be awesome for server side for people like me, that develops web applications and has 0 knowledge on C or any other application language.
D.

Lorenzo Miniero

unread,
Jun 4, 2018, 4:56:22 AM6/4/18
to meetecho-janus
You cannot modify the behaviour of existing plugins. This is a way to write your own custom plugin in JavaScript. To learn more you may want to read what I wrote at the time about the Lua plugin, as this is really pretty much the same thing with a different programming language.

L.

Diego Requena González

unread,
Jun 4, 2018, 5:16:01 AM6/4/18
to meetecho-janus
Sorry, probably I didn't explain myself. I didn't want to edit the videoroom plugin, just taking it as reference. For example, we have now a videoroom plugin using SFU topology, but I want to create a new one in JS using MCU topology. Can it be possible?

Best regards,
D.

Lorenzo Miniero

unread,
Jun 4, 2018, 5:26:49 AM6/4/18
to meetecho-janus
In principle, you can do whatever you want in terms of signalling, API, session management etc. in the plugin, but the media-related stuff depends on what the plugin provides natively: you don't handle media in JavaScript, you tell the native code what to do. So you can definitely write your own SFU (videoroom.lua is a basic example of that for Lua) since the native code allows you to hook sources to destinations easily, but MCU requires mixing, and this plugin doesn't provide mixing features: you'd have to add the C code for that yourself.

L.

Diego Requena González

unread,
Jun 4, 2018, 7:34:48 AM6/4/18
to meetecho-janus
Now I understand it better. Thank you so much.

Best regards,
D.

Lorenzo Miniero

unread,
Jun 18, 2018, 10:56:35 AM6/18/18
to meetecho-janus
Merged.

L.
Reply all
Reply to author
Forward
0 new messages