lint + noiseVolume changes

auto_join_3.3
Stefan Otto 2020-05-19 02:45:06 +02:00
parent 0f053d0282
commit 6576516091
2 changed files with 14 additions and 10 deletions

View File

@ -901,9 +901,9 @@ const makeMapStateToProps = () =>
if (state.peerVolumes[state.me.id] < state.settings.noiseThreshold) if (state.peerVolumes[state.me.id] < state.settings.noiseThreshold)
{ {
// noiseVolume mapped to range 0.5 ... 1 (threshold switch) // noiseVolume mapped to range 0.5 ... 1 (threshold switch)
volume = 1 + (Math.abs(state.peerVolumes[state.me.id] - volume = 1 + ((Math.abs(state.peerVolumes[state.me.id] -
state.settings.noiseThreshold) / state.settings.noiseThreshold) / (-120 -
state.settings.noiseThreshold) / 2; state.settings.noiseThreshold)));
} }
// noiseVolume over threshold: no noise but voice // noiseVolume over threshold: no noise but voice
else { volume = 0; } else { volume = 0; }

View File

@ -29,7 +29,7 @@ const NoiseSlider = withStyles(
}, },
rail : { rail : {
height : 2, height : 2,
opacity : 0.2, opacity : 0.2
}, },
mark : { mark : {
backgroundColor : '#bfbfbf', backgroundColor : '#bfbfbf',
@ -50,7 +50,7 @@ const styles = (theme) => ({
}, },
margin : margin :
{ {
height : theme.spacing(3), height : theme.spacing(3)
}, },
formControl : formControl :
{ {
@ -173,7 +173,8 @@ const MediaSettings = ({
<FormControl className={classes.formControl}> <FormControl className={classes.formControl}>
<Select <Select
value={settings.resolution || ''} value={settings.resolution || ''}
onChange={(event) => { onChange={(event) =>
{
if (event.target.value) if (event.target.value)
roomClient.changeVideoResolution(event.target.value); roomClient.changeVideoResolution(event.target.value);
}} }}
@ -181,7 +182,8 @@ const MediaSettings = ({
autoWidth autoWidth
className={classes.selectEmpty} className={classes.selectEmpty}
> >
{resolutions.map((resolution, index) => { {resolutions.map((resolution, index) =>
{
return ( return (
<MenuItem key={index} value={resolution.value}> <MenuItem key={index} value={resolution.value}>
{resolution.label} {resolution.label}
@ -350,7 +352,7 @@ const MediaSettings = ({
{ {
intl.formatMessage({ intl.formatMessage({
id : 'settings.noiseThreshold', id : 'settings.noiseThreshold',
defaultMessage : 'Noise threshold' defaultMessage : 'Noise threshold:'
}) })
} }
</Typography> </Typography>
@ -359,11 +361,13 @@ const MediaSettings = ({
min={-100} min={-100}
value={settings.noiseThreshold} value={settings.noiseThreshold}
max={0} max={0}
valueLabelDisplay={'off'}
onChange={ onChange={
(event, value) => { (event, value) =>
{
roomClient._setNoiseThreshold(value); roomClient._setNoiseThreshold(value);
}} }}
marks={[{ value: volume, label: 'level' }]} valueLabelDisplay='on' marks={[ { value: volume, label: 'level' } ]}
/> />
<div className={classes.margin} /> <div className={classes.margin} />
</form> </form>