Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(lobby) Add sound for participant knocking
hmuresanb6b943e7def0
diff --git a/react/features/lobby/constants.js b/react/features/lobby/constants.jsindex 9140a92fa4..475e1995ae 100644--- a/react/features/lobby/constants.js+++ b/react/features/lobby/constants.js@@ -2,3 +2,9 @@* Hide these emails when trying to join a lobby*/export const HIDDEN_EMAILS = [ '[email protected]', '[email protected]' ];++/**+ * The identifier of the sound to be played when a participant joins lobby.+ * @type {string}+ */+export const KNOCKING_PARTICIPANT_SOUND_ID = 'KNOCKING_PARTICIPANT_SOUND';diff --git a/react/features/lobby/middleware.js b/react/features/lobby/middleware.jsindex b06efbaa65..3671a9f6dc 100644--- a/react/features/lobby/middleware.js+++ b/react/features/lobby/middleware.js@@ -1,9 +1,13 @@// @flow+import { batch } from 'react-redux';++import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../base/app';import { CONFERENCE_FAILED, CONFERENCE_JOINED } from '../base/conference';import { JitsiConferenceErrors, JitsiConferenceEvents } from '../base/lib-jitsi-meet';import { getFirstLoadableAvatarUrl, getParticipantDisplayName } from '../base/participants';import { MiddlewareRegistry, StateListenerRegistry } from '../base/redux';+import { playSound, registerSound, unregisterSound } from '../base/sounds';import { isTestModeEnabled } from '../base/testing';import { NOTIFICATION_TYPE, showNotification } from '../notifications';import { shouldAutoKnock } from '../prejoin/functions';@@ -18,9 +22,17 @@ import {startKnocking,setPasswordJoinFailed} from './actions';+import { KNOCKING_PARTICIPANT_SOUND_ID } from './constants';+import { KNOCKING_PARTICIPANT_FILE } from './sounds';MiddlewareRegistry.register(store => next => action => {switch (action.type) {+ case APP_WILL_MOUNT:+ store.dispatch(registerSound(KNOCKING_PARTICIPANT_SOUND_ID, KNOCKING_PARTICIPANT_FILE));+ break;+ case APP_WILL_UNMOUNT:+ store.dispatch(unregisterSound(KNOCKING_PARTICIPANT_SOUND_ID));+ break;case CONFERENCE_FAILED:return _conferenceFailed(store, next, action);case CONFERENCE_JOINED:@@ -51,10 +63,13 @@ StateListenerRegistry.register(});conference.on(JitsiConferenceEvents.LOBBY_USER_JOINED, (id, name) => {- dispatch(participantIsKnockingOrUpdated({- id,- name- }));+ batch(() => {+ dispatch(participantIsKnockingOrUpdated({+ id,+ name+ }));+ dispatch(playSound(KNOCKING_PARTICIPANT_SOUND_ID));+ });});conference.on(JitsiConferenceEvents.LOBBY_USER_UPDATED, (id, participant) => {diff --git a/react/features/lobby/sounds.js b/react/features/lobby/sounds.jsnew file mode 100644index 0000000000..bd0ace4d96--- /dev/null+++ b/react/features/lobby/sounds.js@@ -0,0 +1,5 @@+/**+ * The name of the bundled sound file which will be played when a+ * participant enters lobby.+ */+export const KNOCKING_PARTICIPANT_FILE = 'knock.mp3';diff --git a/sounds/knock.mp3 b/sounds/knock.mp3new file mode 100644index 0000000000..116fd32bd2Binary files /dev/null and b/sounds/knock.mp3 differ