bf17b385b6
When joining/returning breakouts, audio would always connect with full audio. This can lead to a performance problem, once all listenonly users would join full audio, increasing the number of streams in FreeSWITCH. We now have a consistent behavior, which is: 1 - The choice made by the user in the main room is predominant: if mic is active in main room, user will automatically join mic in breakout room. When returning from breakout room, user will also join with mic again. 2 - Changes made in breakout room won't have effect when returning to the main room. This means if user, for example, change from listenonly to mic in breakout room, the returning will consider the option choosen previously (listenonly) and listenonly will be active again in the main room. 3 - If user didn't join audio in the main room, the audio modal will be prompted when joining the breakout room (this is a special case of (1)) The following is some technicall information: InputStreamLiveSelector (component.jsx) now calls 'handleLeaveAudio' function, which is the default function when user leaves audio (also used when dynamic devices are inactive). We now store information about user's choice (mic or listenonly) using local storage, instead of the previous cookie method (this was triggering some warnings in browser's console). Also did a small refactoring to match eslint rules. Fixes #11662.
94 lines
3.8 KiB
JavaScript
Executable File
94 lines
3.8 KiB
JavaScript
Executable File
import React from 'react';
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
|
import deviceInfo from '/imports/utils/deviceInfo';
|
|
import browserInfo from '/imports/utils/browserInfo';
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
|
import AudioModal from './component';
|
|
import Meetings from '/imports/api/meetings';
|
|
import Auth from '/imports/ui/services/auth';
|
|
import lockContextContainer from '/imports/ui/components/lock-viewers/context/container';
|
|
import AudioError from '/imports/ui/services/audio-manager/error-codes';
|
|
import AppService from '/imports/ui/components/app/service';
|
|
import {
|
|
joinMicrophone,
|
|
closeModal,
|
|
joinListenOnly,
|
|
leaveEchoTest,
|
|
} from './service';
|
|
import Storage from '/imports/ui/services/storage/session';
|
|
import Service from '../service';
|
|
|
|
const AudioModalContainer = (props) => <AudioModal {...props} />;
|
|
|
|
const APP_CONFIG = Meteor.settings.public.app;
|
|
|
|
const invalidDialNumbers = ['0', '613-555-1212', '613-555-1234', '0000'];
|
|
const isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
|
|
|
export default lockContextContainer(withModalMounter(withTracker(({ userLocks }) => {
|
|
const listenOnlyMode = getFromUserSettings('bbb_listen_only_mode', APP_CONFIG.listenOnlyMode);
|
|
const forceListenOnly = getFromUserSettings('bbb_force_listen_only', APP_CONFIG.forceListenOnly);
|
|
const skipCheck = getFromUserSettings('bbb_skip_check_audio', APP_CONFIG.skipCheck);
|
|
const skipCheckOnJoin = getFromUserSettings('bbb_skip_check_audio_on_first_join', APP_CONFIG.skipCheckOnJoin);
|
|
const autoJoin = getFromUserSettings('bbb_auto_join_audio', APP_CONFIG.autoJoin);
|
|
const meeting = Meetings.findOne({ meetingId: Auth.meetingID }, { fields: { voiceProp: 1 } });
|
|
const getEchoTest = Storage.getItem('getEchoTest');
|
|
|
|
let formattedDialNum = '';
|
|
let formattedTelVoice = '';
|
|
let combinedDialInNum = '';
|
|
if (meeting && meeting.voiceProp) {
|
|
const { dialNumber, telVoice } = meeting.voiceProp;
|
|
if (invalidDialNumbers.indexOf(dialNumber) < 0) {
|
|
formattedDialNum = dialNumber;
|
|
formattedTelVoice = telVoice;
|
|
combinedDialInNum = `${dialNumber.replace(/\D+/g, '')},,,${telVoice.replace(/\D+/g, '')}`;
|
|
}
|
|
}
|
|
|
|
const meetingIsBreakout = AppService.meetingIsBreakout();
|
|
|
|
const joinFullAudioImmediately = (autoJoin && (skipCheck || skipCheckOnJoin && !getEchoTest))
|
|
|| (skipCheck || skipCheckOnJoin && !getEchoTest);
|
|
|
|
const forceListenOnlyAttendee = forceListenOnly && !Service.isUserModerator();
|
|
|
|
const { isIos } = deviceInfo;
|
|
const { isChrome, isIe } = browserInfo;
|
|
|
|
return ({
|
|
meetingIsBreakout,
|
|
closeModal,
|
|
joinMicrophone: (skipEchoTest) => joinMicrophone(skipEchoTest || skipCheck || skipCheckOnJoin),
|
|
joinListenOnly,
|
|
leaveEchoTest,
|
|
changeInputDevice: (inputDeviceId) => Service
|
|
.changeInputDevice(inputDeviceId),
|
|
changeOutputDevice: (outputDeviceId) => Service
|
|
.changeOutputDevice(outputDeviceId),
|
|
joinEchoTest: () => Service.joinEchoTest(),
|
|
exitAudio: () => Service.exitAudio(),
|
|
isConnecting: Service.isConnecting(),
|
|
isConnected: Service.isConnected(),
|
|
isEchoTest: Service.isEchoTest(),
|
|
inputDeviceId: Service.inputDeviceId(),
|
|
outputDeviceId: Service.outputDeviceId(),
|
|
showPermissionsOvelay: Service.isWaitingPermissions(),
|
|
listenOnlyMode,
|
|
formattedDialNum,
|
|
formattedTelVoice,
|
|
combinedDialInNum,
|
|
audioLocked: userLocks.userMic,
|
|
joinFullAudioImmediately,
|
|
forceListenOnlyAttendee,
|
|
isIOSChrome: isIos && isChrome,
|
|
isMobileNative: navigator.userAgent.toLowerCase().includes('bbbnative'),
|
|
isIE: isIe,
|
|
autoplayBlocked: Service.autoplayBlocked(),
|
|
handleAllowAutoplay: () => Service.handleAllowAutoplay(),
|
|
isRTL,
|
|
AudioError,
|
|
});
|
|
})(AudioModalContainer)));
|