Fix autoMuteThreshold bug #394
parent
73709639e0
commit
bb63b6304e
|
|
@ -89,7 +89,8 @@ var config =
|
|||
* unmuted. Next participant will join automatically muted
|
||||
* Default value is 4
|
||||
*
|
||||
* Set it to 0 to disable auto mute functionality,
|
||||
* Set it to 0 to auto mute all,
|
||||
* Set it to negative (-1) to never automatically auto mute
|
||||
* but use it with caution
|
||||
* full mesh audio strongly decrease room capacity!
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3045,9 +3045,13 @@ export default class RoomClient
|
|||
if (!this._muted)
|
||||
{
|
||||
await this.enableMic();
|
||||
const { autoMuteThreshold } = store.getState().settings;
|
||||
let autoMuteThreshold = 4;
|
||||
|
||||
if (autoMuteThreshold && peers.length > autoMuteThreshold)
|
||||
if ('autoMuteThreshold' in window.config)
|
||||
{
|
||||
autoMuteThreshold = window.config.autoMuteThreshold;
|
||||
}
|
||||
if (autoMuteThreshold && peers.length >= autoMuteThreshold)
|
||||
this.muteMic();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
|
||||
|
||||
class AudioAnalyzer extends EventEmitter
|
||||
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (prefix)
|
||||
{
|
||||
this._debug = debug(`${APP_NAME}:${prefix}`);
|
||||
this._warn = debug(`${APP_NAME}:WARN:${prefix}`);
|
||||
this._error = debug(`${APP_NAME}:ERROR:${prefix}`);
|
||||
}
|
||||
else
|
||||
{
|
||||
this._debug = debug(APP_NAME);
|
||||
this._warn = debug(`${APP_NAME}:WARN`);
|
||||
this._error = debug(`${APP_NAME}:ERROR`);
|
||||
}
|
||||
|
||||
/* eslint-disable no-console */
|
||||
this._debug.log = console.info.bind(console);
|
||||
this._warn.log = console.warn.bind(console);
|
||||
this._error.log = console.error.bind(console);
|
||||
/* eslint-enable no-console */
|
||||
}
|
||||
|
||||
get debug()
|
||||
{
|
||||
return this._debug;
|
||||
}
|
||||
|
||||
get warn()
|
||||
{
|
||||
return this._warn;
|
||||
}
|
||||
|
||||
get error()
|
||||
{
|
||||
return this._error;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,6 @@ const initialState =
|
|||
notificationSounds : true,
|
||||
buttonControlBar : window.config.buttonControlBar || false,
|
||||
drawerOverlayed : window.config.drawerOverlayed || true,
|
||||
autoMuteThreshold : window.config.autoMuteThreshold || 4,
|
||||
...window.config.defaultAudio
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue