From 8d9a045f328c52fa0ad282cc84ec17541c31f13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Wed, 13 May 2020 09:06:06 +0200 Subject: [PATCH 1/7] Add autoMuteThreshold --- app/public/config/config.example.js | 32 +++++++++++++++++++---------- app/src/RoomClient.js | 4 +++- app/src/reducers/settings.js | 1 + 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/app/public/config/config.example.js b/app/public/config/config.example.js index 7909284..3126613 100644 --- a/app/public/config/config.example.js +++ b/app/public/config/config.example.js @@ -52,26 +52,36 @@ var config = noiseSuppression : true, sampleSize : 16 }, - background : 'images/background.jpg', - defaultLayout : 'democratic', // democratic, filmstrip + + /** + * Set the auto mute / Push To Talk threshold + * default value is 4 + * + * Set it to 0 to disable auto mute functionality, + * but use it with caution + * full mesh audio strongly decrease room capacity! + */ + autoMuteThreshold : 4, + background : 'images/background.jpg', + defaultLayout : 'democratic', // democratic, filmstrip // If true, will show media control buttons in separate // control bar, not in the ME container. - buttonControlBar : false, + buttonControlBar : false, // If false, will push videos away to make room for side // drawer. If true, will overlay side drawer over videos - drawerOverlayed : true, + drawerOverlayed : true, // Timeout for autohiding topbar and button control bar - hideTimeout : 3000, - lastN : 4, - mobileLastN : 1, + hideTimeout : 3000, + lastN : 4, + mobileLastN : 1, // Highest number of speakers user can select - maxLastN : 5, + maxLastN : 5, // If truthy, users can NOT change number of speakers visible - lockLastN : false, + lockLastN : false, // Add file and uncomment for adding logo to appbar // logo : 'images/logo.svg', - title : 'Multiparty meeting', - theme : + title : 'Multiparty meeting', + theme : { palette : { diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 2217d65..9635408 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -2960,7 +2960,9 @@ export default class RoomClient if (!this._muted) { await this.enableMic(); - if (peers.length > 4) + const { autoMuteThreshold } = store.getState().settings; + + if (autoMuteThreshold && peers.length > autoMuteThreshold) this.muteMic(); } diff --git a/app/src/reducers/settings.js b/app/src/reducers/settings.js index 1c375bf..f810d3a 100644 --- a/app/src/reducers/settings.js +++ b/app/src/reducers/settings.js @@ -20,6 +20,7 @@ const initialState = notificationSounds : true, buttonControlBar : window.config.buttonControlBar || false, drawerOverlayed : window.config.drawerOverlayed || true, + autoMuteThreshold : window.config.autoMuteThreshold || 4, ...window.config.defaultAudio }; From b89bb3a5139cf6aa4d9a1cc646ba6b0cb4056be4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Thu, 14 May 2020 09:16:42 +0200 Subject: [PATCH 2/7] Fix lint max length --- app/src/Spotlights.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index 83e9905..5d9f406 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -59,7 +59,8 @@ export default class Spotlights extends EventEmitter peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + if (peerId != null && + this._currentSpotlights.length < this._unmutablePeerList.length) { const oldIndex = this._unmutablePeerList.indexOf(peerId); @@ -101,7 +102,8 @@ export default class Spotlights extends EventEmitter peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + if (peerId != null && + this._currentSpotlights.length < this._unmutablePeerList.length) { const oldIndex = this._unmutablePeerList.indexOf(peerId); From eeb10d93131c63d2bbe7bcb90c4e026540af5e34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Mih=C3=A1ly?= Date: Thu, 14 May 2020 09:45:42 +0200 Subject: [PATCH 3/7] Fix #358 set screenshare tooltip state manualy See: mui-org/material-ui#12299 --- app/src/components/Containers/Me.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/app/src/components/Containers/Me.js b/app/src/components/Containers/Me.js index 8d45473..b7edbf1 100644 --- a/app/src/components/Containers/Me.js +++ b/app/src/components/Containers/Me.js @@ -284,6 +284,25 @@ const Me = (props) => defaultMessage : 'Start screen sharing' }); } + const [ + screenShareTooltipOpen, + screenShareTooltipSetOpen + ] = React.useState(false); + + const screenShareTooltipHandleClose = () => + { + screenShareTooltipSetOpen(false); + }; + + const screenShareTooltipHandleOpen = () => + { + screenShareTooltipSetOpen(true); + }; + + if (screenState === 'off' && me.screenShareInProgress && screenShareTooltipOpen) + { + screenShareTooltipHandleClose(); + } const spacingStyle = { @@ -511,7 +530,11 @@ const Me = (props) => } { me.browser.platform !== 'mobile' && - + { smallContainer ?
Date: Thu, 14 May 2020 14:01:56 +0200 Subject: [PATCH 4/7] fix: Stop screensharing remove stream properly --- app/src/RoomClient.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 3d63d26..143aea9 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -3616,6 +3616,8 @@ export default class RoomClient this._screenSharingProducer = null; + this._screenSharing.stop(); + store.dispatch(meActions.setScreenShareInProgress(false)); } From 4e80c526a370926d93ff52de327341aea552792e Mon Sep 17 00:00:00 2001 From: Astagor Date: Thu, 14 May 2020 14:18:04 +0200 Subject: [PATCH 5/7] Fixed to work on filmstrip. Changed logic, use setSelectedPeer --- app/src/RoomClient.js | 6 ++-- app/src/Spotlights.js | 80 ++++++++++++------------------------------- 2 files changed, 26 insertions(+), 60 deletions(-) diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 143aea9..1703205 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -304,12 +304,14 @@ export default class RoomClient { case String.fromCharCode(37): { - this._spotlights.setPrevAsSelected(); + const newPeerId = this._spotlights.getPrevAsSelected(store.getState().room.selectedPeerId); + if (newPeerId) this.setSelectedPeer(newPeerId); break; } case String.fromCharCode(39): { - this._spotlights.setNextAsSelected(); + const newPeerId = this._spotlights.getNextAsSelected(store.getState().room.selectedPeerId); + if (newPeerId) this.setSelectedPeer(newPeerId); break; } case 'A': // Activate advanced mode diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index 5d9f406..afa4b06 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -46,90 +46,54 @@ export default class Spotlights extends EventEmitter } } - setNextAsSelected() + getNextAsSelected(peerId) { - let peerId = null; - - if (this._selectedSpotlights.length > 0) - { - peerId = this._selectedSpotlights[0]; - } - else if (this._unmutablePeerList.length > 0) - { + let newSelectedPeer; + if (peerId == null && this._unmutablePeerList.length > 0) { peerId = this._unmutablePeerList[0]; } - if (peerId != null && - this._currentSpotlights.length < this._unmutablePeerList.length) - { - const oldIndex = this._unmutablePeerList.indexOf(peerId); - + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { + let oldIndex = this._unmutablePeerList.indexOf(peerId); let index = oldIndex; - index++; - do - { - if (index >= this._unmutablePeerList.length) - { + for (let i = 0; i < this._unmutablePeerList.length; i++) { + if (index >= this._unmutablePeerList.length) { index = 0; } - const newSelectedPeer = this._unmutablePeerList[index]; - - if (!this._currentSpotlights.includes(newSelectedPeer)) - { - this.setPeerSpotlight(newSelectedPeer); + newSelectedPeer = this._unmutablePeerList[index]; + if (!this._currentSpotlights.includes(newSelectedPeer)) { break; } index++; - if (index === oldIndex) - { - break; - } - } while (true); + } } + return newSelectedPeer; } - setPrevAsSelected() + getPrevAsSelected(peerId) { - let peerId = null; - - if (this._selectedSpotlights.length > 0) - { - peerId = this._selectedSpotlights[0]; - } - else if (this._unmutablePeerList.length > 0) - { + let newSelectedPeer; + if (peerId == null && this._unmutablePeerList.length > 0) { peerId = this._unmutablePeerList[0]; } - if (peerId != null && - this._currentSpotlights.length < this._unmutablePeerList.length) - { - const oldIndex = this._unmutablePeerList.indexOf(peerId); - + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { + let oldIndex = this._unmutablePeerList.indexOf(peerId); let index = oldIndex; - index--; - do - { - if (index < 0) - { + for (let i = 0; i < this._unmutablePeerList.length; i++) { + if (index < 0) { index = this._unmutablePeerList.length - 1; } - const newSelectedPeer = this._unmutablePeerList[index]; - - if (!this._currentSpotlights.includes(newSelectedPeer)) - { - this.setPeerSpotlight(newSelectedPeer); + newSelectedPeer = this._unmutablePeerList[index]; + if (!this._currentSpotlights.includes(newSelectedPeer)) { break; } index--; - if (index === oldIndex) - { - break; - } - } while (true); + } } + return newSelectedPeer; } setPeerSpotlight(peerId) From ceebea6a400e21e700fd70cb099e7666f3a21d02 Mon Sep 17 00:00:00 2001 From: Astagor Date: Thu, 14 May 2020 14:23:31 +0200 Subject: [PATCH 6/7] Fixed lint --- app/src/Spotlights.js | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index afa4b06..6df7f1d 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -48,21 +48,28 @@ export default class Spotlights extends EventEmitter getNextAsSelected(peerId) { - let newSelectedPeer; - if (peerId == null && this._unmutablePeerList.length > 0) { + let newSelectedPeer = null; + + if (peerId == null && this._unmutablePeerList.length > 0) + { peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { - let oldIndex = this._unmutablePeerList.indexOf(peerId); + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + { + const oldIndex = this._unmutablePeerList.indexOf(peerId); + let index = oldIndex; + index++; - for (let i = 0; i < this._unmutablePeerList.length; i++) { + for (let i = 0; i < this._unmutablePeerList.length; i++) + { if (index >= this._unmutablePeerList.length) { index = 0; } newSelectedPeer = this._unmutablePeerList[index]; - if (!this._currentSpotlights.includes(newSelectedPeer)) { + if (!this._currentSpotlights.includes(newSelectedPeer)) + { break; } index++; @@ -73,21 +80,28 @@ export default class Spotlights extends EventEmitter getPrevAsSelected(peerId) { - let newSelectedPeer; - if (peerId == null && this._unmutablePeerList.length > 0) { + let newSelectedPeer = null; + + if (peerId == null && this._unmutablePeerList.length > 0) + { peerId = this._unmutablePeerList[0]; } - if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) { - let oldIndex = this._unmutablePeerList.indexOf(peerId); + if (peerId != null && this._currentSpotlights.length < this._unmutablePeerList.length) + { + const oldIndex = this._unmutablePeerList.indexOf(peerId); + let index = oldIndex; + index--; - for (let i = 0; i < this._unmutablePeerList.length; i++) { + for (let i = 0; i < this._unmutablePeerList.length; i++) + { if (index < 0) { index = this._unmutablePeerList.length - 1; } newSelectedPeer = this._unmutablePeerList[index]; - if (!this._currentSpotlights.includes(newSelectedPeer)) { + if (!this._currentSpotlights.includes(newSelectedPeer)) + { break; } index--; From daf958d6273c992b52e440a950f0f8aabb28fe59 Mon Sep 17 00:00:00 2001 From: Astagor Date: Thu, 14 May 2020 14:27:03 +0200 Subject: [PATCH 7/7] Fixed lint 2 --- app/src/RoomClient.js | 8 ++++++-- app/src/Spotlights.js | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js index 1703205..16f0dd4 100644 --- a/app/src/RoomClient.js +++ b/app/src/RoomClient.js @@ -304,13 +304,17 @@ export default class RoomClient { case String.fromCharCode(37): { - const newPeerId = this._spotlights.getPrevAsSelected(store.getState().room.selectedPeerId); + const newPeerId = this._spotlights.getPrevAsSelected( + store.getState().room.selectedPeerId); + if (newPeerId) this.setSelectedPeer(newPeerId); break; } case String.fromCharCode(39): { - const newPeerId = this._spotlights.getNextAsSelected(store.getState().room.selectedPeerId); + const newPeerId = this._spotlights.getNextAsSelected( + store.getState().room.selectedPeerId); + if (newPeerId) this.setSelectedPeer(newPeerId); break; } diff --git a/app/src/Spotlights.js b/app/src/Spotlights.js index 6df7f1d..10d6638 100644 --- a/app/src/Spotlights.js +++ b/app/src/Spotlights.js @@ -64,7 +64,8 @@ export default class Spotlights extends EventEmitter index++; for (let i = 0; i < this._unmutablePeerList.length; i++) { - if (index >= this._unmutablePeerList.length) { + if (index >= this._unmutablePeerList.length) + { index = 0; } newSelectedPeer = this._unmutablePeerList[index]; @@ -75,6 +76,7 @@ export default class Spotlights extends EventEmitter index++; } } + return newSelectedPeer; } @@ -96,7 +98,8 @@ export default class Spotlights extends EventEmitter index--; for (let i = 0; i < this._unmutablePeerList.length; i++) { - if (index < 0) { + if (index < 0) + { index = this._unmutablePeerList.length - 1; } newSelectedPeer = this._unmutablePeerList[index]; @@ -107,6 +110,7 @@ export default class Spotlights extends EventEmitter index--; } } + return newSelectedPeer; }