diff --git a/modules/API/API.js b/modules/API/API.js index bd70017ae..6756d43c4 100644 --- a/modules/API/API.js +++ b/modules/API/API.js @@ -15,6 +15,7 @@ import { } from '../../react/features/base/conference'; import { parseJWTFromURLParams } from '../../react/features/base/jwt'; import { JitsiRecordingConstants } from '../../react/features/base/lib-jitsi-meet'; +import { pinParticipant } from '../../react/features/base/participants'; import { processExternalDeviceRequest } from '../../react/features/device-selection/functions'; @@ -120,6 +121,11 @@ function initCommands() { )); } }, + 'pin-participant': id => { + logger.debug('Pin participant command received'); + sendAnalytics(createApiEvent('participant.pinned')); + APP.store.dispatch(pinParticipant(id)); + }, 'proxy-connection-event': event => { APP.conference.onProxyConnectionEvent(event); }, diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index a26e708fb..78533ace0 100644 --- a/modules/API/external/external_api.js +++ b/modules/API/external/external_api.js @@ -35,6 +35,7 @@ const commands = { hangup: 'video-hangup', muteEveryone: 'mute-everyone', password: 'password', + pinParticipant: 'pin-participant', resizeLargeVideo: 'resize-large-video', sendEndpointTextMessage: 'send-endpoint-text-message', sendTones: 'send-tones', @@ -919,6 +920,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter { }); } + /** + * Pins a participant's video on to the stage view. + * + * @param {string} participantId - Participant id (JID) of the participant + * that needs to be pinned on the stage view. + * @returns {void} + */ + pinParticipant(participantId) { + this.executeCommand('pinParticipant', participantId); + } + /** * Removes event listener. *