diff --git a/conference.js b/conference.js index 4a9ba92ff..798e7e49e 100644 --- a/conference.js +++ b/conference.js @@ -2274,7 +2274,7 @@ export default { }) .then(stream => this.useAudioStream(stream)) .then(() => { - logger.log('switched local audio device'); + logger.log(`switched local audio device: ${this.localAudio?.getDeviceId()}`); this._updateAudioDeviceId(); }) @@ -2651,12 +2651,6 @@ export default { // audio devices detected or if the local audio stream already exists. const available = audioDeviceCount > 0 || Boolean(this.localAudio); - logger.debug( - `Microphone button enabled: ${available}`, - `local audio: ${this.localAudio}`, - `audio devices: ${audioMediaDevices}`, - `device count: ${audioDeviceCount}`); - APP.store.dispatch(setAudioAvailable(available)); APP.API.notifyAudioAvailabilityChanged(available); }, @@ -2677,12 +2671,6 @@ export default { // config). const available = videoDeviceCount > 0 || Boolean(this.localVideo); - logger.debug( - `Camera button enabled: ${available}`, - `local video: ${this.localVideo}`, - `video devices: ${videoMediaDevices}`, - `device count: ${videoDeviceCount}`); - APP.store.dispatch(setVideoAvailable(available)); APP.API.notifyVideoAvailabilityChanged(available); }, diff --git a/react/features/base/devices/functions.js b/react/features/base/devices/functions.js index be0de14ba..05d4eabef 100644 --- a/react/features/base/devices/functions.js +++ b/react/features/base/devices/functions.js @@ -4,6 +4,8 @@ import { parseURLParams } from '../config'; import JitsiMeetJS from '../lib-jitsi-meet'; import { updateSettings } from '../settings'; +import logger from './logger'; + declare var APP: Object; /** @@ -187,6 +189,9 @@ export function setAudioOutputDeviceId( dispatch: Function, userSelection: boolean = false, newLabel: ?string): Promise<*> { + + logger.debug(`setAudioOutputDevice: ${String(newLabel)}[${newId}]`); + return JitsiMeetJS.mediaDevices.setAudioOutputDevice(newId) .then(() => { const newSettings = { diff --git a/react/features/base/devices/reducer.js b/react/features/base/devices/reducer.js index 7d16f27b0..655312a91 100644 --- a/react/features/base/devices/reducer.js +++ b/react/features/base/devices/reducer.js @@ -9,6 +9,8 @@ import { groupDevicesByKind } from './functions'; import { ReducerRegistry } from '../redux'; +import logger from './logger'; + const DEFAULT_STATE = { availableDevices: { audioInput: [], @@ -18,6 +20,24 @@ const DEFAULT_STATE = { pendingRequests: [] }; +/** + * Logs the current device list. + * + * @param {Object} deviceList - Whatever is returned by {@link groupDevicesByKind}. + * @returns {string} + */ +function logDeviceList(deviceList) { + const devicesToStr = list => list.map(device => `\t\t${device.label}[${device.deviceId}]`).join('\n'); + const audioInputs = devicesToStr(deviceList.audioInput); + const audioOutputs = devicesToStr(deviceList.audioOutput); + const videoInputs = devicesToStr(deviceList.videoInput); + + logger.debug('Device list updated:\n' + + `audioInput:\n${audioInputs}\n` + + `audioOutput:\n${audioOutputs}\n` + + `videoInput:\n${videoInputs}`); +} + /** * Listen for actions which changes the state of known and used devices. * @@ -35,6 +55,8 @@ ReducerRegistry.register( case UPDATE_DEVICE_LIST: { const deviceList = groupDevicesByKind(action.devices); + logDeviceList(deviceList); + return { ...state, availableDevices: deviceList @@ -56,11 +78,17 @@ ReducerRegistry.register( pendingRequests: [ ] }; - // TODO: Changing of current audio and video device id is currently - // handled outside of react/redux. Fall through to default logic for - // now. - case SET_AUDIO_INPUT_DEVICE: - case SET_VIDEO_INPUT_DEVICE: + // TODO: Changing of current audio and video device id is currently handled outside of react/redux. + case SET_AUDIO_INPUT_DEVICE: { + logger.debug(`set audio input device: ${action.deviceId}`); + + return state; + } + case SET_VIDEO_INPUT_DEVICE: { + logger.debug(`set video input device: ${action.deviceId}`); + + return state; + } default: return state; }