Skip to main content

Plugins

The meetings plugins can be accessed using meeting.plugins. It provides two main objects, all which contains list of all Plugin objects in a DyteMeeting. And active list which contains plugins which are enabled and are currently being used in this meeting.

Playing with plugins

Plugins are webviews which can be added in any view. To be able to get webview from DytePlugin one needs to first activate a plugin. To do that all we need to do is call plugin.active() which will trigger a callback in onPluginActivated(). Similarly to deactivate a plugin one can call plugin.deactivate() and that plugin will be deactivated in the meeting.

plugin.activate() // to activate a plugin
plugin.deactivate() // to deactivate a plugin

Active plugin

To check if a plugin is active or not in a meeting one can use

let isActive = plugin.isActive

Listening to plugins in a meeting

To be able to listen to plugin events you need to implement a methods from callback DytePluginEventsListener. You can subscribe to these events by calling meeting.addPluginEventsListener(dytePluginEventsListener: listener)

extension MeetingViewModel: DytePluginEventsListener {

func onPluginActivated(plugin: DytePlugin) {
// your code to handle plugin activation
}

func onPluginDeactivated(plugin: DytePlugin) {
// your code to handle plugin de-activation
}

func onPluginFileRequest(plugin: DytePlugin) {
// your code to handle plugin file request
}

func onPluginMessage(message: [String : Kotlinx_serialization_jsonJsonElement]) {
// your code to handle plugin message
}
}