feat(lobby) Add sound for participant knocking
This commit is contained in:
parent
48efa4ac61
commit
b6b943e7de
|
@ -2,3 +2,9 @@
|
|||
* Hide these emails when trying to join a lobby
|
||||
*/
|
||||
export const HIDDEN_EMAILS = [ 'inbound-sip-jibri@jitsi.net', 'outbound-sip-jibri@jitsi.net' ];
|
||||
|
||||
/**
|
||||
* The identifier of the sound to be played when a participant joins lobby.
|
||||
* @type {string}
|
||||
*/
|
||||
export const KNOCKING_PARTICIPANT_SOUND_ID = 'KNOCKING_PARTICIPANT_SOUND';
|
||||
|
|
|
@ -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) => {
|
||||
|
|
|
@ -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';
|
Binary file not shown.
Loading…
Reference in New Issue