Skip to main content

Functions

Use the following API functions to control your embedded Jitsi Meet Conference.

captureLargeVideoScreenshot

Captures a screenshot for the participant in the large video view (on stage).

api.captureLargeVideoScreenshot().then(data => {
// data is an Object with only one param, dataURL
// data.dataURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABQAA..."
});

getAvailableDevices

Retrieves a list of available devices.

api.getAvailableDevices().then(devices => {
// devices = {
// audioInput: [{
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'audioinput'
// label: 'label'
// },....],
// audioOutput: [{
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'audioOutput'
// label: 'label'
// },....],
// videoInput: [{
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'videoInput'
// label: 'label'
// },....]
// }
...
});

getContentSharingParticipants

Returns a promise which resolves with an array of currently sharing participants ID's.

api.getContentSharingParticipants().then(res => {
//res.sharingParticipantIds = [particId1, particId2, ...]
});

getCurrentDevices

Retrieves a list of currently selected devices.

api.getCurrentDevices().then(devices => {
// devices = {
// audioInput: {
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'videoInput'
// label: 'label'
// },
// audioOutput: {
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'videoInput'
// label: 'label'
// },
// videoInput: {
// deviceId: 'ID'
// groupId: 'grpID'
// kind: 'videoInput'
// label: 'label'
// }
// }
...
});

getDeploymentInfo

Retrieves an object containing information about the deployment.

api.getDeploymentInfo().then(deploymentInfo => {
// deploymentInfo = {
// region: 'deployment-region',
// shard: 'deployment-shard',
// ...
// }
...
});

getLivestreamUrl

Retrieves an object containing information about livestreamUrl of the current live stream.

api.getLivestreamUrl().then(livestreamData => {
// livestreamData = {
// livestreamUrl: 'livestreamUrl'
// }
...
});

getParticipantsInfo

DEPRECATED Use getRoomsInfo instead.

Returns an array containing participant information such as ID, display name, avatar URL, and email.

api.getParticipantsInfo();

getRoomsInfo

Returns an array of available rooms and details of it:

  • isMainRoom (true,false), id, jid
  • participants: Participant[]
    • id
    • jid
    • role
    • displayName
api.getRoomsInfo().then(rooms => {
... // see response example structure
})

Response example structure:

{
"rooms": [
{
"isMainRoom": true,
"id": "room_name@conference.jitsi",
"jid": "room_name@conference.jitsi/aaaaaa",
"participants": [
{
"jid": "room_name@conference.jitsi/bbbbbb",
"role": "participant",
"displayName": "p1",
"id": "bbbbbb"
},
{
"jid": "room_name@conference.jitsi/cccccc",
"role": "participant",
"displayName": "p2",
"id": "cccccc"
}
]
},
{
"isMainRoom": false,
"id": "aaaaaa-bbb-cccc-dddd-qwertyuiopas",
"jid": "aaaaaa-bbb-cccc-dddd-qwertyuiopas@breakout.jitsi",
"participants": [{
"jid": "aaaaaa-cccc-dddd-eeee-qwertyuiopas@jitsi/abcd1234",
"role": "moderator",
"displayName": "Participant name",
"avatarUrl": "",
"id": "abcd1234"
}]
},
]
}

getSessionId

Returns the meting's unique Id (sessionId). Please note that the sessionId is not available when in prejoin screen and it's not guaranteed to be available immediately after joining - in which cases it will be empty.

api.getSessionId().then(sessionId => {
//sessionId: string
...
});

getVideoQuality

Returns the current video quality setting.

api.getVideoQuality();

getSupportedCommands

Returns array of commands supported by api.executeCommand(command, ...arguments);

api.getSupportedCommands();

getSupportedEvents

Returns array of events supported by api.addListener(event, listener);

api.getSupportedEvents();

isDeviceChangeAvailable

Resolves to true if the device change is available and to false if not.

// The accepted deviceType values are - 'output', 'input' or undefined.
api.isDeviceChangeAvailable(deviceType).then(isDeviceChangeAvailable => {
...
});

isDeviceListAvailable

Resolves to true if the device list is available and to false if not.

api.isDeviceListAvailable().then(isDeviceListAvailable => {
...
});

isMultipleAudioInputSupported

Resolves to true if multiple audio input is supported and to false if not.

api.isMultipleAudioInputSupported().then(isMultipleAudioInputSupported => {
...
});

pinParticipant

Selects the participant ID to be the pinned participant in order to always receive video for this participant.

The second parameter is optional and can be used to specify a videoType. When multistream support is enabled by passing this parameter you can specify whether the desktop or the camera video for the specified participant should be pinned. The accepted values are 'camera' and 'desktop'. The default is 'camera'. Any invalid values will be ignored and default will be used.

api.pinParticipant(participantId, videoType);

resizeLargeVideo

Resizes the large video container per the provided dimensions.

api.resizeLargeVideo(width, height);

setAudioInputDevice

Sets the audio input device to the one with the passed label or ID.

api.setAudioInputDevice(deviceLabel, deviceId);

setAudioOutputDevice

Sets the audio output device to the one with the passed label or ID.

api.setAudioOutputDevice(deviceLabel, deviceId);

setLargeVideoParticipant

Displays the participant with the given participant ID on the large video.

If no participant ID is given, a participant is picked based on the dominant, pinned speaker settings.

api.setLargeVideoParticipant(participantId);

setVideoInputDevice

Sets the video input device to the one with the passed label or ID.

api.setVideoInputDevice(deviceLabel, deviceId);

startRecording

Starts a file recording or streaming session. See the startRecording command for more details.

api.startRecording(options);

stopRecording

Stops an ongoing file recording or streaming session. See the stopRecording command for more details.

api.stopRecording(mode);

getNumberOfParticipants

Returns the number of conference participants:

const numberOfParticipants = api.getNumberOfParticipants();

getAvatarURL

DEPRECATED Use getRoomsInfo instead.

Returns a participant's avatar URL:

const avatarURL = api.getAvatarURL(participantId);

getDisplayName

Returns a participant's display name:

const displayName = api.getDisplayName(participantId);

getEmail

Returns a participant's email:

const email = api.getEmail(participantId);

getIFrame

Returns the IFrame HTML element which is used to load the Jitsi Meet conference:

const iframe = api.getIFrame();

isAudioDisabled

Returns a Promise which resolves to the current audio disabled state:

api.isAudioDisabled().then(disabled => {
...
});

isAudioMuted

Returns a Promise which resolves to the current audio muted state:

api.isAudioMuted().then(muted => {
...
});

isVideoMuted

Returns a Promise which resolves to the current video muted state:

api.isVideoMuted().then(muted => {
...
});

isAudioAvailable

Returns a Promise which resolves to the current audio availability state:

api.isAudioAvailable().then(available => {
...
});

isVideoAvailable

Returns a Promise which resolves to the current video availability state:

api.isVideoAvailable().then(available => {
...
});

isModerationOn

Returns a Promise which resolves to the current moderation state of the given media type.

mediaType can be either audio (default) or video.

api.isModerationOn(mediaType).then(isModerationOn => {
...
});

isP2pActive

Returns a Promise which resolves to a Boolean or null, when there is no conference.

api.isP2pActive().then(isP2p => {
...
});

isParticipantForceMuted

Returns a Promise which resolves to the current force mute state of the given participant for the given media type.

mediaType can be either audio (default) or video.

Force muted - moderation is on and participant is not allowed to unmute the given media type.

api.isParticipantForceMuted(participantId, mediaType).then(isForceMuted => {
...
});

isParticipantsPaneOpen

Returns a Promise which resolves with the current participants pane state.

api.isParticipantsPaneOpen().then(state => {
...
});

isStartSilent

Returns a Promise which resolves with whether meeting was started in view only.

api.isStartSilent().then(startSilent => {
...
});

listBreakoutRooms

Returns a Promise which resolves with the map of breakout rooms.

api.listBreakoutRooms().then(breakoutRooms => {
...
});

invite

Invite the given array of participants to the meeting:

api.invite([ {...}, {...}, {...} ]).then(() => {
// success
}).catch(() => {
// failure
});

NOTE: The invitee format in the array depends on the invite service used in the deployment.

PSTN invite objects have the following structure:

{
type: 'phone',
number: <string> // the phone number in E.164 format (ex. +31201234567)
}

SIP invite objects have the following structure:

{
type: 'sip',
address: <string> // the sip address
}

dispose

Removes the embedded Jitsi Meet conference:

api.dispose();

NOTE: Jitsi recommends removing the conference before the page is unloaded.