diff --git a/app/src/components/Controls/TopBar.js b/app/src/components/Controls/TopBar.js index ec046a28..0d0e65dc 100644 --- a/app/src/components/Controls/TopBar.js +++ b/app/src/components/Controls/TopBar.js @@ -54,10 +54,9 @@ import { store } from '../../store'; // import producers from '../../reducers/producers'; // import logger from 'redux-logger'; import Logger from '../../Logger'; -import * as requestActions from '../../actions/requestActions'; +import { config } from '../../config'; const logger = new Logger('Recorder'); -import { config } from '../../config'; const styles = (theme) => ({ diff --git a/app/src/components/Notifications/Notifications.js b/app/src/components/Notifications/Notifications.js index 5948846d..9d743a50 100644 --- a/app/src/components/Notifications/Notifications.js +++ b/app/src/components/Notifications/Notifications.js @@ -4,6 +4,9 @@ import PropTypes from 'prop-types'; import { withSnackbar } from 'notistack'; import * as notificationActions from '../../actions/notificationActions'; import { config } from '../../config'; +import Button from '@material-ui/core/Button'; +import VerifiedUserIcon from '@material-ui/icons/VerifiedUser'; +import { FormattedMessage } from 'react-intl'; class Notifications extends Component { diff --git a/app/src/reducers/settings.js b/app/src/reducers/settings.js index 91e3dbb8..305b1ff5 100644 --- a/app/src/reducers/settings.js +++ b/app/src/reducers/settings.js @@ -1,35 +1,46 @@ +import { config } from '../config'; + const initialState = { - displayName : `Guest ${Math.floor(Math.random() * (100000 - 10000)) + 10000}`, - selectedWebcam : null, - selectedAudioDevice : null, - advancedMode : false, - autoGainControl : false, - echoCancellation : true, - noiseSuppression : true, - voiceActivatedUnmute : false, - noiseThreshold : -50, - audioMuted : false, - videoMuted : false, + displayName : '', + selectedWebcam : null, + selectedAudioDevice : null, + advancedMode : false, + autoGainControl : config.autoGainControl, + echoCancellation : config.echoCancellation, + noiseSuppression : config.noiseSuppression, + voiceActivatedUnmute : config.voiceActivatedUnmute, + noiseThreshold : config.noiseThreshold, + audioMuted : false, + videoMuted : false, // low, medium, high, veryhigh, ultra - resolution : window.config.defaultResolution || 'medium', - frameRate : window.config.defaultFrameRate || 15, - screenSharingResolution : window.config.defaultScreenResolution || 'veryhigh', - screenSharingFrameRate : window.config.defaultScreenSharingFrameRate || 5, - recorderPreferredMimeType : window.config.defaultRecorderMimeType || 'video/webm', - recorderSupportedMimeTypes : [], - lastN : 4, - permanentTopBar : true, - hiddenControls : false, - showNotifications : true, - notificationSounds : true, - mirrorOwnVideo : true, - buttonControlBar : window.config.buttonControlBar || false, - drawerOverlayed : window.config.drawerOverlayed || true, - aspectRatio : window.config.viewAspectRatio || 1.777, // 16 : 9 - mediaPerms : { audio: true, video: true }, - localPicture : null, - ...window.config.defaultAudio + resolution : config.resolution, + frameRate : config.frameRate, + screenSharingResolution : config.screenResolution, + screenSharingFrameRate : config.screenSharingFrameRate, + lastN : 4, + permanentTopBar : true, + hiddenControls : false, + showNotifications : true, + notificationSounds : true, + mirrorOwnVideo : true, + hideNoVideoParticipants : false, + buttonControlBar : config.buttonControlBar, + drawerOverlayed : config.drawerOverlayed, + aspectRatio : config.aspectRatio, + mediaPerms : { audio: true, video: true }, + localPicture : null, + audioPreset : config.audioPreset, + audioPresets : config.audioPresets, + sampleRate : config.sampleRate, + channelCount : config.channelCount, + sampleSize : config.sampleSize, + opusStereo : config.opusStereo, + opusDtx : config.opusDtx, + opusFec : config.opusFec, + opusPtime : config.opusPtime, + opusMaxPlaybackRate : config.opusMaxPlaybackRate, + enableOpusDetails : false }; const settings = (state = initialState, action) => @@ -69,14 +80,14 @@ const settings = (state = initialState, action) => { const { sampleRate } = action.payload; - return { ...state, sampleRate }; + return { ...state, sampleRate, opusMaxPlaybackRate: sampleRate }; } case 'SET_CHANNEL_COUNT': { const { channelCount } = action.payload; - return { ...state, channelCount }; + return { ...state, channelCount, opusStereo: channelCount > 1 }; } case 'SET_VOLUME': @@ -93,6 +104,13 @@ const settings = (state = initialState, action) => return { ...state, autoGainControl }; } + case 'SET_AUDIO_PRESET': + { + const { audioPreset } = action.payload; + + return { ...state, audioPreset }; + } + case 'SET_ECHO_CANCELLATION': { const { echoCancellation } = action.payload; @@ -121,6 +139,48 @@ const settings = (state = initialState, action) => return { ...state, noiseThreshold }; } + case 'SET_OPUS_STEREO': + { + const { opusStereo } = action.payload; + + return { ...state, opusStereo }; + } + + case 'SET_OPUS_DTX': + { + const { opusDtx } = action.payload; + + return { ...state, opusDtx }; + } + + case 'SET_OPUS_FEC': + { + const { opusFec } = action.payload; + + return { ...state, opusFec }; + } + + case 'SET_OPUS_PTIME': + { + const { opusPtime } = action.payload; + + return { ...state, opusPtime }; + } + + case 'SET_OPUS_MAX_PLAYBACK_RATE': + { + const { opusMaxPlaybackRate } = action.payload; + + return { ...state, opusMaxPlaybackRate }; + } + + case 'SET_ENABLE_OPUS_DETAILS': + { + const { enableOpusDetails } = action.payload; + + return { ...state, enableOpusDetails }; + } + case 'SET_DEFAULT_AUDIO': { const { audio } = action.payload; @@ -226,6 +286,13 @@ const settings = (state = initialState, action) => return { ...state, mirrorOwnVideo }; } + case 'TOGGLE_HIDE_NO_VIDEO_PARTICIPANTS': + { + const hideNoVideoParticipants = !state.hideNoVideoParticipants; + + return { ...state, hideNoVideoParticipants }; + } + case 'SET_MEDIA_PERMS': { const { mediaPerms } = action.payload; diff --git a/app/src/store.js b/app/src/store.js index 728661a6..c28602b7 100644 --- a/app/src/store.js +++ b/app/src/store.js @@ -52,11 +52,6 @@ const migrations = // } }; -const saveSubsetFilter = createFilter( - 'me', - [ 'loggedIn' ] -); - const persistConfig = { key : 'root',