Comply w/ coding style
This commit is contained in:
parent
618dedc58e
commit
0e9509ae9b
|
@ -1,8 +1,8 @@
|
||||||
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
|
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
|
||||||
import {
|
import {
|
||||||
changeParticipantConnectionStatus,
|
|
||||||
dominantSpeakerChanged,
|
dominantSpeakerChanged,
|
||||||
getLocalParticipant,
|
getLocalParticipant,
|
||||||
|
participantConnectionStatusChanged,
|
||||||
participantJoined,
|
participantJoined,
|
||||||
participantLeft,
|
participantLeft,
|
||||||
participantRoleChanged,
|
participantRoleChanged,
|
||||||
|
@ -39,6 +39,8 @@ import type { Dispatch } from 'redux';
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
function _addConferenceListeners(conference, dispatch) {
|
function _addConferenceListeners(conference, dispatch) {
|
||||||
|
// Dispatches into features/base/conference follow:
|
||||||
|
|
||||||
conference.on(
|
conference.on(
|
||||||
JitsiConferenceEvents.CONFERENCE_FAILED,
|
JitsiConferenceEvents.CONFERENCE_FAILED,
|
||||||
(...args) => dispatch(conferenceFailed(conference, ...args)));
|
(...args) => dispatch(conferenceFailed(conference, ...args)));
|
||||||
|
@ -49,18 +51,12 @@ function _addConferenceListeners(conference, dispatch) {
|
||||||
JitsiConferenceEvents.CONFERENCE_LEFT,
|
JitsiConferenceEvents.CONFERENCE_LEFT,
|
||||||
(...args) => dispatch(conferenceLeft(conference, ...args)));
|
(...args) => dispatch(conferenceLeft(conference, ...args)));
|
||||||
|
|
||||||
conference.on(
|
|
||||||
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
|
|
||||||
(...args) => dispatch(dominantSpeakerChanged(...args)));
|
|
||||||
|
|
||||||
conference.on(
|
|
||||||
JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
|
|
||||||
(...args) => dispatch(changeParticipantConnectionStatus(...args)));
|
|
||||||
|
|
||||||
conference.on(
|
conference.on(
|
||||||
JitsiConferenceEvents.LOCK_STATE_CHANGED,
|
JitsiConferenceEvents.LOCK_STATE_CHANGED,
|
||||||
(...args) => dispatch(_lockStateChanged(conference, ...args)));
|
(...args) => dispatch(_lockStateChanged(conference, ...args)));
|
||||||
|
|
||||||
|
// Dispatches into features/base/tracks follow:
|
||||||
|
|
||||||
conference.on(
|
conference.on(
|
||||||
JitsiConferenceEvents.TRACK_ADDED,
|
JitsiConferenceEvents.TRACK_ADDED,
|
||||||
t => t && !t.isLocal() && dispatch(trackAdded(t)));
|
t => t && !t.isLocal() && dispatch(trackAdded(t)));
|
||||||
|
@ -68,6 +64,16 @@ function _addConferenceListeners(conference, dispatch) {
|
||||||
JitsiConferenceEvents.TRACK_REMOVED,
|
JitsiConferenceEvents.TRACK_REMOVED,
|
||||||
t => t && !t.isLocal() && dispatch(trackRemoved(t)));
|
t => t && !t.isLocal() && dispatch(trackRemoved(t)));
|
||||||
|
|
||||||
|
// Dispatches into features/base/participants follow:
|
||||||
|
|
||||||
|
conference.on(
|
||||||
|
JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED,
|
||||||
|
(...args) => dispatch(dominantSpeakerChanged(...args)));
|
||||||
|
|
||||||
|
conference.on(
|
||||||
|
JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
|
||||||
|
(...args) => dispatch(participantConnectionStatusChanged(...args)));
|
||||||
|
|
||||||
conference.on(
|
conference.on(
|
||||||
JitsiConferenceEvents.USER_JOINED,
|
JitsiConferenceEvents.USER_JOINED,
|
||||||
(id, user) => dispatch(participantJoined({
|
(id, user) => dispatch(participantJoined({
|
||||||
|
|
|
@ -8,30 +8,6 @@ import {
|
||||||
} from './actionTypes';
|
} from './actionTypes';
|
||||||
import { getLocalParticipant } from './functions';
|
import { getLocalParticipant } from './functions';
|
||||||
|
|
||||||
/**
|
|
||||||
* Action to update a participant's connection status.
|
|
||||||
*
|
|
||||||
* @param {string} id - Participant's ID.
|
|
||||||
* @param {string} connectionStatus - The new connection status for the
|
|
||||||
* participant.
|
|
||||||
* @returns {{
|
|
||||||
* type: PARTICIPANT_UPDATED,
|
|
||||||
* participant: {
|
|
||||||
* id: string,
|
|
||||||
* connectionStatus: string
|
|
||||||
* }
|
|
||||||
* }}
|
|
||||||
*/
|
|
||||||
export function changeParticipantConnectionStatus(id, connectionStatus) {
|
|
||||||
return {
|
|
||||||
type: PARTICIPANT_UPDATED,
|
|
||||||
participant: {
|
|
||||||
id,
|
|
||||||
connectionStatus
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an action for when dominant speaker changes.
|
* Create an action for when dominant speaker changes.
|
||||||
*
|
*
|
||||||
|
@ -93,6 +69,30 @@ export function localParticipantJoined(participant = {}) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action to update a participant's connection status.
|
||||||
|
*
|
||||||
|
* @param {string} id - Participant's ID.
|
||||||
|
* @param {string} connectionStatus - The new connection status of the
|
||||||
|
* participant.
|
||||||
|
* @returns {{
|
||||||
|
* type: PARTICIPANT_UPDATED,
|
||||||
|
* participant: {
|
||||||
|
* connectionStatus: string,
|
||||||
|
* id: string
|
||||||
|
* }
|
||||||
|
* }}
|
||||||
|
*/
|
||||||
|
export function participantConnectionStatusChanged(id, connectionStatus) {
|
||||||
|
return {
|
||||||
|
type: PARTICIPANT_UPDATED,
|
||||||
|
participant: {
|
||||||
|
connectionStatus,
|
||||||
|
id
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action to remove a local participant.
|
* Action to remove a local participant.
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,10 +36,11 @@ class ParticipantView extends Component {
|
||||||
_avatar: React.PropTypes.string,
|
_avatar: React.PropTypes.string,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The connection status for the participant. Its video will only be
|
* The connection status of the participant. Her video will only be
|
||||||
* rendered if the connection status is 'active', otherwise the avatar
|
* rendered if the connection status is 'active'; otherwise, the avatar
|
||||||
* will be rendered. If undefined, we have no indication, so the same
|
* will be rendered. If undefined, 'active' is presumed.
|
||||||
* course of action as 'active' is taken.
|
*
|
||||||
|
* @private
|
||||||
*/
|
*/
|
||||||
_connectionStatus: React.PropTypes.string,
|
_connectionStatus: React.PropTypes.string,
|
||||||
|
|
||||||
|
@ -106,10 +107,8 @@ class ParticipantView extends Component {
|
||||||
// updated only after videoTrack is rendered.
|
// updated only after videoTrack is rendered.
|
||||||
const waitForVideoStarted = false;
|
const waitForVideoStarted = false;
|
||||||
const renderVideo
|
const renderVideo
|
||||||
= shouldRenderVideoTrack(videoTrack, waitForVideoStarted)
|
= (connectionStatus === JitsiParticipantConnectionStatus.ACTIVE)
|
||||||
&& (typeof connectionStatus === 'undefined'
|
&& shouldRenderVideoTrack(videoTrack, waitForVideoStarted);
|
||||||
|| connectionStatus
|
|
||||||
=== JitsiParticipantConnectionStatus.ACTIVE);
|
|
||||||
|
|
||||||
// Is the avatar to be rendered?
|
// Is the avatar to be rendered?
|
||||||
const renderAvatar = Boolean(!renderVideo && avatar);
|
const renderAvatar = Boolean(!renderVideo && avatar);
|
||||||
|
@ -182,10 +181,19 @@ function _mapStateToProps(state, ownProps) {
|
||||||
= getParticipantById(
|
= getParticipantById(
|
||||||
state['features/base/participants'],
|
state['features/base/participants'],
|
||||||
participantId);
|
participantId);
|
||||||
|
let avatar;
|
||||||
|
let connectionStatus;
|
||||||
|
|
||||||
|
if (participant) {
|
||||||
|
avatar = getAvatarURL(participant);
|
||||||
|
connectionStatus = participant.connectionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_avatar: participant && getAvatarURL(participant),
|
_avatar: avatar,
|
||||||
_connectionStatus: participant && participant.connectionStatus,
|
_connectionStatus:
|
||||||
|
connectionStatus
|
||||||
|
|| JitsiParticipantConnectionStatus.ACTIVE,
|
||||||
_videoTrack:
|
_videoTrack:
|
||||||
getTrackByMediaTypeAndParticipant(
|
getTrackByMediaTypeAndParticipant(
|
||||||
state['features/base/tracks'],
|
state['features/base/tracks'],
|
||||||
|
|
|
@ -73,9 +73,9 @@ function _participant(state, action) {
|
||||||
const participant = action.participant; // eslint-disable-line no-shadow
|
const participant = action.participant; // eslint-disable-line no-shadow
|
||||||
const {
|
const {
|
||||||
avatarURL,
|
avatarURL,
|
||||||
|
connectionStatus,
|
||||||
dominantSpeaker,
|
dominantSpeaker,
|
||||||
email,
|
email,
|
||||||
connectionStatus,
|
|
||||||
local,
|
local,
|
||||||
pinned,
|
pinned,
|
||||||
role
|
role
|
||||||
|
@ -107,10 +107,10 @@ function _participant(state, action) {
|
||||||
return {
|
return {
|
||||||
avatarID,
|
avatarID,
|
||||||
avatarURL,
|
avatarURL,
|
||||||
|
connectionStatus,
|
||||||
dominantSpeaker: dominantSpeaker || false,
|
dominantSpeaker: dominantSpeaker || false,
|
||||||
email,
|
email,
|
||||||
id,
|
id,
|
||||||
connectionStatus,
|
|
||||||
local: local || false,
|
local: local || false,
|
||||||
name,
|
name,
|
||||||
pinned: pinned || false,
|
pinned: pinned || false,
|
||||||
|
|
Loading…
Reference in New Issue