Janus - General purpose WebRTC server
July 07, 2021
1 min

Janus - General purpose WebRTC server

What is janus?

As described by its creator meetecho, janus is a general purpose WebRTC endpoint that browsers can interact with, and different modules can determine what should be done with the media. You can do, text messaging, video conferencing, streaming and more other things with janus. Also if there is no such module to do stuff what you are looking, you can expand janus by yourself.

Why we want janus?

For basic one to one webrtc communications, we established peer connection directly by the browser. But when we want to expand it to, multi-user platform like video conference or chat room, we want media server. Here janus play that media server role.

Janus architecture and APIs

There are some main sections in janus architecture.

  • Core - core of the server specified in here.
  • Plugin - plugins will help to implement such things like, video streaming, video conferencing, etc. Also you can create your own plugin by Plugin API.
  • JavaScript API - this will help you to integrate with plugins that provide by janus server.

there are few other APIs in janus, But these are the main and usefull apis when we working with janus. you can refer others in here.

How to use janus in your application

There is file janus.js This will help us to communicate with janus media server and working with the plugins that janus already provided. First you need to make a Janus object in your application and attach one of the plugin to it like below.

Janus.init({debug: "all", callback: function() {
      // Make sure the browser supports WebRTC
      // Create session
        janusRoom = new Janus(
              server: JANUS_SERVER_URL,
              iceServers: ICE_SERVERS,
              success: function() {
                  // Attach to VideoRoom plugin
                          plugin: "janus.plugin.echotest",

after that you will return pluginHandler object with many commands and event handlers.Then you can use that handler to implement your specific feature. You can refer those commands and events in janus.js.



Related Posts

How to install Janus Gateway in Ubuntu Server 18.04
July 15, 2021
1 min