Skip to main content
Version: Version 2.0

Video Huddle

The Video Huddle component enables you to integrate a reliable video huddle solution into your web application.

How to use

To initialize the Video Huddle component, you must initialize a room with a defined name and ID for both the participant and the group.

Usage

To add a video huddle to your room, use the following code:

import { VideoHuddle } from "@superviz/video";

const video = new VideoHuddle({
participantType: 'host',
});

room.addComponent(video);

Properties

NameTypeDescription
participantTypeParticipantTypeThis property is used to assign appropriate participant permissions within the room. Options are host, guest, and audience.
Default value: guest
brandBrandAn object specifying branding options such as logos and custom styles for the video conference component..
permissionsPermissionsAn object describing participant permissions within the video conference component..
i18ni18nAn object specifying translation settings for the video conference component..

Methods

subscribe()

The subscribe method allows you to register your application to listen for specific events during the call. By subscribing to events, you can capture and respond to important interactions or changes that occur during a video conference session.

Example:

video.subscribe(VideoEvent.PARTICIPANT_JOINED, (participant) => {
console.log('participant.joined', participant);
})

unsubscribe()

The unsubscribe method allows you to stop listening to a previously subscribed event during the call.

Example:

video.unsubscribe(VideoEvent.PARTICIPANT_JOINED);

hangup()

This method allows you to end the video conference and disconnect from the meeting.

Example:

video.hangup();

toggleCam()

Use this method to toggle the participant’s camera on or off during the video conference.

Example:

video.toggleCam();

toggleChat()

Use this method to toggle open/close the chat window.

Example:

video.toggleChat();

toggleMeetingSetup()

Use this method to open or close the meeting setup modal.

Example:

video.toggleMeetingSetup();

toggleMicrophone()

Use this method to mute or unmute the participant’s microphone during the video conference.

Example:

video.toggleMicrophone();

toggleScreenShare()

Use this method to enable or disable participants sharing the screen with other participants in the meeting. When activated, it prompts the participant to share their screen. If already active, it stops the screen sharing.

Example:

video.toggleScreenShare();

toggleRecording()

This method toggles the recording feature on and off, enabling you to use the AI Meeting Insights API of the meeting's spoken content and to get the video recording using the Recordings API.

Example:

video.toggleRecording();

Events

VideoEvent

You can subscribe to the following Video events:

EventString EquivalentDescription
HOST_CHANGED
'host.changed'
Triggered when the host changes.
PARTICIPANT_JOINED
'participant.joined'
Triggered when a participant joins the meeting.
MEETING_STATE_UPDATE
'meeting.state.update'
Triggered when the meeting state updates.
PARTICIPANT_LEFT
'participant.left'
Triggered when a participant leaves the meeting.
PARTICIPANT_LIST_UPDATE
'participant.list.update'
Triggered when there is any change in the participant list.
PARTICIPANT_KICKED
'participant.kicked'
Triggered when a participant is kicked from the meeting.

* Note for CDN Users: Use the string equivalent directly in room.subscribe().

HOST_CHANGED

Triggered when the host changes.

Usage Example:

video.subscribe(VideoEvent.HOST_CHANGED, (participant) => {
console.log('host.changed', participant);
})

On the callback function, you will receive the following argument:

TypeDescription
ParticipantParticipant that now is the host.

PARTICIPANT_JOINED

Triggered when a participant joins the meeting.

Usage Example:

video.subscribe(VideoEvent.PARTICIPANT_JOINED, (participant) => {
console.log('participant.joined', participant);
})

On the callback function, you will receive the following argument:

TypeDescription
ParticipantParticipant that joined the meeting.

MEETING_STATE_UPDATE

Triggered when the meeting state updates. The Video Conference operates through a series of distinct states to ensure the meeting experience. The MEETING_STATE_UPDATE event enables you to monitor and react to these state transitions.

Usage Example:

video.subscribe(VideoEvent.MEETING_STATE_UPDATE, (state) => {
console.log('meeting.state.update', state);
})

On the callback function, you will receive the following argument:

TypeDescription
MeetingStateMeeting state.

PARTICIPANT_LEFT

Triggered when a participant leaves the meeting.

Usage Example:

video.subscribe(VideoEvent.PARTICIPANT_LEFT, (participant) => {
console.log('participant.left', participant);
})

On the callback function, you will receive the following argument:

TypeDescription
ParticipantParticipant that left the meeting.

PARTICIPANT_LIST_UPDATE

Triggered when there is any change in the participant list (e.g., a participant joins or leaves).

Usage Example:

video.subscribe(VideoEvent.PARTICIPANT_LIST_UPDATE, (participants) => {
console.log('participant.list.update', participants);
})

On the callback function, you will receive the following argument:

TypeDescription
Record<string, Participant>
list of participants in the meeting.

PARTICIPANT_KICKED

Triggered when a participant is kicked from the meeting.

Usage Example:

video.subscribe(VideoEvent.PARTICIPANT_KICKED, (participant) => {
console.log('participant.kicked', participant);
})

On the callback function, you will receive the following argument:

TypeDescription
ParticipantParticipant that was kicked.

Type Definitions

Participant

Type: object

An object describing the participant information, like name and avatar.

NameTypeDescription
idstringIdentifier of the participant who is entering the room. Usually, this ID matches the internal ID of your users. Minimum length of 2 characters and maximum of 64.

Accepted pattern: [-_&@+=,()\{\}\\[\\]\/«».:|'"#a-zA-Z0-9À-ÿ\s]*
emailstringThe email of the participant who will enter the room.
activeComponentsComponentNames[]List of active components that the participant has entered.
namestringThe name of the participant who will enter the room.
avatarAvatarParticipant avatar information.

Example:

{
"id": "USER_ID",
"email": "USER_EMAIL",
"name": "USER_NAME",
"activeComponents": ['videoConference'],
"type": "host",
"avatar": {
"imageUrl": "https://<PATH>",
}
}

ComponentNames

Type: enum

List of possible components that a participant can be added to. This is a read-only property, to add a participant into a component, you should use the addComponent method of the room. The options are:

NameValueComponent
ComponentNames.VIDEO_CONFERENCEvideoConferenceVideo Conference or Video Huddle
ComponentNames.WHO_IS_ONLINEwhoIsOnlineWho-is-Online
ComponentNames.COMMENTScommentsContextual Comments
ComponentNames.PRESENCEpresenceMouse Pointers
ComponentNames.PRESENCE_AUTODESKpresence3dAutodeskPresence 3D Autodesk
ComponentNames.PRESENCE_MATTERPORTpresence3dMatterportPresence 3D Matterport
ComponentNames.PRESENCE_THREEJSpresence3dThreejsPresence 3D Three.js

Avatar

Type: object

Avatars represent participants within a room. In typical scenarios, they appear as profile images when used with Who-is-Online and Contextual Comments.

In 3D spaces (e.g., Matterport, Autodesk viewer or ThreeJs), avatars can take the form of 3D digital representations.

NameTypeDescription
imageUrlstringRequired. Path to the thumbnail image of the 3D model.
Supported formats: .png and .jpg.
model3DUrlstringPath to a 3D model. Only applicable when using Presence3D components
Supported formats: .glb and .gltf.

Example:

avatar: {
imageUrl: "https://<PATH>",
model3DUrl: "https://<PATH>",
}

ParticipantType

Type: enum

Use ParticipantType to assign appropriate participant permissions within the room. Values are:

  • host can mute and kick participants from the call.
  • guest can participate in the call with a camera or voice.
  • audience can watch the meeting, but won’t be able to activate their camera and microphone. Typically used in live sessions.

Default value: guest

Permissions

Type: object

An object describing the permissions of video conference component.

NameTypeDescription
enableFollowbooleanAllow hosts to activate the follow mode. Hides the button if set to false.
Default value: false
enableGotobooleanAllow participants to click on another participant camera feed to activate the goTo mode. Hides the functionality if set to false.
Default value: false
enableGatherbooleanAllow hosts to activate the gather functionality to gather. Hides the button if set to false.
Default value: false
enableDefaultAvatarsbooleanEnables the "Choose Avatar" step during the meeting setup.
Default value: false
allowGuestsbooleanAllow guests to join the call.
Default value: true
toggleCamerabooleanAllow participants to toggle their camera on and off. Hides the button if set to false.
Default value: true
toggleChatbooleanAllow participants to toggle the chat modal on and off. Hides the button if set to false.
Default value: true
toggleMicbooleanAllow participants to toggle their microphone on and off. Hides the button if set to false.
Default value: true
toggleParticipantListbooleanAllow participants to toggle the participant list on and off. Hides the button if set to false.
Default value: true
toggleRecordingbooleanAllow participants to toggle the recording on and off. Hides the button if set to false.
Default value: false
toggleScreenSharebooleanAllow participants to toggle the screen share on and off. Hides the button if set to false.
Default value: true
enableFollowbooleanAllow participants to toggle the screen share on and off. Hides the button if set to false.
Default value: true

Example:

{
"allowGuests": false,
"toggleRecording": false,
}

i18n

Type: object

An object describing the translations of the video conference component.

NameTypeDescription
languagestringThe language property sets the default language for the meeting interface. While it's possible to change it to a custom language, it's important to remember that you'll need to include this custom language in the list of available locales for it to take effect.
Default value: en
localesLocale[]The locales property allows you to expand language options beyond the default English. Use this field to provide a list of languages available in the meeting overlay.

Locale

Type: object

This allows you to expand language options beyond the default English. Use this field to provide a list of languages available in the meeting overlay. For additional information on how, please refer to the documentation on how to internationalize your application.

Brand

Type: object

An object describing the logo and styles of the video conference component.

NameTypeDescription
logoUrlstringThe URL of the logo to be displayed on the meeting settings screen.
stylesstringOptional custom CSS styles to be applied to the component. This allows for customization of the component's appearance.

Example:

{
logoUrl: 'https://mydomain.com/logo.png',
styles: '`.meeting__toolbar-container { background-color: #000; }`',
},

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:

StateValue
MEETING_FAILED-1Indicates a failure in the meeting, requiring attention or troubleshooting.
MEETING_DISCONNECTED0Indicates a state where the meeting is not connected.
MEETING_INITIALIZING1Signifies the meeting is in the process of initialization.
MEETING_READY_TO_JOIN2Confirms that the meeting was prepared for participants to join, indicating that device permissions have been granted and everything is ready for participants to join.
MEETING_CONNECTING3Indicates an ongoing connection process that happens after the participant joins the meeting.
MEETING_CONNECTED4Confirms that the meeting is successfully connected.
MEETING_RECONNECT5Occurs when the meeting reconnects after a disruption.
FRAME_INITIALIZING6Indicates the initialization of the meeting iframe.
FRAME_INITIALIZED7Indicates a successfully initialized meeting iframe.
FRAME_UNINITIALIZED8Represents an uninitialized meeting iframe.