fix(speaker-stats): remove reduce expressions flag
This commit is contained in:
parent
92e6b9f211
commit
d4779701f0
|
@ -27,7 +27,6 @@ declare var interfaceConfig: Object;
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
const INITIAL_NON_RN_STATE = {
|
const INITIAL_NON_RN_STATE = {
|
||||||
enableFacialRecognition: true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { getLocalParticipant } from '../../base/participants';
|
import { getLocalParticipant } from '../../base/participants';
|
||||||
import { initUpdateStats } from '../actions';
|
import { initUpdateStats } from '../actions';
|
||||||
import {
|
import {
|
||||||
REDUCE_EXPRESSIONS_THRESHOLD,
|
|
||||||
SPEAKER_STATS_RELOAD_INTERVAL
|
SPEAKER_STATS_RELOAD_INTERVAL
|
||||||
} from '../constants';
|
} from '../constants';
|
||||||
|
|
||||||
|
@ -23,9 +22,9 @@ const abstractSpeakerStatsList = (speakerStatsItem: Function): Function[] => {
|
||||||
const conference = useSelector(state => state['features/base/conference'].conference);
|
const conference = useSelector(state => state['features/base/conference'].conference);
|
||||||
const { stats: speakerStats, showFacialExpressions } = useSelector(state => state['features/speaker-stats']);
|
const { stats: speakerStats, showFacialExpressions } = useSelector(state => state['features/speaker-stats']);
|
||||||
const localParticipant = useSelector(getLocalParticipant);
|
const localParticipant = useSelector(getLocalParticipant);
|
||||||
const { clientWidth } = useSelector(state => state['features/base/responsive-ui']);
|
|
||||||
const { defaultRemoteDisplayName } = useSelector(
|
const { defaultRemoteDisplayName } = useSelector(
|
||||||
state => state['features/base/config']) || {};
|
state => state['features/base/config']) || {};
|
||||||
|
const { enableFacialRecognition } = useSelector(state => state['features/base/config']) || {};
|
||||||
const { facialExpressions: localFacialExpressions } = useSelector(
|
const { facialExpressions: localFacialExpressions } = useSelector(
|
||||||
state => state['features/facial-recognition']) || {};
|
state => state['features/facial-recognition']) || {};
|
||||||
|
|
||||||
|
@ -48,7 +47,7 @@ const abstractSpeakerStatsList = (speakerStatsItem: Function): Function[] => {
|
||||||
? `${localParticipant.name} (${meString})`
|
? `${localParticipant.name} (${meString})`
|
||||||
: meString
|
: meString
|
||||||
);
|
);
|
||||||
if (showFacialExpressions) {
|
if (enableFacialRecognition) {
|
||||||
stats[userId].setFacialExpressions(localFacialExpressions);
|
stats[userId].setFacialExpressions(localFacialExpressions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +91,6 @@ const abstractSpeakerStatsList = (speakerStatsItem: Function): Function[] => {
|
||||||
}
|
}
|
||||||
props.hidden = statsModel.hidden;
|
props.hidden = statsModel.hidden;
|
||||||
props.showFacialExpressions = showFacialExpressions;
|
props.showFacialExpressions = showFacialExpressions;
|
||||||
props.reduceExpressions = clientWidth < REDUCE_EXPRESSIONS_THRESHOLD;
|
|
||||||
props.displayName = statsModel.getDisplayName() || defaultRemoteDisplayName;
|
props.displayName = statsModel.getDisplayName() || defaultRemoteDisplayName;
|
||||||
props.t = t;
|
props.t = t;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { useSelector, useDispatch } from 'react-redux';
|
||||||
import { Dialog } from '../../../base/dialog';
|
import { Dialog } from '../../../base/dialog';
|
||||||
import { escapeRegexp } from '../../../base/util';
|
import { escapeRegexp } from '../../../base/util';
|
||||||
import { resetSearchCriteria, toggleFacialExpressions, initSearch } from '../../actions';
|
import { resetSearchCriteria, toggleFacialExpressions, initSearch } from '../../actions';
|
||||||
import { REDUCE_EXPRESSIONS_THRESHOLD } from '../../constants';
|
|
||||||
|
|
||||||
import FacialExpressionsSwitch from './FacialExpressionsSwitch';
|
import FacialExpressionsSwitch from './FacialExpressionsSwitch';
|
||||||
import SpeakerStatsLabels from './SpeakerStatsLabels';
|
import SpeakerStatsLabels from './SpeakerStatsLabels';
|
||||||
|
@ -43,8 +42,6 @@ const useStyles = makeStyles(theme => {
|
||||||
const SpeakerStats = () => {
|
const SpeakerStats = () => {
|
||||||
const { enableFacialRecognition } = useSelector(state => state['features/base/config']);
|
const { enableFacialRecognition } = useSelector(state => state['features/base/config']);
|
||||||
const { showFacialExpressions } = useSelector(state => state['features/speaker-stats']);
|
const { showFacialExpressions } = useSelector(state => state['features/speaker-stats']);
|
||||||
const { clientWidth } = useSelector(state => state['features/base/responsive-ui']);
|
|
||||||
const reduceExpressions = clientWidth < REDUCE_EXPRESSIONS_THRESHOLD;
|
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
|
@ -82,7 +79,6 @@ const SpeakerStats = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SpeakerStatsLabels
|
<SpeakerStatsLabels
|
||||||
reduceExpressions = { reduceExpressions }
|
|
||||||
showFacialExpressions = { showFacialExpressions ?? false } />
|
showFacialExpressions = { showFacialExpressions ?? false } />
|
||||||
<div className = { classes.separator } />
|
<div className = { classes.separator } />
|
||||||
<SpeakerStatsList />
|
<SpeakerStatsList />
|
||||||
|
|
|
@ -49,11 +49,6 @@ type Props = {
|
||||||
*/
|
*/
|
||||||
facialExpressions: Object,
|
facialExpressions: Object,
|
||||||
|
|
||||||
/**
|
|
||||||
* True if the client width is les than 750.
|
|
||||||
*/
|
|
||||||
reduceExpressions: boolean,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the facial recognition is not disabled.
|
* True if the facial recognition is not disabled.
|
||||||
*/
|
*/
|
||||||
|
@ -108,11 +103,7 @@ const SpeakerStatsItem = (props: Props) => {
|
||||||
const timeClass = `${classes.time} ${props.isDominantSpeaker ? classes.dominant : ''}`;
|
const timeClass = `${classes.time} ${props.isDominantSpeaker ? classes.dominant : ''}`;
|
||||||
|
|
||||||
|
|
||||||
const FacialExpressions = () => (
|
const FacialExpressions = () => FACIAL_EXPRESSIONS.map(
|
||||||
props.reduceExpressions
|
|
||||||
? FACIAL_EXPRESSIONS
|
|
||||||
.filter(expression => ![ 'angry', 'fearful', 'disgusted' ].includes(expression))
|
|
||||||
: FACIAL_EXPRESSIONS).map(
|
|
||||||
expression => (
|
expression => (
|
||||||
<div
|
<div
|
||||||
aria-label = { props.t(`speakerStats.${expression}`) }
|
aria-label = { props.t(`speakerStats.${expression}`) }
|
||||||
|
|
|
@ -24,11 +24,6 @@ const useStyles = makeStyles(() => {
|
||||||
*/
|
*/
|
||||||
type Props = {
|
type Props = {
|
||||||
|
|
||||||
/**
|
|
||||||
* True if the client width is les than 750.
|
|
||||||
*/
|
|
||||||
reduceExpressions: boolean,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the facial recognition is not disabled.
|
* True if the facial recognition is not disabled.
|
||||||
*/
|
*/
|
||||||
|
@ -39,11 +34,7 @@ const SpeakerStatsLabels = (props: Props) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
const FacialExpressionsLabels = () => (
|
const FacialExpressionsLabels = () => Object.keys(FACIAL_EXPRESSION_EMOJIS).map(
|
||||||
props.reduceExpressions
|
|
||||||
? Object.keys(FACIAL_EXPRESSION_EMOJIS)
|
|
||||||
.filter(expression => ![ 'angry', 'fearful', 'disgusted' ].includes(expression))
|
|
||||||
: Object.keys(FACIAL_EXPRESSION_EMOJIS)).map(
|
|
||||||
expression => (
|
expression => (
|
||||||
<div
|
<div
|
||||||
className = 'expression text-large'
|
className = 'expression text-large'
|
||||||
|
|
|
@ -1,6 +1 @@
|
||||||
/**
|
export const SPEAKER_STATS_RELOAD_INTERVAL = 1000;
|
||||||
* The with of the client at witch the facial expressions will be reduced to only 4.
|
|
||||||
*/
|
|
||||||
export const REDUCE_EXPRESSIONS_THRESHOLD = 750;
|
|
||||||
|
|
||||||
export const SPEAKER_STATS_RELOAD_INTERVAL = 100000000000;
|
|
||||||
|
|
Loading…
Reference in New Issue