id | title |
---|---|
dev-guide-iframe-commands |
Commands |
You can control the embedded Jitsi Meet conference by calling executeCommand
on the JitsiMeetExternalAPI
object:
api.executeCommand(command, ...arguments);
The command parameter is a string which contains the command name.
You can also execute multiple commands using the executeCommands
method:
api.executeCommands(commands);
The commands
parameter is an object with the names of the commands as keys and the arguments for the commands as values:
api.executeCommands({
displayName: [ 'nickname' ],
toggleAudio: []
});
The following commands are supported:
Sets the display name of the local participant.
This command requires one argument to set the new display name.
api.executeCommand('displayName', 'New Nickname');
Sets the password for the room.
// set new password for channel
api.addEventListener('participantRoleChanged', function(event) {
if (event.role === "moderator") {
api.executeCommand('password', 'The Password');
}
});
// join a protected channel
api.on('passwordRequired', function ()
{
api.executeCommand('password', 'The Password');
});
Toggles the lobby mode on or off.
This command requires the desired lobby mode state as the argument.
api.addEventListener('participantRoleChanged', function (event) {
if(event.role === 'moderator') {
api.executeCommand('toggleLobby', true);
}
});
Touch tone playback.
This command requires the selected touch tone dial pads to play as well as the length of and time gap between tone play as the arguments.
api.executeCommand('sendTones', {
tones: string, // The dial pad touch tones to play. For example, '12345#'.
duration: number, // Optional. The number of milliseconds each tone should play. The default is 200.
pause: number // Optional. The number of milliseconds between each tone. The default is 200.
});
Starts sharing a video
This command requires the an url pointing to either a youtube video or a video to be streamed from web (e.g an mp4 file)
api.executeCommand('startShareVideo', url);
Stops sharing a video (if the user is the one who started the video)
No arguments are required.
api.executeCommand('stopShareVideo');
Sets the subject of the conference.
This command requires the new subject to be set as the argument and it will be applied only if the participant has the moderator role or after they receive that role later on.
api.executeCommand('subject', 'New Conference Subject');
Sets the local subject of the conference.
This command requires the new local subject to be set as the argument and it can be applied by all participants regardless of their role.
api.executeCommand('localSubject', 'New Conference Local Subject');
Mutes / unmutes the audio for the local participant.
No arguments are required.
api.executeCommand('toggleAudio');
Mutes / unmutes the video for the local participant.
No arguments are required.
api.executeCommand('toggleVideo');
Hide or show the filmstrip.
No arguments are required.
api.executeCommand('toggleFilmStrip');
Hide or show chat messaging.
No arguments are required.
api.executeCommand('toggleChat');
Hide or show the raised hand.
No arguments are required.
api.executeCommand('toggleRaiseHand')
Start or stop screen sharing.
No arguments are required.
api.executeCommand('toggleShareScreen');
Enable or disable noise suppression on the current audio track.
api.executeCommand('setNoiseSuppressionEnabled', {
enabled: boolean // Enable or disable noise suppression.
});
Start or stop subtitles.
No arguments are required.
api.executeCommand('toggleSubtitles');
Enter or exit the tile view layout mode.
No arguments are required.
api.executeCommand('toggleTileView');
Ends the call.
No arguments are required.
api.executeCommand('hangup');
Ends the current conference for everyone.
This command can only be executed by a meeting moderator, and requires End Conference support to be enabled for the deployment.
api.executeCommand('endConference');
Changes the local email address.
This command requires the new email address as the single argument.
api.executeCommand('email', 'example@example.com');
Sends a request to a given participant to set camera facing mode as user
or environment
.
The receiving participant is shown a confirmation dialog. If the facingMode
param is not sent, the camera will toggle between the two options on subsequent calls.
api.executeCommand('sendCameraFacingMode', 'receiverParticipantId', 'facingMode');
Sends a text message to another participant through the data channels.
api.executeCommand('sendEndpointTextMessage', 'receiverParticipantId', 'text');
Displays the participant on the large video display.
The participant ID, if specified, is displayed on the large video. If no argument is passed, the participant to be displayed on the large video is automatically selected based on the dominant/pinned speaker settings.
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 selected. The accepted values are 'camera'
and 'desktop'
. The default is 'camera'
. Any invalid values will be ignored and default will be used.
api.executeCommand('setLargeVideoParticipant', 'abcd1234', 'desktop');
Sets the send and receive video resolution.
The resolution height setting is implemented using a single argument.
api.executeCommand('setVideoQuality', 720);
Mute all meeting participants.
This command can only be executed by the meeting moderator and can take one argument: mediaType
- for which media type to mute everyone.
mediaType
can be either 'audio' (default) or 'video'.
api.executeCommand('muteEveryone', 'video');
Starts a local recording, file recording, streaming session or transcription using passed parameters:
-
RTMP streaming - Recording mode set to
stream
with anrtmpStreamKey
. ThertmpBroadcastID
value is optional. -
YouTube streams - Recording mode set to
stream
with anyoutubeStreamKey
. TheyoutubeBroadcastID
value is optional. -
Local Recording - Recording mode set to
local
. TheonlySelf
value is optional. -
Dropbox recording - Recording mode set to
file
with a Dropbox OAuth2 token.
Additionally, Dropbox saving should be enabled on the Jitsi meet deploy config you are using.
- File recording - Recording mode set to
file
. TheextraMetadata
value is optional.
Optionally, shouldShare
should be passed on. No other params are required.
- Transcription - Set the
transcription
option totrue
.
api.executeCommand('startRecording', {
mode: string, //recording mode, either `local`, `file` or `stream`.
dropboxToken: string, //dropbox oauth2 token.
onlySelf: boolean, //Whether to only record the local streams. Only applies to `local` recording mode.
shouldShare: boolean, //whether the recording should be shared with the participants or not. Only applies to certain jitsi meet deploys.
rtmpStreamKey: string, //the RTMP stream key.
rtmpBroadcastID: string, //the RTMP broadcast ID.
youtubeStreamKey: string, //the youtube stream key.
youtubeBroadcastID: string, //the youtube broacast ID.
extraMetada: Object, // any extra metada for file recording.
transcription: boolean, // Whether a transcription should be started.
});
Stops an ongoing local
, stream
, file
recording or transcription.
The mode in which the recording was started must be specified.
api.executeCommand('stopRecording',
mode: string, //recording mode to stop, `local`, `stream` or `file`
transcription: boolean // whether the transcription should be stopped
);
Opens the chat window and sets the participant with the given participant ID as the messages recipient.
api.executeCommand('initiatePrivateChat',
participantID: string
);
Removes the private chat participant thus it resets the chat window to group chat.
api.executeCommand('cancelPrivateChat');
Kicks the participant with the given participant ID from the meeting.
api.executeCommand('kickParticipant',
participantID: string
);
Grants moderator rights to the participant with the given ID.
api.executeCommand('grantModerator',
participantID: string
);
Overwrite config.js props with values from the config object passed on to the command.
api.executeCommand('overwriteConfig',
config: Object
);
For example:
api.executeCommand('overwriteConfig',
{
toolbarButtons: ['chat']
}
);
will overwrite the toolbarButtons
config value with [chat]
, resulting in UI only showing the chat
button.
Sends a chat message either to a specific participant or as a group chat message.
api.executeCommand('sendChatMessage',
message: string, //the text message
to: string, // the receiving participant ID or empty string/undefined for group chat.
ignorePrivacy: boolean // true if the privacy notification should be ignored. Defaulted to false.
);
Allows moderators to toggle the follow me functionality
api.executeCommand('setFollowMe',
value: boolean, // set to true if participants should be following you, false otherwise
recorderOnly: boolean // Whether the recorder will be the only one following you. The default is false.
);
Enables or disables the subtitles.
api.executeCommand('setSubtitles',
enabled: boolean,
displaySubtitles: boolean = true,
language: string | null = 'en'
);
Enables or disables the tileview mode.
api.executeCommand('setTileView',
enabled: boolean
);
Approves or rejects the knocking participant in the lobby.
api.executeCommand('answerKnockingParticipant',
id: string, // the participant id
approved: boolean
);
Sets the camera facing mode as user
or environment
on mobile web. If the facingMode
param is not sent, a toggle between back and front camera happens on subsequent calls.
api.executeCommand('toggleCamera', 'facingMode');
Toggles the mirroring of the local video.
api.executeCommand('toggleCameraMirror');
Toggles the virtual background selection dialog.
api.executeCommand('toggleVirtualBackgroundDialog');
Pins a conference participant.
api.executeCommand('pinParticipant',
id?: string // The ID of the conference participant to pin or null to unpin all
);
Change volume of the participant with the given participant ID.
api.executeCommand('setParticipantVolume',
participantID: string,
volume: number // number between 0 and 1
);
Changes the visibility status of the participants pane.
api.executeCommand('toggleParticipantsPane',
enabled: boolean // The visibility status of the participants pane.
);
Changes moderation status of the given media type.
This command requires two arguments: enable
- whether to enable it or not, and mediaType
- the media type for which to change moderation.
api.executeCommand('toggleModeration',
enable: Boolean,
mediaType: String // can be 'audio' (default) or 'video'
);
Asks the participant with the given ID to unmute. If audio moderation is on it also approves the participant for audio.
api.executeCommand('askToUnmute',
participantId: String
);
If video moderation is on it approves the participant with the given ID for video.
api.executeCommand('approveVideo',
participantId: String
);
Rejects the participant with the given ID from moderation of the given media type.
api.executeCommand('rejectParticipant',
participantId: String,
mediaType: String // can be 'audio' (default) or 'video'
);
Creates a breakout room.
This command can only be executed by the meeting moderator.
api.executeCommand('addBreakoutRoom',
name: String // Optional. The name or subject of the new room.
);
Auto-assigns the participants to breakout rooms.
This command can only be executed by the meeting moderator.
api.executeCommand('autoAssignToBreakoutRooms');
Closes the breakout room and sends participants to the main room.
This command can only be executed by the meeting moderator.
api.executeCommand('closeBreakoutRoom',
roomId: String // The id of the room to close.
);
Joins a breakout room. If the argument is omitted, joins the main room.
api.executeCommand('joinBreakoutRoom',
roomId: String // Optional. The id of the room to join.
);
Removes the breakout room.
This command can only be executed by the meeting moderator.
api.executeCommand('removeBreakoutRoom',
breakoutRoomJid: String // The jid of the breakout room to remove.
);
Resizes the filmstrip.
api.executeCommand('resizeFilmStrip', {
width: number // The desired filmstrip width
});
Resizes the large video container based on the dimensions provided.
api.executeCommand('resizeLargeVideo',
width: number, // The desired width
height: number // The desired height
);
Sends a participant to a room.
This command can only be executed by the meeting moderator.
api.executeCommand('sendParticipantToRoom',
participantId: String, // The id of the participant.
roomId: String // The id of the room.
);
Overwrites the names of the given participants to the given names. (locally for the participant that send the command)
api.executeCommand('overwriteNames', [{
id: String, // The id of the participant.
name: String // The new name.
}]
);
Shows a custom notification. This affects only the local user.
If uid
is provided, the notification will replace existing notification with the same uid
. The uid
can also be
passed to the hideNotification
command to programmatically hide the notification.
api.executeCommand('showNotification', {
title: String, // Title of the notification.
description: String, // Content of the notification.
uid: String, // Optional. Unique identifier for the notification.
type: String, // Optional. Can be 'info', 'normal', 'success', 'warning' or 'error'. Defaults to 'normal'.
timeout: String // optional. Can be 'short', 'medium', 'long', or 'sticky'. Defaults to 'short'.
});
Hides the notification which has the given uid
.
api.executeCommand('hideNotification',
uid: String // Unique identifier for the notification to be removed.
);
Toggles the whiteboard to open, repeated toggling hidden the whiteboard
api.executeCommand('toggleWhiteboard');
Sets the assumed bandwidth bps.
api.executeCommand('setAssumedBandwidthBps',
assumedBandwidthBps: number // Required. The value to set as assumed bandwidth expressed in bps.
);
Sets or removes the blurred virtual background to the user camera.
api.executeCommand('setBlurredBackground',
blurType: String // Required. Blur type to apply. Accepted values are 'slight-blur', 'blur' or 'none'.
);