ref(video-layout): updates connection status when redux updates

This commit is contained in:
Leonard Kim 2018-05-21 14:06:02 -07:00 committed by virtuacoplenny
parent 05801711a7
commit ec0439cbb1
3 changed files with 15 additions and 14 deletions

View File

@ -1798,12 +1798,9 @@ export default {
room.on(
JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
(id, connectionStatus) => {
APP.store.dispatch(participantConnectionStatusChanged(
id, connectionStatus));
(id, connectionStatus) => APP.store.dispatch(
participantConnectionStatusChanged(id, connectionStatus)));
APP.UI.participantConnectionStatusChanged(id);
});
room.on(
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
id => APP.store.dispatch(dominantSpeakerChanged(id, room)));

View File

@ -826,15 +826,6 @@ UI.handleLastNEndpoints = function(leavingIds, enteringIds) {
VideoLayout.onLastNEndpointsChanged(leavingIds, enteringIds);
};
/**
* Will handle notification about participant's connectivity status change.
*
* @param {string} id the id of remote participant(MUC jid)
*/
UI.participantConnectionStatusChanged = function(id) {
VideoLayout.onParticipantConnectionStatusChanged(id);
};
/**
* Prompt user for nickname.
*/

View File

@ -5,6 +5,7 @@ import UIEvents from '../../../service/UI/UIEvents';
import {
DOMINANT_SPEAKER_CHANGED,
PARTICIPANT_UPDATED,
PIN_PARTICIPANT
} from '../base/participants';
import { MiddlewareRegistry } from '../base/redux';
@ -26,6 +27,18 @@ MiddlewareRegistry.register(store => next => action => {
const result = next(action);
switch (action.type) {
case PARTICIPANT_UPDATED: {
// Look for actions that triggered a change to connectionStatus. This is
// done instead of changing the connection status change action to be
// explicit in order to minimize changes to other code.
if (typeof action.participant.connectionStatus !== 'undefined') {
VideoLayout.onParticipantConnectionStatusChanged(
action.participant.id);
}
break;
}
case DOMINANT_SPEAKER_CHANGED:
VideoLayout.onDominantSpeakerChanged(action.participant.id);
break;