feat(speaker-status): update speaker status in redux
The speakerStatus field already exists as part of the objects in the participant reducer. When the library updates the connection status of a user, plumb that update through to redux.
This commit is contained in:
parent
68d40b4fa4
commit
955542f4a5
|
@ -35,8 +35,10 @@ import {
|
||||||
} from './react/features/base/lib-jitsi-meet';
|
} from './react/features/base/lib-jitsi-meet';
|
||||||
import { setVideoAvailable } from './react/features/base/media';
|
import { setVideoAvailable } from './react/features/base/media';
|
||||||
import {
|
import {
|
||||||
|
localParticipantConnectionStatusChanged,
|
||||||
localParticipantRoleChanged,
|
localParticipantRoleChanged,
|
||||||
MAX_DISPLAY_NAME_LENGTH,
|
MAX_DISPLAY_NAME_LENGTH,
|
||||||
|
participantConnectionStatusChanged,
|
||||||
participantJoined,
|
participantJoined,
|
||||||
participantLeft,
|
participantLeft,
|
||||||
participantRoleChanged,
|
participantRoleChanged,
|
||||||
|
@ -56,6 +58,8 @@ import {
|
||||||
} from './react/features/overlay';
|
} from './react/features/overlay';
|
||||||
import { showDesktopSharingButton } from './react/features/toolbox';
|
import { showDesktopSharingButton } from './react/features/toolbox';
|
||||||
|
|
||||||
|
const { participantConnectionStatus } = JitsiMeetJS.constants;
|
||||||
|
|
||||||
const ConnectionEvents = JitsiMeetJS.events.connection;
|
const ConnectionEvents = JitsiMeetJS.events.connection;
|
||||||
const ConnectionErrors = JitsiMeetJS.errors.connection;
|
const ConnectionErrors = JitsiMeetJS.errors.connection;
|
||||||
|
|
||||||
|
@ -1542,7 +1546,10 @@ export default {
|
||||||
|
|
||||||
room.on(
|
room.on(
|
||||||
ConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
|
ConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
|
||||||
id => {
|
(id, connectionStatus) => {
|
||||||
|
APP.store.dispatch(participantConnectionStatusChanged(
|
||||||
|
id, connectionStatus));
|
||||||
|
|
||||||
APP.UI.participantConnectionStatusChanged(id);
|
APP.UI.participantConnectionStatusChanged(id);
|
||||||
});
|
});
|
||||||
room.on(ConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => {
|
room.on(ConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => {
|
||||||
|
@ -1636,10 +1643,16 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
|
room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
|
||||||
|
APP.store.dispatch(localParticipantConnectionStatusChanged(
|
||||||
|
participantConnectionStatus.INTERRUPTED));
|
||||||
|
|
||||||
APP.UI.showLocalConnectionInterrupted(true);
|
APP.UI.showLocalConnectionInterrupted(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
|
room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
|
||||||
|
APP.store.dispatch(localParticipantConnectionStatusChanged(
|
||||||
|
participantConnectionStatus.ACTIVE));
|
||||||
|
|
||||||
APP.UI.showLocalConnectionInterrupted(false);
|
APP.UI.showLocalConnectionInterrupted(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,26 @@ export function dominantSpeakerChanged(id) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an action to signal the connection status of the local participant
|
||||||
|
* has changed.
|
||||||
|
*
|
||||||
|
* @param {string} connectionStatus - The current connection status of the local
|
||||||
|
* participant, as enumerated by the library's participantConnectionStatus
|
||||||
|
* constants.
|
||||||
|
* @returns {Function}
|
||||||
|
*/
|
||||||
|
export function localParticipantConnectionStatusChanged(connectionStatus) {
|
||||||
|
return (dispatch, getState) => {
|
||||||
|
const participant = getLocalParticipant(getState);
|
||||||
|
|
||||||
|
if (participant) {
|
||||||
|
return dispatch(participantConnectionStatusChanged(
|
||||||
|
participant.id, connectionStatus));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to signal that the ID of local participant has changed. It happens
|
* Action to signal that the ID of local participant has changed. It happens
|
||||||
* when the local participant joins a new conference or leaves an existing
|
* when the local participant joins a new conference or leaves an existing
|
||||||
|
|
Loading…
Reference in New Issue