website logo
CommunityDocumentation
JavaScript SDK
Web App Plugins
Cloud One-Touch Join
Request License
Navigate through spaces
JavaScript SDK
Web App Plugins
Cloud One-Touch Join
Request License
⌘K
Create a plugin
Files structure
Defining the plugin capabilities
Adding functionality
Create a branding package
Upload to Infinity
Plugin Gallery
Anonymizer
Breakout Rooms
Change Layout
Chat Notify
Directory
Fullscreen
Maintain URL
Move to Waiting Room
Raise Hand Notification
Recording
Rename Participant
Screenshot
Server Mute Notifier
Start Muted
Survey
Video Mute Participant
Docs powered by archbee 
14min

Adding functionality

The <name>.plugin.js file contains all of the logic and code for the plugin. It is called upon both by the plugin state and also by user interaction.

Basic <name>.plugin.js file layout

An example plugin.js file without any functionality is shown below.

JS
|

This basic plugin.js code contains multiple parts which will be explored below.

load

This method is used by the webapp2 application when the plugin is first instantiated. This method will be called with two observables.

participants$

This observable is used to receive updates about participants within the plugin. An example of subscribing to this observable is below.

JS
|

conferenceDetails$

This observable is used to receive updates about the conference within the plugin. An example of subscribing to this observable is below.

JS
|

unload

This method is used by the webapp2 application when the plugin is unloaded. It should be used to clean up the plugin, for example, used to stop any intervals or timers that may be running.

Registering the Plugin

At the bottom of the above example, there is a block of code that is used to register the plugin and map the methods inside of the plugin to be accessed by the webapp2 application. an example code block looks like below.

JS
|

A breakdown of the method parameters is listed below.

  • id - this is the id of the plugin from the plugin.package.json file. This must match that file.
  • load - this is a mapping of the load method to expose it for the webapp2 application
  • unload - this is a mapping of the unload method to expose it for the webapp2 application

Adding a Method for User Interaction

In the plugin.package.js file, there is an option to call a method on a button push. An example of this is below, in this example,m there is an action that is calling the "changeConferenceLayout" method on push.

JSON
|

The above example from the plugin.package.json file would be paired with the following code in the plugin.js file.

JS
|

In the above example, there are two parts to make this button push work. First there is a method, with the same name as the action parameter in the plugin.package.json file. In this example it is showing a message in the console that says "changeConferenceLayout was pushed".

JS
|

Secondly, there is a mapping within the registerPlugin call that maps the method for access by webapp2 application. In the below example, notice the line that says changeConferenceLayout: changeConferenceLayout. This is the mapping.

JS
|



Feedback

Do you have any suggestions? Get in contact with us here.

Updated 17 Aug 2022
Did this page help you?
Yes
No
UP NEXT
Create a branding package
Docs powered by archbee 
TABLE OF CONTENTS
Basic <name>.plugin.js file layout
load
unload
Registering the Plugin
Adding a Method for User Interaction
Feedback