Events
SuperViz Video Conference SDK offers a range of events that allow you to monitor and respond to several interactions and changes within the meeting. These events provide valuable insights into participant actions, meeting state transitions, and more.
onMeetingStart
Type: () => void
This event is dispatched when the Video Conference is initialized.
onMeetingStateChange
Type: (state: MeetingState) => void
<Videoconference>
operates through a series of distinct states to ensure the meeting experience. The onMeetingStateChange
event enables you to monitor and react to these state transitions.
Monitoring these states allows you to provide real-time feedback to participants and implement dynamic behavior based on the current state of the Video Conference. E. g. When the state is MEETING_READY_TO_JOIN it confirms that the user has already consented device permissions and it’s ready to join the meeting.
See the MeetingState section for more details.
onLocalParticipantJoin
Type: (participant: Participant) => void
This event is dispatched when the local participant enters the meeting.
onLocalParticipantLeave
Type: (participant: Participant) => void
This event is dispatched when the local participant leaves the meeting.
onParticipantJoin
Type: (participant: Participant) => void
This event dispatches when a participant enters the meeting room.
onParticipantLeave
Type: (participant: Participant) => void
This event dispatches when a participant leaves the meeting room.
onParticipantListChange
Type: (participant: Participant) => void
This event is dispatched when there is a change in the list of participants of the meeting.
onParticipantAmountChange
Type: (amount: number) => void;
This event dispatches when the number of participants in a meeting has changed.
onHostChange
Type: (participantId: string) => void;
This event is dispatched when a new participant is given the host capabilities for the current meeting.
onHostAvaliable
Type: () => void
This event dispatches when the host enters the meeting after guests and audience members have already joined.
If a host is the first to enter the meeting the event won't be dispatched.
onNoHostAvaliable
Type: () => void
This event dispatches when a guest or audience member enters the meeting, but there’s no host available yet.
If a host is the first to enter the meeting the event won’t be dispatched.
onWaitingForHostChange
Type: (waiting: boolean) => void
This event dispatches when a guest or audience member of the meeting tries to join the meeting, but there’s no host available yet. It will be triggered again, with the value false, when the host joins the room.
onKickLocalParticipant
Type: () => void
This event dispatches when a host kicks one participant out of the meeting,
onKickAllParticipants
Type: () => void
This event dispatches when two or more participants are in the room, one designated as a host and the other as a non-host (typically a guest). For the event to occur, the host must leave the room, leaving only the non-host inside. This situation results in the room being left without a host.
onConnectionStatusChange
Type: (status: MeetingConnectionStatus) => void
This event is dispatched when there is a change in the connection status of the participant in the meeting. This event provides real-time updates about the quality and availability of the audio/video service.
By monitoring this event and interpreting the status values, you can implement responsive actions, such as advising participants to turn off video in case of a BAD connection or handling reconnection scenarios when LOST_CONNECTION occurs.
See the MeetingConnectionStatus section for more details.
onDevicesStateChange
Type: (state: DeviceEvent) => void
This event is dispatched when there is a change in the local participant device list. E.g. This event will be triggered when the participant connects a headphone on the laptop.
onFrameDimensionsChange
Type: (dimensions: {width: number, height: number}) => void
The Video Conference, when initialized, inserts a SuperViz-enabled iframe into the Document Object Model (DOM). This event is dispatched when there is a change to the iframe dimensions.
onDestroy
Type: () => void
This event is dispatched when the participant leaves the meeting room.
Type Definitions
DeviceEvent
Type: enum
This enum
helps to understand the status of the devices available for the local participant.
Here are the possible states and their meanings:
State | Description |
---|---|
NO_CAM | No camera is available for the local participant. |
NO_DEVICES | No devices are currently connected. |
DEVICES_BLOCKED | Device access is blocked for the participant. |
DEVICES_CAM_BLOCKED | Camera access is blocked for the participant. Perhaps because it’s been used by other applications. |
DEVICES_INITIALIZATION_ERROR | There was an error during device initialization. |
DEVICES_UNKNOWN_ERROR | An unknown error occurred with the participant's devices. |
DEVICES_ALLOWED | All device access is granted by the participant. |
Dimensions
Type: object
An object that represents the Video Conference dimensions on the component’s frame.
Name | Type | Description |
---|---|---|
width | number | The width of the frame represented in pixels. |
height | number | The height of the frame represented in pixels. |
Example:
{
"width": 921,
"height": 678
}
Participant
Type: object
An object describing the participant information, like name and avatar.
Name | Type | Description |
---|---|---|
id | string | Identifier of the participant who is entering the room. Usually, this ID matches the internal ID of your users. |
avatar | Avatar | Participant avatar information. |
color | string | Unique color for the participant in the meeting, is used to identify the user cursor and avatar/laser in 3D space. |
isHost | boolean | Indicates if the participant is the current host of the room. |
name | string | The name of the participant who will enter the room. |
type | ParticipantType | User it to give proper user permission in the room. Options are host , guest , and audience . |
Example:
"participant": {
"id": "<USER-ID>",
"name": "<USER-NAME>",
"type": "host",
"color": "#878291",
"avatar": {
"imageUrl": "https://<PATH>",
"model3DUrl": "https://<PATH>",
}
}
MeetingConnectionStatus
Type: enum
The MeetingConnectionStatus
serves as a dynamic indicator of the real-time connection quality and availability of the audio/video service. This enumeration defines a set of distinct values, each reflecting a specific state of the meeting's connection, allowing you to precisely monitor and respond to the meeting's operational status.
This enum
has the following possible statuses:
Status | Value | Description |
---|---|---|
NOT_AVAILABLE | 0 | Indicates that the audio/video service is disconnected. |
GOOD | 1 | Represents good connection quality, ensuring a stable and reliable audio/video experience. |
BAD | 2 | Indicates a bad connection quality. It’s indicated to encourage the participants to consider turning off video to enhance the experience. |
POOR | 3 | Signifies a poor connection, often due to participant connections and/or PC specifications not meeting the minimum requirements for a smooth audio/video experience. |
DISCONNECTED | 4 | Indicates that audio/video transmission has been interrupted, with no network packets sent or received for at least 10 seconds. |
RECONNECTING | 5 | Occurs during a reconnection process triggered by a loss of connection. |
LOST_CONNECTION | 6 | Indicates a complete loss of connection to the audio/video service. |
MeetingState
Type: enum
Represents the current state of the Video Conference meeting. This value reflects one of the possible states indicating the operational status of the meeting component. You can utilize this information in your callback function to respond to and manage the meeting's dynamic behavior based on its state.
Here are the possible states and their meanings:
State | Value | |
---|---|---|
MEETING_FAILED | -1 | Indicates a failure in the meeting, requiring attention or troubleshooting. |
MEETING_DISCONNECTED | 0 | Indicates a state where the meeting is not connected. |
MEETING_INITIALIZING | 1 | Signifies the meeting is in the process of initialization. |
MEETING_READY_TO_JOIN | 2 | Confirms that the meeting was prepared for participants to join, meaning that device permissions were consent and everything is working. |
MEETING_CONNECTING | 3 | Indicates an ongoing connection process that happens after the participant joins the meeting. |
MEETING_CONNECTED | 4 | Confirms that the meeting is successfully connected. |
MEETING_RECONNECT | 5 | Occurs when the meeting reconnects after a disruption. |
FRAME_INITIALIZING | 6 | Indicates the initialization of the meeting iframe. |
FRAME_INITIALIZED | 7 | Indicates a successfully initialized meeting iframe. |
FRAME_UNINITIALIZED | 8 | Represents an uninitialized meeting iframe. |