2024-02-17 04:32:14 +08:00
|
|
|
import React, { useEffect } from 'react';
|
2024-06-13 21:54:46 +08:00
|
|
|
import { useSubscription } from '@apollo/client';
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2024-06-06 21:50:03 +08:00
|
|
|
import Session from '/imports/ui/services/storage/in-memory';
|
2017-10-19 03:40:01 +08:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
2023-02-22 01:57:34 +08:00
|
|
|
import { range } from '/imports/utils/array-utils';
|
2024-06-13 21:54:46 +08:00
|
|
|
import { useMeetingIsBreakout } from '/imports/ui/components/app/service';
|
2018-07-10 03:23:16 +08:00
|
|
|
import { notify } from '/imports/ui/services/notification';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2018-11-16 03:38:04 +08:00
|
|
|
import VideoPreviewContainer from '/imports/ui/components/video-preview/container';
|
2019-05-24 00:47:56 +08:00
|
|
|
import lockContextContainer from '/imports/ui/components/lock-viewers/context/container';
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
import {
|
|
|
|
joinMicrophone,
|
|
|
|
joinListenOnly,
|
|
|
|
} from '/imports/ui/components/audio/audio-modal/service';
|
|
|
|
|
2017-05-02 03:52:57 +08:00
|
|
|
import Service from './service';
|
2017-09-29 21:38:10 +08:00
|
|
|
import AudioModalContainer from './audio-modal/container';
|
2024-01-29 20:49:40 +08:00
|
|
|
import useToggleVoice from './audio-graphql/hooks/useToggleVoice';
|
2024-03-09 04:48:44 +08:00
|
|
|
import usePreviousValue from '/imports/ui/hooks/usePreviousValue';
|
2024-05-29 21:26:11 +08:00
|
|
|
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
|
|
|
|
import { toggleMuteMicrophone } from '/imports/ui/components/audio/audio-graphql/audio-controls/input-stream-live-selector/service';
|
2024-05-18 04:33:52 +08:00
|
|
|
import useSettings from '../../services/settings/hooks/useSettings';
|
|
|
|
import { SETTINGS } from '../../services/settings/enums';
|
2024-06-06 21:50:03 +08:00
|
|
|
import { useStorageKey } from '../../services/storage/hooks';
|
2024-06-13 21:54:46 +08:00
|
|
|
import { BREAKOUT_COUNT } from './queries';
|
2024-06-14 21:30:48 +08:00
|
|
|
import useMeeting from '../../core/hooks/useMeeting';
|
2024-06-22 05:45:05 +08:00
|
|
|
import useWhoIsUnmuted from '../../core/hooks/useWhoIsUnmuted';
|
2017-03-28 04:40:44 +08:00
|
|
|
|
2017-10-19 03:40:01 +08:00
|
|
|
const intlMessages = defineMessages({
|
|
|
|
joinedAudio: {
|
|
|
|
id: 'app.audioManager.joinedAudio',
|
|
|
|
description: 'Joined audio toast message',
|
|
|
|
},
|
2017-10-23 20:41:09 +08:00
|
|
|
joinedEcho: {
|
2017-10-19 03:40:01 +08:00
|
|
|
id: 'app.audioManager.joinedEcho',
|
|
|
|
description: 'Joined echo test toast message',
|
|
|
|
},
|
|
|
|
leftAudio: {
|
|
|
|
id: 'app.audioManager.leftAudio',
|
|
|
|
description: 'Left audio toast message',
|
|
|
|
},
|
2019-06-13 05:01:20 +08:00
|
|
|
reconnectingAudio: {
|
|
|
|
id: 'app.audioManager.reconnectingAudio',
|
|
|
|
description: 'Reconnecting audio toast message',
|
|
|
|
},
|
2017-10-19 03:40:01 +08:00
|
|
|
genericError: {
|
|
|
|
id: 'app.audioManager.genericError',
|
2018-06-20 23:36:26 +08:00
|
|
|
description: 'Generic error message',
|
2017-10-19 03:40:01 +08:00
|
|
|
},
|
|
|
|
connectionError: {
|
|
|
|
id: 'app.audioManager.connectionError',
|
2018-06-20 23:36:26 +08:00
|
|
|
description: 'Connection error message',
|
2017-10-19 03:40:01 +08:00
|
|
|
},
|
|
|
|
requestTimeout: {
|
|
|
|
id: 'app.audioManager.requestTimeout',
|
2018-06-20 23:36:26 +08:00
|
|
|
description: 'Request timeout error message',
|
2017-10-19 03:40:01 +08:00
|
|
|
},
|
|
|
|
invalidTarget: {
|
|
|
|
id: 'app.audioManager.invalidTarget',
|
2018-06-20 23:36:26 +08:00
|
|
|
description: 'Invalid target error message',
|
2017-10-19 03:40:01 +08:00
|
|
|
},
|
2017-10-27 01:14:56 +08:00
|
|
|
mediaError: {
|
|
|
|
id: 'app.audioManager.mediaError',
|
2018-06-20 23:36:26 +08:00
|
|
|
description: 'Media error message',
|
2017-10-27 01:14:56 +08:00
|
|
|
},
|
2018-06-27 21:56:03 +08:00
|
|
|
BrowserNotSupported: {
|
|
|
|
id: 'app.audioNotification.audioFailedError1003',
|
2024-03-18 21:58:53 +08:00
|
|
|
description: 'browser not supported error message',
|
2018-06-27 21:56:03 +08:00
|
|
|
},
|
2018-07-10 03:23:16 +08:00
|
|
|
reconectingAsListener: {
|
|
|
|
id: 'app.audioNotificaion.reconnectingAsListenOnly',
|
2024-03-18 21:58:53 +08:00
|
|
|
description: 'ice negotiation error message',
|
2018-07-10 03:23:16 +08:00
|
|
|
},
|
2017-10-19 03:40:01 +08:00
|
|
|
});
|
|
|
|
|
2024-06-13 21:54:46 +08:00
|
|
|
let didMountAutoJoin = false;
|
|
|
|
|
|
|
|
const webRtcError = range(1001, 1011)
|
|
|
|
.reduce((acc, value) => ({
|
|
|
|
...acc,
|
|
|
|
[value]: { id: `app.audioNotification.audioFailedError${value}` },
|
|
|
|
}), {});
|
|
|
|
|
|
|
|
const messages = {
|
|
|
|
info: {
|
|
|
|
JOINED_AUDIO: intlMessages.joinedAudio,
|
|
|
|
JOINED_ECHO: intlMessages.joinedEcho,
|
|
|
|
LEFT_AUDIO: intlMessages.leftAudio,
|
|
|
|
RECONNECTING_AUDIO: intlMessages.reconnectingAudio,
|
|
|
|
},
|
|
|
|
error: {
|
|
|
|
GENERIC_ERROR: intlMessages.genericError,
|
|
|
|
CONNECTION_ERROR: intlMessages.connectionError,
|
|
|
|
REQUEST_TIMEOUT: intlMessages.requestTimeout,
|
|
|
|
INVALID_TARGET: intlMessages.invalidTarget,
|
|
|
|
MEDIA_ERROR: intlMessages.mediaError,
|
|
|
|
WEBRTC_NOT_SUPPORTED: intlMessages.BrowserNotSupported,
|
|
|
|
...webRtcError,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
const AudioContainer = (props) => {
|
|
|
|
const {
|
|
|
|
isAudioModalOpen,
|
|
|
|
setAudioModalIsOpen,
|
|
|
|
setVideoPreviewModalIsOpen,
|
|
|
|
isVideoPreviewModalOpen,
|
|
|
|
intl,
|
|
|
|
userLocks,
|
2024-06-13 21:54:46 +08:00
|
|
|
speechLocale,
|
2024-02-17 04:32:14 +08:00
|
|
|
} = props;
|
2018-01-10 06:07:29 +08:00
|
|
|
|
2024-06-13 21:54:46 +08:00
|
|
|
const APP_CONFIG = window.meetingClientSettings.public.app;
|
|
|
|
const KURENTO_CONFIG = window.meetingClientSettings.public.kurento;
|
|
|
|
|
|
|
|
const autoJoin = getFromUserSettings('bbb_auto_join_audio', APP_CONFIG.autoJoin);
|
|
|
|
const enableVideo = getFromUserSettings('bbb_enable_video', KURENTO_CONFIG.enableVideo);
|
|
|
|
const autoShareWebcam = getFromUserSettings('bbb_auto_share_webcam', KURENTO_CONFIG.autoShareWebcam);
|
|
|
|
const { userWebcam } = userLocks;
|
2024-05-18 04:33:52 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
const prevProps = usePreviousValue(props);
|
|
|
|
const toggleVoice = useToggleVoice();
|
2024-06-06 21:50:03 +08:00
|
|
|
const userSelectedMicrophone = !!useStorageKey('clientUserSelectedMicrophone', 'session');
|
2024-06-13 21:54:46 +08:00
|
|
|
const userSelectedListenOnly = !!useStorageKey('clientUserSelectedListenOnly', 'session');
|
|
|
|
const { microphoneConstraints } = useSettings(SETTINGS.APPLICATION);
|
|
|
|
const { data: breakoutCountData } = useSubscription(BREAKOUT_COUNT);
|
|
|
|
const hasBreakoutRooms = (breakoutCountData?.breakoutRoom_aggregate?.aggregate?.count ?? 0) > 0;
|
|
|
|
const meetingIsBreakout = useMeetingIsBreakout();
|
2024-06-14 21:30:48 +08:00
|
|
|
const { data: meeting } = useMeeting((m) => ({
|
|
|
|
voiceSettings: {
|
|
|
|
voiceConf: m?.voiceSettings?.voiceConf,
|
|
|
|
},
|
|
|
|
}));
|
2024-06-14 22:35:53 +08:00
|
|
|
const { data: currentUserName } = useCurrentUser((u) => u.name);
|
2024-06-13 21:54:46 +08:00
|
|
|
|
|
|
|
const openAudioModal = () => setAudioModalIsOpen(true);
|
|
|
|
|
|
|
|
const openVideoPreviewModal = () => {
|
|
|
|
if (userWebcam) return;
|
|
|
|
setVideoPreviewModalIsOpen(true);
|
|
|
|
};
|
|
|
|
|
|
|
|
const init = async () => {
|
2024-06-14 21:30:48 +08:00
|
|
|
await Service.init(
|
|
|
|
messages,
|
|
|
|
intl,
|
|
|
|
toggleVoice,
|
|
|
|
speechLocale,
|
|
|
|
meeting?.voiceSettings?.voiceConf,
|
2024-06-14 22:35:53 +08:00
|
|
|
currentUserName,
|
2024-06-14 21:30:48 +08:00
|
|
|
);
|
2024-06-13 21:54:46 +08:00
|
|
|
if ((!autoJoin || didMountAutoJoin)) {
|
|
|
|
if (enableVideo && autoShareWebcam) {
|
|
|
|
openVideoPreviewModal();
|
|
|
|
}
|
|
|
|
return Promise.resolve(false);
|
|
|
|
}
|
|
|
|
Session.setItem('audioModalIsOpen', true);
|
|
|
|
if (enableVideo && autoShareWebcam) {
|
|
|
|
openAudioModal();
|
|
|
|
openVideoPreviewModal();
|
|
|
|
didMountAutoJoin = true;
|
|
|
|
} else if (!(
|
|
|
|
userSelectedMicrophone
|
|
|
|
&& userSelectedListenOnly
|
|
|
|
&& meetingIsBreakout)) {
|
|
|
|
openAudioModal();
|
|
|
|
didMountAutoJoin = true;
|
|
|
|
}
|
|
|
|
return Promise.resolve(true);
|
|
|
|
};
|
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
const { hasBreakoutRooms: hadBreakoutRooms } = prevProps || {};
|
|
|
|
const userIsReturningFromBreakoutRoom = hadBreakoutRooms && !hasBreakoutRooms;
|
|
|
|
|
2024-06-22 05:45:05 +08:00
|
|
|
const { data: currentUser } = useCurrentUser((u) => ({ userId: u.userId }));
|
|
|
|
const { data: unmutedUsers } = useWhoIsUnmuted();
|
2024-06-28 01:31:20 +08:00
|
|
|
const currentUserMuted = currentUser?.userId && !unmutedUsers[currentUser.userId];
|
2024-05-29 21:26:11 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
const joinAudio = () => {
|
|
|
|
if (Service.isConnected()) return;
|
|
|
|
|
|
|
|
if (userSelectedMicrophone) {
|
2024-06-05 19:26:27 +08:00
|
|
|
joinMicrophone({ skipEchoTest: true });
|
2024-02-17 04:32:14 +08:00
|
|
|
return;
|
|
|
|
}
|
2018-01-10 06:07:29 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
if (userSelectedListenOnly) joinListenOnly();
|
|
|
|
};
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
useEffect(() => {
|
2024-06-13 23:00:30 +08:00
|
|
|
// Data is not loaded yet.
|
2024-06-13 23:01:34 +08:00
|
|
|
// We don't know whether the meeting is a breakout or not.
|
2024-06-13 23:00:30 +08:00
|
|
|
// So, postpone the decision.
|
|
|
|
if (meetingIsBreakout === undefined) return;
|
|
|
|
|
2024-06-29 03:58:38 +08:00
|
|
|
init().then(() => {
|
2021-11-10 02:04:10 +08:00
|
|
|
if (meetingIsBreakout && !Service.isUsingAudio()) {
|
2024-02-17 04:32:14 +08:00
|
|
|
joinAudio();
|
2021-11-10 02:04:10 +08:00
|
|
|
}
|
|
|
|
});
|
2024-06-13 23:00:30 +08:00
|
|
|
}, [meetingIsBreakout]);
|
2020-03-03 04:49:15 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
useEffect(() => {
|
|
|
|
if (userIsReturningFromBreakoutRoom) {
|
|
|
|
joinAudio();
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
}
|
2024-02-17 04:32:14 +08:00
|
|
|
}, [userIsReturningFromBreakoutRoom]);
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
if (Service.isConnected() && !Service.isListenOnly()) {
|
|
|
|
Service.updateAudioConstraints(microphoneConstraints);
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
|
2024-05-29 21:26:11 +08:00
|
|
|
if (userLocks.userMic && !currentUserMuted) {
|
|
|
|
toggleMuteMicrophone(!currentUserMuted, toggleVoice);
|
2024-02-17 04:32:14 +08:00
|
|
|
notify(intl.formatMessage(intlMessages.reconectingAsListener), 'info', 'volume_level_2');
|
2020-03-03 04:49:15 +08:00
|
|
|
}
|
2018-01-10 06:07:29 +08:00
|
|
|
}
|
|
|
|
|
2024-02-17 04:32:14 +08:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{isAudioModalOpen ? (
|
|
|
|
<AudioModalContainer
|
|
|
|
{...{
|
|
|
|
priority: 'low',
|
|
|
|
setIsOpen: setAudioModalIsOpen,
|
|
|
|
isOpen: isAudioModalOpen,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
) : null}
|
|
|
|
{isVideoPreviewModalOpen ? (
|
|
|
|
<VideoPreviewContainer
|
|
|
|
{...{
|
|
|
|
callbackToClose: () => {
|
|
|
|
setVideoPreviewModalIsOpen(false);
|
|
|
|
},
|
|
|
|
priority: 'low',
|
|
|
|
setIsOpen: setVideoPreviewModalIsOpen,
|
|
|
|
isOpen: isVideoPreviewModalOpen,
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
) : null}
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2017-05-04 05:39:07 +08:00
|
|
|
|
2024-06-13 21:54:46 +08:00
|
|
|
export default lockContextContainer(injectIntl(AudioContainer));
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
|
|
|
|
AudioContainer.propTypes = {
|
2024-02-17 04:32:14 +08:00
|
|
|
isAudioModalOpen: PropTypes.bool.isRequired,
|
|
|
|
setAudioModalIsOpen: PropTypes.func.isRequired,
|
|
|
|
setVideoPreviewModalIsOpen: PropTypes.func.isRequired,
|
|
|
|
isVideoPreviewModalOpen: PropTypes.bool.isRequired,
|
|
|
|
intl: PropTypes.shape({
|
|
|
|
formatMessage: PropTypes.func.isRequired,
|
|
|
|
}).isRequired,
|
|
|
|
userLocks: PropTypes.shape({
|
|
|
|
userMic: PropTypes.bool.isRequired,
|
|
|
|
}).isRequired,
|
2024-06-13 21:54:46 +08:00
|
|
|
speechLocale: PropTypes.string.isRequired,
|
fix: breakout autojoin audio with wrong behavior
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.
2021-04-21 01:38:11 +08:00
|
|
|
};
|