Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(external-api): add set-participant-properties command (#17639)

Hugo Lavernhe214f6c417aa5
diff --git a/conference.js b/conference.js
index 594e58499d..949716d4b9 100644
--- a/conference.js
+++ b/conference.js
@@ -947,6 +947,22 @@ export default {
downloadJSON(APP.store.getState(), filename);
},
+ /**
+ * Sets multiple properties for the local participant in a single presence update.
+ *
+ * @param {Object} properties - Object of property names to values.
+ * @returns {void}
+ */
+ setLocalParticipantProperties(properties) {
+ if (!room) {
+ logger.warn('Not setting participant properties, conference not initialized');
+
+ return;
+ }
+
+ room.setLocalParticipantProperties(properties);
+ },
+
/**
* Exposes a Command(s) API on this instance. It is necessitated by (1) the
* desire to keep room private to this instance and (2) the need of other
diff --git a/modules/API/API.js b/modules/API/API.js
index 4c2b9bbb45..268a1a84a1 100755
--- a/modules/API/API.js
+++ b/modules/API/API.js
@@ -426,6 +426,9 @@ function initCommands() {
sendAnalytics(createApiEvent('largevideo.participant.set'));
dispatch(selectParticipantInLargeVideo(participant.id));
},
+ 'set-participant-properties': properties => {
+ APP.conference.setLocalParticipantProperties(properties);
+ },
'set-participant-volume': (participantId, volume) => {
APP.store.dispatch(setVolume(participantId, volume));
},
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 8fade7168c..5cb96ecfc7 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -69,6 +69,7 @@ const commands = {
setMediaEncryptionKey: 'set-media-encryption-key',
setMeetingTimer: 'set-meeting-timer',
setNoiseSuppressionEnabled: 'set-noise-suppression-enabled',
+ setParticipantProperties: 'set-participant-properties',
setParticipantVolume: 'set-participant-volume',
setSecondScreen: 'set-second-screen',
setSubtitles: 'set-subtitles',