Fix autoMuteThreshold bug #394

auto_join_3.3
Stefan Otto 2020-05-20 14:25:13 +02:00
parent 73709639e0
commit bb63b6304e
4 changed files with 51 additions and 5 deletions

View File

@ -89,7 +89,8 @@ var config =
* unmuted. Next participant will join automatically muted * unmuted. Next participant will join automatically muted
* Default value is 4 * 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 * but use it with caution
* full mesh audio strongly decrease room capacity! * full mesh audio strongly decrease room capacity!
*/ */

View File

@ -3045,9 +3045,13 @@ export default class RoomClient
if (!this._muted) if (!this._muted)
{ {
await this.enableMic(); 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(); this.muteMic();
} }

View File

@ -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;
}
}

View File

@ -22,7 +22,6 @@ const initialState =
notificationSounds : true, notificationSounds : true,
buttonControlBar : window.config.buttonControlBar || false, buttonControlBar : window.config.buttonControlBar || false,
drawerOverlayed : window.config.drawerOverlayed || true, drawerOverlayed : window.config.drawerOverlayed || true,
autoMuteThreshold : window.config.autoMuteThreshold || 4,
...window.config.defaultAudio ...window.config.defaultAudio
}; };