From faee1c139e36a2f9c5df853f3aa6a1a9deb4180f Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 5 Jun 2019 18:01:18 +0100 Subject: [PATCH] Adds a config param startSilent to disable audio output. --- conference.js | 7 +++++++ config.js | 4 ++++ lang/main.json | 2 ++ modules/UI/videolayout/SmallVideo.js | 4 +++- react/features/base/config/functions.any.js | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/conference.js b/conference.js index d401d7e16..d09edf07f 100644 --- a/conference.js +++ b/conference.js @@ -792,6 +792,13 @@ export default { this.recorder = new Recorder(); } + if (config.startSilent) { + APP.store.dispatch(showNotification({ + descriptionKey: 'notify.startSilentDescription', + titleKey: 'notify.startSilentTitle' + })); + } + // XXX The API will take care of disconnecting from the XMPP // server (and, thus, leaving the room) on unload. return new Promise((resolve, reject) => { diff --git a/config.js b/config.js index 13b8a09e1..8c3a442a8 100644 --- a/config.js +++ b/config.js @@ -90,6 +90,10 @@ var config = { // applied locally. FIXME: having these 2 options is confusing. // startWithAudioMuted: false, + // Enabling it (with #params) will disable local audio output of remote + // participants and to enable it back a reload is needed. + // startSilent: false + // Video // Sets the preferred resolution (height) for local video. Defaults to 720. diff --git a/lang/main.json b/lang/main.json index eec7a3c84..346fbb59f 100644 --- a/lang/main.json +++ b/lang/main.json @@ -478,6 +478,8 @@ "mutedTitle": "You're muted!", "raisedHand": "__name__ would like to speak.", "somebody": "Somebody", + "startSilentTitle": "You joined with no audio output!", + "startSilentDescription": "Rejoin the meeting to enable audio", "suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the fully supported browsers.", "suboptimalExperienceTitle": "Browser Warning", "newDeviceCameraTitle": "New camera detected", diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 4e7b13039..80c936db1 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -1,4 +1,4 @@ -/* global $, APP, interfaceConfig */ +/* global $, APP, config, interfaceConfig */ /* eslint-disable no-unused-vars */ import React from 'react'; @@ -199,6 +199,8 @@ SmallVideo.createStreamElement = function(stream) { if (isVideo) { element.setAttribute('muted', 'true'); + } else if (config.startSilent) { + element.muted = true; } element.autoplay = true; diff --git a/react/features/base/config/functions.any.js b/react/features/base/config/functions.any.js index 0caefd1fb..703e4f209 100644 --- a/react/features/base/config/functions.any.js +++ b/react/features/base/config/functions.any.js @@ -132,6 +132,7 @@ const WHITELISTED_KEYS = [ 'startAudioMuted', 'startAudioOnly', 'startBitrate', + 'startSilent', 'startScreenSharing', 'startVideoMuted', 'startWithAudioMuted',