How to personalize your video conference component with SuperViz
Posted by Vitor Norton | March 6, 2024
SuperViz is a low-code SDK designed to accelerate your software development by entrusting us with the responsibility of crafting top-tier collaboration tools for you. With just a few lines of code, you can implement a video conference feature inside your application. But what if you want more personalization than the default options of our Video SDK?
In this article, we are going to show how to use our methods and callback functions to customize your video meeting component.
Callback functions
When using the Video Conference, you can define a range of callbacks to handle specific events and interactions within the meeting. These callbacks allow you to respond to participant actions, meeting state changes, and other event-driven functionalities.
To define a callback, you need to pass a function when creating the Video Conference, as shown in the example below:
1import { VideoConference } from "@superviz/sdk/lib/components";23const video = new VideoConference({4callbacks: {5onToggleMicrophone: () => {},6onToggleCam: () => {},7onToggleTranscript: () => {},8onToggleChat: () => {},9onToggleScreenShare: () => {},10onClickHangup: () => {},11onToggleMeetingSetup: () => {},12},13});
When you pass a function to the callbacks
object, the default behavior of the Video Conference will be overridden by the function you provide. This allows you to customize the behavior of the Video Conference to suit your specific requirements.
For example, when using onToggleChat()
, the chat modal will not be displayed when the participant clicks the chat button, as a custom function has been provided by you. This means you can use your own chat instead of ours.
Methods
But let’s say you want to implement your own set of components for the buttons like “Hang up”, “Start Transcription”, “Share Screen”, “Mute/Unmute” and so on. You can still accomplish that by removing the button from the screen, and adding your own, as shown below:
1import { VideoConference } from "@superviz/sdk/lib/components";23video = new VideoConference({4...5screenshareOff: true // disables the screen share button6})
And you can have your own button anywhere on your page, by calling toogleScreenShare method on your HTML. Once activated it will ask the participant to share their screen. To do that, use the following code:
1<button id="personalized-id"2onClick={() => video.toggleScreenShare()}3value="Share your screen">4</button>
Mixing callback functions and methods
Of course you can mix these two ways to accomplish new things, like adding new capabilities when a user clicks on our default button and still uses our implementation. Like, for example, using our chat modal, you can include the toogleChat
within the callback function you provide, like so:
1const video = new VideoConference({2callbacks: {3onToggleChat: () => {4// Your logic5video.toggleChat();6},7},8});
In conclusion, the SuperViz Video SDK offers a wide range of customization options for your video conference tool. Whether you want to use our default options, or your own additional functionality, it allows you to enhance the Video SDK to your specific needs.
Recent posts
This website uses cookies to give you the best experience. See our Privacy Policy for further details.