|
|
|
@ -12,7 +12,6 @@ import { |
|
|
|
|
import { JitsiConferenceEvents } from '../lib-jitsi-meet'; |
|
|
|
|
import { MiddlewareRegistry, StateListenerRegistry } from '../redux'; |
|
|
|
|
import { playSound, registerSound, unregisterSound } from '../sounds'; |
|
|
|
|
import { getTrackByJitsiTrack, TRACK_ADDED, TRACK_REMOVED, TRACK_UPDATED } from '../tracks'; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
DOMINANT_SPEAKER_CHANGED, |
|
|
|
@ -42,8 +41,7 @@ import { |
|
|
|
|
getLocalParticipant, |
|
|
|
|
getParticipantById, |
|
|
|
|
getParticipantCount, |
|
|
|
|
getParticipantDisplayName, |
|
|
|
|
figureOutMutedWhileDisconnectedStatus |
|
|
|
|
getParticipantDisplayName |
|
|
|
|
} from './functions'; |
|
|
|
|
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds'; |
|
|
|
|
|
|
|
|
@ -137,10 +135,6 @@ MiddlewareRegistry.register(store => next => action => { |
|
|
|
|
case PARTICIPANT_UPDATED: |
|
|
|
|
return _participantJoinedOrUpdated(store, next, action); |
|
|
|
|
|
|
|
|
|
case TRACK_ADDED: |
|
|
|
|
case TRACK_REMOVED: |
|
|
|
|
case TRACK_UPDATED: |
|
|
|
|
return _trackChanged(store, next, action); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return next(action); |
|
|
|
@ -460,55 +454,6 @@ function _registerSounds({ dispatch }) { |
|
|
|
|
dispatch(registerSound(PARTICIPANT_LEFT_SOUND_ID, PARTICIPANT_LEFT_FILE)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Notifies the feature base/participants that the action there has been a change in the tracks of the participants. |
|
|
|
|
* |
|
|
|
|
* @param {Store} store - The redux store in which the specified {@code action} is being dispatched. |
|
|
|
|
* @param {Dispatch} next - The redux {@code dispatch} function to dispatch the specified {@code action} in the |
|
|
|
|
* specified {@code store}. |
|
|
|
|
* @param {Action} action - The redux action {@code PARTICIPANT_JOINED} or {@code PARTICIPANT_UPDATED} which is being |
|
|
|
|
* dispatched in the specified {@code store}. |
|
|
|
|
* @private |
|
|
|
|
* @returns {Object} The value returned by {@code next(action)}. |
|
|
|
|
*/ |
|
|
|
|
function _trackChanged({ dispatch, getState }, next, action) { |
|
|
|
|
const { jitsiTrack } = action.track; |
|
|
|
|
let track; |
|
|
|
|
|
|
|
|
|
if (action.type === TRACK_REMOVED) { |
|
|
|
|
track = getTrackByJitsiTrack(getState()['features/base/tracks'], jitsiTrack); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const result = next(action); |
|
|
|
|
|
|
|
|
|
if (action.type !== TRACK_REMOVED) { |
|
|
|
|
track = getTrackByJitsiTrack(getState()['features/base/tracks'], jitsiTrack); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (typeof track === 'undefined' || track.local) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { participantId } = track; |
|
|
|
|
const state = getState(); |
|
|
|
|
const participant = getParticipantById(state, participantId); |
|
|
|
|
|
|
|
|
|
if (!participant) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const mutedWhileDisconnected = figureOutMutedWhileDisconnectedStatus(state, participantId); |
|
|
|
|
|
|
|
|
|
if (participant.mutedWhileDisconnected !== mutedWhileDisconnected) { |
|
|
|
|
dispatch(participantUpdated({ |
|
|
|
|
id: participantId, |
|
|
|
|
mutedWhileDisconnected |
|
|
|
|
})); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Unregisters sounds related with the participants feature. |
|
|
|
|
* |
|
|
|
|