Use the ClanMeeting methods to change the meeting settings/properties dynamically while a meeting is going on.
Note: Examples on this page show how to execute the methods on meeting join. However, you can also execute these methods using custom buttons or when other events occur within the meeting.
Example Usage (All Methods) #
xxxxxxxxxx
211const meeting = new ClanMeeting(domain, consumerId, optionalProperties);
2
3window.onload = function () {
4 // Method 1
5 meeting.start();
6
7 const meetingJoinedLsnr = function meetingJoinedLsnr(eventData) {
8 // Method 2
9 console.log(meeting.get('allParticipants'));
10 // Method 3
11 meeting.set('displayName', 'ChangedName');
12 };
13 };
14
15 meeting.once('meetingJoined', meetingJoinedLsnr);
16};
17
18window.onunload = function () {
19 // Method 4
20 meeting.end();
21};
Example Usage (Host Methods) #
NOTE: If trying to call methods as soon as meeting is joined, wait for the role to be upgraded to moderator before executing methods that need host privileges as shown in the example below.
xxxxxxxxxx
281const meeting = new ClanMeeting(domain, consumerId, optionalProperties);
2// Methods 1 and 2 (chained together)
3meeting.generateRoomName().anonymizeDisplayName();
4
5window.onload = function () {
6 // Method 3
7 meeting.start();
8
9 const meetingJoinedLsnr = function meetingJoinedLsnr() {
10 const roleChangedLsnr = function roleChangedLsnr(event) {
11 // Execute host methods only AFTER the user has joined and has become the moderator
12 if (event.role === 'moderator') {
13 // Methods 4 & 5 (chained)
14 meeting
15 .exec('enableLobby', true)
16 .exec('startRecording');
17 }
18 };
19 meeting.on('roleChanged', roleChangedLsnr);
20 };
21
22 meeting.once('meetingJoined', meetingJoinedLsnr);
23};
24
25window.onunload = function () {
26 // Method 6
27 meeting.end();
28};
Method Chaining #
Few ClanMeeting methods support chaining as shown in the examples above. The ones that do are flagged as isChainable.
xxxxxxxxxx
101// Chainable
2meeting
3 .exec('enableLobby', true)
4 .exec('startRecording')
5 .set('localSubject', subject)
6 .toggle('tileView');
7
8// Not chainable
9meeting.get('nbParticipants');
10meeting.checkAsync('isAudioAvailable').then(value => { console.log(value); });
All Methods #
start() #
Starts the conference. Use on window load.
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
xxxxxxxxxx
31window.onload = function () {
2 meeting.start();
3};
end() #
Removes all listeners and ends the conference (only for the local user).
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
xxxxxxxxxx
31window.onunload = function () {
2 meeting.end();
3};
generateRoomName([prefix], [nbChars], [suffix]) #
Generates a complex random room name and sets the roomName
property.
If you do not set the roomName
property to a room of your choice then you must use this method BEFORE meeting.start()
.
param | type | description | isMandatory | default |
---|---|---|---|---|
prefix | String | Prefix string | false | empty |
nbChars | Number | Number of random alphanumeric characters in between the prefix and suffix | false | 10 |
suffix | String | Suffix string | false | empty |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
xxxxxxxxxx
121// either set the roomName in optionalProperties
2const meeting = new ClanMeeting(domain, consumerId, optionalProperties);
3
4// or generate one before starting the meeting
5meeting.generateRoomName();
6// customize roomName like below if you want
7// this example generates 15 character room names
8meeting.generateRoomName('', 15, '');
9
10window.onload = function () {
11 meeting.start();
12};
anonymizeDisplayName([prefix], [nbDigits]) #
Anonymizes the displayName
of the participant. e.g. User_1234
If you do not set the displayName
property then you must use this method BEFORE meeting.start()
.
param | type | description | isMandatory | default |
---|---|---|---|---|
prefix | String | Prefix string | false | User_ |
nbDigits | Number | Number of digits after the prefix | false | 4 |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
xxxxxxxxxx
121// either set the displayName in optionalProperties
2const meeting = new ClanMeeting(domain, consumerId, optionalProperties);
3
4// or anonymize the name before starting the meeting
5meeting.anonymizeDisplayName();
6// or customize as per need
7// examples - Batch5_123, Batch5_843
8meeting.anonymizeDisplayName('Batch5_', 3);
9
10window.onload = function () {
11 meeting.start();
12};
isInFuture(startDateTime) #
Returns true if the meeting is in the future as compared to the current time.
param | type | description | isMandatory |
---|---|---|---|
startDateTime | String | Start datetime of the scheduled meeting. Could be any Javascript datetime format. | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Boolean | false | false |
Example:
See usage in schedule meetings guide.
get('allParticipants') #
Deprecated
#
Use getAsync('roomsInfo') instead.
Get an array containing all participant information such as ID, display name, avatar URL, and email.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'allParticipants' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Object | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 const allParticipants = meeting.get('allParticipants');
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
get('nbParticipants') #
Get number of participants in the room.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'nbParticipants' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Number | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 const nbParticipants = meeting.get('nbParticipants');
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
get('videoQuality') #
Get current video resolution.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'videoQuality' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Number | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.get('videoQuality');
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
get('meetingElement') #
Get HTML element which is used to load the conference.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'meetingElement' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
String | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.get('meetingElement');
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
get('avatarUrlById', participantId) #
Deprecated
#
Use getAsync('roomsInfo') instead.
Get avatarUrl for the participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'avatarUrlById' | true |
participantId | String | ID of the participant | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
String | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const someoneJoinedLsnr = function someoneJoinedLsnr(participant) {
5 meeting.get('avatarUrlById', participant.id);
6 };
7
8 // event is triggered when a remote participant joins the meeting
9 meeting.on('someoneJoined', someoneJoinedLsnr);
10};
get('displayNameById', participantId) #
Get display name for the participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'displayNameById' | true |
participantId | String | ID of the participant | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
String | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const someoneJoinedLsnr = function someoneJoinedLsnr(participant) {
5 meeting.get('displayNameById', participant.id);
6 };
7
8 // event is triggered when a remote participant joins the meeting
9 meeting.on('someoneJoined', someoneJoinedLsnr);
10};
get('emailById', participantId) #
Get email of the participant if set.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'emailById' | true |
participantId | String | ID of the participant | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
String | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const someoneJoinedLsnr = function someoneJoinedLsnr(participant) {
5 meeting.get('emailById', participant.id);
6 };
7
8 // event is triggered when a remote participant joins the meeting
9 meeting.on('someoneJoined', someoneJoinedLsnr);
10};
get('participantById', participantId) #
Deprecated
#
Use getAsync('roomsInfo') instead.
Get participant information by participant ID.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'participantById' | true |
participantId | String | ID of the participant | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
String | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const someoneJoinedLsnr = function someoneJoinedLsnr(participant) {
5 meeting.get('participantById', participant.id);
6 };
7
8 // event is triggered when a remote participant joins the meeting
9 meeting.on('someoneJoined', someoneJoinedLsnr);
10};
getAsync('roomsInfo') #
Returns an array with room and participant details.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'roomsInfo' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Object) | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.getAsync('roomsInfo').then(info => { console.log(info); });
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
Response:
xxxxxxxxxx
241{
2 "rooms": [
3 {
4 "isMainRoom": true,
5 "id": "1234@muc.nanothread.ap01.clanmeeting.com",
6 "jid": "1234@muc.nanothread.ap01.clanmeeting.com/ce1a8e2a",
7 "participants": [
8 {
9 "role": "moderator",
10 "displayName": "Jason",
11 "avatarUrl": "",
12 "id": "ce1a8e2a"
13 },
14 {
15 "jid": "1234@muc.nanothread.ap01.clanmeeting.com/75032972",
16 "role": "participant",
17 "displayName": "Ayushman",
18 "avatarUrl": "",
19 "id": "75032972"
20 }
21 ]
22 }
23 ]
24}
getAsync('availableDevices') #
Get the list of audio and video devices available to the local participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'availableDevices' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Object) | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.getAsync('availableDevices').then(devices => { console.log(devices); });
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
Response:
xxxxxxxxxx
201devices = {
2 audioInput: [{
3 deviceId: 'ID'
4 groupId: 'grpID'
5 kind: 'audioinput'
6 label: 'label'
7 }, .],
8 audioOutput: [{
9 deviceId: 'ID'
10 groupId: 'grpID'
11 kind: 'audioOutput'
12 label: 'label'
13 }, .],
14 videoInput: [{
15 deviceId: 'ID'
16 groupId: 'grpID'
17 kind: 'videoInput'
18 label: 'label'
19 }, .],
20}
getAsync('currentDevices') #
Get the list of currently selected audio/video devices for the local participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'currentDevices' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Object) | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.getAsync('currentDevices').then(devices => { console.log(devices); });
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
Response:
xxxxxxxxxx
201devices = {
2 audioInput: [{
3 deviceId: 'ID'
4 groupId: 'grpID'
5 kind: 'audioinput'
6 label: 'label'
7 }, .],
8 audioOutput: [{
9 deviceId: 'ID'
10 groupId: 'grpID'
11 kind: 'audioOutput'
12 label: 'label'
13 }, .],
14 videoInput: [{
15 deviceId: 'ID'
16 groupId: 'grpID'
17 kind: 'videoInput'
18 label: 'label'
19 }, .],
20}
getAsync('livestreamUrl') #
Get the livestream URL if livestreaming is on.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'livestreamUrl' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Object) | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.getAsync('livestreamUrl').then(data => { console.log(data); });
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
Response:
xxxxxxxxxx
31data = {
2 livestreamUrl: 'livestreamUrl'
3}
getAsync('contentSharingParticipants') #
Get the list of screen sharing participants.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'contentSharingParticipants' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Object) | false | false |
Example:
xxxxxxxxxx
91window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting.getAsync('contentSharingParticipants').then(data => { console.log(data); });
6 };
7
8 meeting.once('meetingJoined', meetingJoinedLsnr);
9};
Response:
xxxxxxxxxx
31data = {
2 sharingParticipantIds: [particId1, particId2, ]
3}
selectDeviceAsync(type, label, id) #
Once you get the device list using above methods, you can select a particular audio / video input or output device. Device list has the label and ID.
param | type | description | isMandatory |
---|---|---|---|
type | String | 'audioInput' 'audioOutput' 'videoInput' | true |
label | String | Device label | true |
id | String | Device ID | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // returns true if selected
6 meeting.selectDeviceAsync('audioInput', 'Microphone Array (Realtek Audio)', 'qndtoJUhFXtLampWZ3tLfObK7/yovEm7/G8XZmQvT/g=', ).then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
Response:
xxxxxxxxxx
21value = true or false
2// based on if the device was selected successfully
checkAsync('isAudioAvailable') #
Is audio available?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isAudioAvailable' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isAudioAvailable').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isVideoAvailable') #
Is video available?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isVideoAvailable' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isVideoAvailable').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isAudioDisabled') #
Is audio disabled?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isAudioDisabled' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isAudioDisabled').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isAudioMuted') #
Is microphone muted?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isAudioMuted' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isAudioMuted').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isVideoMuted') #
Is video muted?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isVideoMuted' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isVideoMuted').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isAudioModerationOn') #
Whether host can mute/ ask to unmute other participants.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isAudioModerationOn' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isAudioModerationOn').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isVideoModerationOn') #
Is host allowed to turn off the camera of remote participants?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isVideoModerationOn' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isVideoModerationOn').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isDeviceListAvailable') #
Is device list available?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isDeviceListAvailable' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isDeviceListAvailable').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isDeviceChangeAvailable') #
Is device change available?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isDeviceChangeAvailable' | true |
deviceType | String | 'output' 'input' | false |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isDeviceChangeAvailable', 'input').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isMultipleAudioInputSupported') #
Are multiple audio inputs supported?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isMultipleAudioInputSupported' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isMultipleAudioInputSupported').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isParticipantsPaneOpen') #
Is the side participant pane open?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isParticipantsPaneOpen' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isParticipantsPaneOpen').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isSilentModeEnabled') #
Is silent mode enabled? Audio from remote participants is disabled when in silent mode.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isSilentModeEnabled' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isSilentModeEnabled').then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isParticipantAudioForceMuted', participantId) #
Is audio for this participant muted by host?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isParticipantAudioForceMuted' | true |
participantId | String | ID of the participant | false |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isParticipantAudioForceMuted', participant.id).then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
checkAsync('isParticipantVideoForceMuted', participantId) #
Is video for this participant muted by host?
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'isParticipantVideoForceMuted' | true |
participantId | String | ID of the participant | false |
returns | needsHostPrivilege | isChainable |
---|---|---|
Promise (Boolean) | false | false |
Example:
xxxxxxxxxx
101window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 // value could be true or false
6 meeting.checkAsync('isParticipantVideoForceMuted', participant.id).then(value => { console.log(value); });
7 };
8
9 meeting.once('meetingJoined', meetingJoinedLsnr);
10};
set('audioModeration', true) #
If set to true, the host will have control whether they want to allow a participant to switch ON microphone.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'audioModeration' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
set('videoModeration', true) #
If set to true, the host will have control whether they want to allow a participant to switch ON camera.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'videoModeration' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
set('avatarUrl', avatarUrl) #
Sets the display picture URL for the local participant. You can set this to a compressed public image URL. Display picture will appear instead of display name when the participant's video is turned off.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'avatarUrl' | true |
avatarUrl | String | Link to compressed avatar image | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
xxxxxxxxxx
191window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting
6 .set('avatarUrl', 'https://path/to/compressed/avatar/image')
7 .set('displayName', 'John Doe')
8 .set('localSubject', 'Local Subject')
9 .set('onStageParticipant', participant.id)
10 .set('tileView', false)
11 .set('participantsPaneVisibility', true)
12 .set('email', 'example@clanmeeting.com')
13 .set('noiseSupression', false)
14 .set('largeVideoSize', 500, 500)
15 .set('filmstripSize', 200);
16 };
17
18 meeting.once('meetingJoined', meetingJoinedLsnr);
19};
set('displayName', participantName) #
Sets the display name for the local participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'displayName' | true |
participantName | String | New display name | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('localSubject', subject) #
Local subject is visible to the local participant only and can be used to set different meeting subjects for different participants.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'localSubject' | true |
subject | String | Meeting subject | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('noiseSupression', true) #
Enable noise suppression. Uses more CPU on client devices.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'noiseSupression' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('onStageParticipant', participantId) #
Set the participant whose video needs to be shown on stage.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'onStageParticipant' | true |
participantId | String | ID of the participant | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('tileView', true) #
Turn on or off tile view where participant videos are arranged in the form of tiles.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'tileView' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('followMe', true) #
If set to true, everyone follows what host does on the screen.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'followMe' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
set('participantVolume', participantId, volumeLevel) #
Set the microphone volume per participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'participantVolume' | true |
participantId | String | ID of the participant | true |
volumeLevel | Float | Volume between 0 and 1 | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
Sets participant volume to 20% as soon as any participant joins.
xxxxxxxxxx
191window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 const roleChangedLsnr = function roleChangedLsnr(event) {
6 if (event.role === 'moderator') {
7
8 const someoneJoinedLsnr = function someoneJoinedLsnr(participant) {
9 meeting.set('participantVolume', participant.id, 0.2);
10 };
11 // whenever any remote participant joins
12 meeting.on('someoneJoined', someoneJoinedLsnr);
13 }
14 };
15 meeting.on('roleChanged', roleChangedLsnr);
16 };
17
18 meeting.once('meetingJoined', meetingJoinedLsnr);
19};
set('largeVideoSize', width, height) #
Sets the size of the video on stage. On stage video resizes automatically by default.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'largeVideoSize' | true |
width | Number | width of the video | true |
height | Number | height of the video | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('subtitles', enabled, language) #
Enables or disables subtitles if transcription is supported.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'subtitles' | true |
enabled | Boolean | Set true to enable subtitles, false to disable | true |
language | String | null or 'en' or other language abbreviations | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('filmstripSize', width) #
Sets the width of the filmstrip (the strip on the extreme right of the screen where participant thumbnails are visible).
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'filmstripSize' | true |
width | Number | width of the filmstrip | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('password', password) #
Set meeting password.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'password' | true |
password | String | Password for the meeting | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
set('email', email) #
Set email for the local participant.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'email' | true |
subject | String | Participant email | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
set('subject', subject) #
This is a host privilege which sets the subject for all unlike localSubject.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'subject' | true |
subject | String | Meeting subject | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
set('participantsPaneVisibility', true) #
Whether to show or hide participants pane on the right side of the screen.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'participantsPaneVisibility' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
Set Method Examples #
xxxxxxxxxx
211// host methods
2window.onload = function () {
3 meeting.start();
4
5 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
6 const roleChangedLsnr = function roleChangedLsnr(event) {
7 if (event.role === 'moderator') {
8 meeting
9 .set('followMe', true)
10 .set('password', 'mysecret680')
11 .set('subject', 'Subject')
12 .set('audioModeration', false)
13 .set('videoModeration', false)
14 .set('subtitles', true, 'en');
15 }
16 };
17 meeting.on('roleChanged', roleChangedLsnr);
18 };
19
20 meeting.once('meetingJoined', meetingJoinedLsnr);
21};
exec('enableLobby', true) #
Enable lobby for the meeting.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'enableLobby' | true |
value | Boolean | true or false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('hangup') #
Hang up the local participant only. DOES NOT end the meeting for everyone.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'hangup' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('endConference') #
Ends the meeting for everyone. Can only be executed by the moderator.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'endConference' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('sendChatMessage', message, participantId, ignorePrivacy) #
Send a chat message to a specific participant or to everyone in the meeting.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'sendChatMessage' | true |
message | String | Chat message | true |
participantId | String | ID of receiving participant, if empty string is sent, message is sent to everyone | true |
ignorePrivacy | Boolean | true if the privacy notification should be ignored. Defaults to false | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('sendDataToParticipant', participantId, data) #
Used to transfer data between participants.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'sendDataToParticipant' | true |
participantId | String | ID of receiving participant | true |
data | Any | String, object or any acceptable data format | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('initiatePrivateChat', participantId) #
Initiate a private chat with one of the participants.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'initiatePrivateChat' | true |
participantId | String | participant ID | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('cancelPrivateChat') #
Cancel private chat if ongoing.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'cancelPrivateChat' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('muteAudioEveryone') #
Mute audio for all participants as a host.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'muteAudioEveryone' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('muteVideoEveryone') #
Turn off camera of all participants as a host.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'muteVideoEveryone' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('startShareVideo', videoUrl) #
Start sharing a video using its public URL. Videos will be visible to the participants in real time without any lag.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'startShareVideo' | true |
videoUrl | String | A YouTube video URL for example | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('stopShareVideo') #
Stop the video being shared.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'stopShareVideo' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('startRecording') #
Start video recording. Note that this is an add on and might cost you extra based on your usage. Check our pricing page for more details.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'startRecording' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('stopRecording') #
Stop ongoing video recording.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'stopRecording' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('startLocalRecording', onlySelf) #
Start local video recording on Chromium based browsers only. Does not work on Firefox. See the difference between cloud recording and local recording here.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'startLocalRecording' | true |
onlySelf | Boolean | Whether to only record your local streams and not of other participants. | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('stopLocalRecording') #
Stop ongoing local video recording.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'stopRecording' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('startLiveStreaming', rtmpUrl) #
Start live streaming to your platform of choice e.g. YouTube Channel using RTMP URL. See the steps on how to find your RTMP URL here. Note that this is an add on and might cost you extra based on your usage. Check our pricing page for more details.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'startLiveStreaming' | true |
rtmpUrl | String | URL for live streaming | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('stopLiveStreaming') #
Stop ongoing live streaming.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'stopLiveStreaming' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('kickParticipant', participantId) #
Kick a participant out of the meeting as a host.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'kickParticipant' | true |
participantId | String | participant to be kicked | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('pinParticipant', participantId) #
Pin a particular participant on large video (stage). That specific participant will be visible to the local user at all times on stage.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'pinParticipant' | true |
participantId | String | participant to be pinned on stage | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('answerKnockingParticipant', participantId, approveEntry) #
Automatically allow participant to join even if lobby is enabled.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'answerKnockingParticipant' | true |
participantId | String | participant to be allowed or rejected entry | true |
approveEntry | Boolean | true to approve or false to reject | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
xxxxxxxxxx
41// host command
2meeting.on('someoneKnocked', function (data) {
3 meeting.exec('answerKnockingParticipant', data.participant.id, true);
4});
exec('grantModerator', participantId) #
Grant host privileges to a participant.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'grantModerator' | true |
participantId | String | participant to be made moderator | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('approveVideo', participantId) #
If video moderation is on it approves the participant with the given ID for video.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'approveVideo' | true |
participantId | String | participant to be allowed | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('askToUnmute', participantId) #
Ask the participant with the given ID to unmute. If audio moderation is on it also approves the participant for audio.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'askToUnmute' | true |
participantId | String | participant to be notified and approved | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('rejectParticipantAudio', participantId) #
Rejects the participant with the given ID from moderation of audio.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'rejectParticipantAudio' | true |
participantId | String | participant to be rejected | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
exec('showNotification', title, description, uid, type, timeout) #
Shows a custom notification to the local participant only. A dialog box will appear on the screen with this notification values.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'showNotification' | true |
title | String | notification title | true |
description | String | notification text | true |
uid | String | random string useful to hide notification programmatically | true |
type | String | 'info', 'normal', 'success', 'warning' or 'error' | true |
timeout | String | 'short', 'medium', 'long', or 'sticky' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('hideNotification', uid) #
Hides a specific notification based on the UID for the local participant.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'hideNotification' | true |
uid | String | UID for the notification set using showNotification() method | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
exec('rejectParticipantVideo', participantId) #
Rejects the participant with the given ID from moderation of video.
param | type | description | isMandatory |
---|---|---|---|
command | String | 'rejectParticipantVideo' | true |
participantId | String | participant to be rejected | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | true | true |
Example:
Exec Method Examples #
Host Methods
xxxxxxxxxx
301// host methods
2window.onload = function () {
3 meeting.start();
4
5 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
6 const roleChangedLsnr = function roleChangedLsnr(event) {
7 if (event.role === 'moderator') {
8 meeting
9 .exec('enableLobby', true)
10 .exec('startLiveStreaming', 'rtmp://url:1935/live/rtmp_key')
11 .exec('stopLiveStreaming')
12 .exec('startRecording')
13 .exec('stopRecording')
14 .exec('startLocalRecording', false) // Either cloud recording or local recording can be started at a time for a meeting, not both
15 .exec('stopLocalRecording')
16 .exec('kickParticipant', '9713d834')
17 .exec('grantModerator', '9713d834')
18 .exec('muteAudioEveryone')
19 .exec('muteVideoEveryone')
20 .exec('approveVideo', '9713d834')
21 .exec('askToUnmute', '9713d834')
22 .exec('rejectParticipantAudio', '9713d834')
23 .exec('rejectParticipantVideo', '9713d834')
24 }
25 };
26 meeting.on('roleChanged', roleChangedLsnr);
27 };
28
29 meeting.once('meetingJoined', meetingJoinedLsnr);
30};
Other Methods (Don't need host privileges)
xxxxxxxxxx
201window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting
6 .exec('pinParticipant', '9713d834')
7 .exec('startShareVideo', 'https://www.youtube.com/watch?v=BHACKCNDMW8')
8 .exec('stopShareVideo')
9 .exec('sendChatMessage', 'Hi', '', false)
10 .exec('sendDataToParticipant', '9713d834', 'text')
11 .exec('initiatePrivateChat', '3533e6b2')
12 .exec('cancelPrivateChat')
13 .exec('showNotification', 'Test', 'Test Description', '8sdfj923s9', 'normal', 'short')
14 .exec('hideNotification', '8sdfj923s9')
15 .exec('hangup')
16 .exec('endConference');
17 };
18
19 meeting.once('meetingJoined', meetingJoinedLsnr);
20};
execAsync('captureStageScreenshot') #
param | type | description | isMandatory |
---|---|---|---|
command | String | captureStageScreenshot | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('audio') #
Toggle microphone on or off.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'audio' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('video') #
Toggle camera on or off.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'video' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('filmStrip') #
Toggle filmstrip on the right that has the thumbnails of all the participants.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'filmStrip' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('chat') #
Toggle chat on the left.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'chat' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('raiseHand') #
Raise or lower hand.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'raiseHand' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('shareScreen') #
Toggle screen sharing on or off.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'shareScreen' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('tileView') #
Toggle tileview on or off.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'tileView' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('camera') #
Switch between front and back camera on mobile.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'camera' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('cameraMirroring') #
Flip (mirror) or don't flip participant local video.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'cameraMirroring' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('virtualBackgroundDialog') #
Toggle virtual background dialog box.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'virtualBackgroundDialog' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('subtitles') #
Start or stop subtitles if transcription is enabled.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'subtitles' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
toggle('whiteboard') #
Toggle whiteboard.
param | type | description | isMandatory |
---|---|---|---|
attribute | String | 'whiteboard' | true |
returns | needsHostPrivilege | isChainable |
---|---|---|
ClanMeeting | false | true |
Example:
Toggle Method Examples #
xxxxxxxxxx
211window.onload = function () {
2 meeting.start();
3
4 const meetingJoinedLsnr = function meetingJoinedLsnr(participant) {
5 meeting
6 .toggle('audio')
7 .toggle('video')
8 .toggle('filmStrip')
9 .toggle('chat')
10 .toggle('raiseHand')
11 .toggle('shareScreen')
12 .toggle('tileView')
13 .toggle('camera')
14 .toggle('cameraMirroring')
15 .toggle('virtualBackgroundDialog')
16 .toggle('subtitles')
17 .toggle('whiteboard');
18 };
19
20 meeting.once('meetingJoined', meetingJoinedLsnr);
21};