2019-08-23 04:08:24 +08:00
|
|
|
import React, { PureComponent } from 'react';
|
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';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2019-04-19 04:29:06 +08:00
|
|
|
import { Session } from 'meteor/session';
|
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';
|
2023-02-18 01:09:07 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2017-11-22 21:11:21 +08:00
|
|
|
import Breakouts from '/imports/api/breakouts';
|
2020-03-03 04:49:15 +08:00
|
|
|
import AppService from '/imports/ui/components/app/service';
|
2023-02-18 01:09:07 +08:00
|
|
|
import BreakoutsService from '/imports/ui/components/breakout-room/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,
|
|
|
|
didUserSelectedMicrophone,
|
|
|
|
didUserSelectedListenOnly,
|
|
|
|
} 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';
|
2021-01-23 03:30:42 +08:00
|
|
|
import Settings from '/imports/ui/services/settings';
|
2017-03-28 04:40:44 +08:00
|
|
|
|
2019-09-05 02:32:58 +08:00
|
|
|
const APP_CONFIG = Meteor.settings.public.app;
|
|
|
|
const KURENTO_CONFIG = Meteor.settings.public.kurento;
|
|
|
|
|
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',
|
|
|
|
description: 'browser not supported error messsage',
|
|
|
|
},
|
2018-07-10 03:23:16 +08:00
|
|
|
reconectingAsListener: {
|
|
|
|
id: 'app.audioNotificaion.reconnectingAsListenOnly',
|
|
|
|
description: 'ice negociation error messsage',
|
|
|
|
},
|
2017-10-19 03:40:01 +08:00
|
|
|
});
|
|
|
|
|
2019-08-23 04:08:24 +08:00
|
|
|
class AudioContainer extends PureComponent {
|
2018-01-10 06:07:29 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this.init = props.init.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
componentDidMount() {
|
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
|
|
|
const { meetingIsBreakout } = this.props;
|
|
|
|
|
2021-11-10 02:04:10 +08:00
|
|
|
this.init().then(() => {
|
|
|
|
if (meetingIsBreakout && !Service.isUsingAudio()) {
|
|
|
|
this.joinAudio();
|
|
|
|
}
|
|
|
|
});
|
2020-03-03 04:49:15 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps) {
|
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
|
|
|
if (this.userIsReturningFromBreakoutRoom(prevProps)) {
|
|
|
|
this.joinAudio();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function to determine wheter user is returning from breakout room
|
|
|
|
* to main room.
|
2023-03-13 22:13:56 +08:00
|
|
|
* @param {Object} prevProps prevProps param from componentDidUpdate
|
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
|
|
|
* @return {boolean} True if user is returning from breakout room
|
|
|
|
* to main room. False, otherwise.
|
|
|
|
*/
|
|
|
|
userIsReturningFromBreakoutRoom(prevProps) {
|
|
|
|
const { hasBreakoutRooms } = this.props;
|
2021-03-01 02:14:35 +08:00
|
|
|
const { hasBreakoutRooms: hadBreakoutRooms } = prevProps;
|
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
|
|
|
return hadBreakoutRooms && !hasBreakoutRooms;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Helper function that join (or not) user in audio. If user previously
|
|
|
|
* selected microphone, it will automatically join mic (without audio modal).
|
|
|
|
* If user previously selected listen only option in audio modal, then it will
|
|
|
|
* automatically join listen only.
|
|
|
|
*/
|
|
|
|
joinAudio() {
|
|
|
|
if (Service.isConnected()) return;
|
|
|
|
|
|
|
|
const {
|
|
|
|
userSelectedMicrophone,
|
|
|
|
userSelectedListenOnly,
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
if (userSelectedMicrophone) {
|
|
|
|
joinMicrophone(true);
|
|
|
|
return;
|
2020-03-03 04:49:15 +08:00
|
|
|
}
|
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
|
|
|
|
|
|
|
if (userSelectedListenOnly) joinListenOnly();
|
2018-01-10 06:07:29 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
2023-03-27 23:36:25 +08:00
|
|
|
const { isAudioModalOpen, setAudioModalIsOpen,
|
|
|
|
setVideoPreviewModalIsOpen, isVideoPreviewModalOpen } = this.props;
|
|
|
|
return <>
|
|
|
|
{isAudioModalOpen ? <AudioModalContainer
|
|
|
|
{...{
|
2023-03-29 22:08:56 +08:00
|
|
|
priority: "low",
|
2023-03-27 23:36:25 +08:00
|
|
|
setIsOpen: setAudioModalIsOpen,
|
|
|
|
isOpen: isAudioModalOpen
|
|
|
|
}}
|
|
|
|
/> : null}
|
|
|
|
{isVideoPreviewModalOpen ? <VideoPreviewContainer
|
|
|
|
{...{
|
2023-03-29 22:08:56 +08:00
|
|
|
priority: "low",
|
2023-03-27 23:36:25 +08:00
|
|
|
setIsOpen: setVideoPreviewModalIsOpen,
|
|
|
|
isOpen: isVideoPreviewModalOpen
|
|
|
|
}}
|
|
|
|
/> : null}
|
|
|
|
</>;
|
2018-01-10 06:07:29 +08:00
|
|
|
}
|
|
|
|
}
|
2017-05-04 05:39:07 +08:00
|
|
|
|
2017-08-15 03:19:35 +08:00
|
|
|
let didMountAutoJoin = false;
|
2017-08-05 04:33:25 +08:00
|
|
|
|
2023-02-22 01:57:34 +08:00
|
|
|
const webRtcError = range(1001, 1011)
|
2019-09-05 02:32:58 +08:00
|
|
|
.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,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2023-03-27 23:36:25 +08:00
|
|
|
export default lockContextContainer(injectIntl(withTracker(({ intl, userLocks, isAudioModalOpen, setAudioModalIsOpen,
|
|
|
|
setVideoPreviewModalIsOpen, isVideoPreviewModalOpen }) => {
|
2021-01-23 03:30:42 +08:00
|
|
|
const { microphoneConstraints } = Settings.application;
|
2019-07-22 22:28:13 +08:00
|
|
|
const autoJoin = getFromUserSettings('bbb_auto_join_audio', APP_CONFIG.autoJoin);
|
2020-05-02 00:09:29 +08:00
|
|
|
const enableVideo = getFromUserSettings('bbb_enable_video', KURENTO_CONFIG.enableVideo);
|
|
|
|
const autoShareWebcam = getFromUserSettings('bbb_auto_share_webcam', KURENTO_CONFIG.autoShareWebcam);
|
2019-06-12 02:04:47 +08:00
|
|
|
const { userWebcam, userMic } = userLocks;
|
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
|
|
|
|
|
|
|
const userSelectedMicrophone = didUserSelectedMicrophone();
|
|
|
|
const userSelectedListenOnly = didUserSelectedListenOnly();
|
2020-03-03 04:49:15 +08:00
|
|
|
const meetingIsBreakout = AppService.meetingIsBreakout();
|
|
|
|
const hasBreakoutRooms = AppService.getBreakoutRooms().length > 0;
|
2023-03-24 23:29:09 +08:00
|
|
|
const openAudioModal = () => setAudioModalIsOpen(true);
|
2019-05-08 03:49:32 +08:00
|
|
|
|
2023-03-27 23:36:25 +08:00
|
|
|
const openVideoPreviewModal = () => {
|
|
|
|
if (userWebcam) return;
|
|
|
|
setVideoPreviewModalIsOpen(true);
|
|
|
|
};
|
2021-01-23 03:30:42 +08:00
|
|
|
|
|
|
|
if (Service.isConnected() && !Service.isListenOnly()) {
|
|
|
|
Service.updateAudioConstraints(microphoneConstraints);
|
|
|
|
|
|
|
|
if (userMic && !Service.isMuted()) {
|
|
|
|
Service.toggleMuteMicrophone();
|
2021-10-19 04:26:01 +08:00
|
|
|
notify(intl.formatMessage(intlMessages.reconectingAsListener), 'info', 'volume_level_2');
|
2021-01-23 03:30:42 +08:00
|
|
|
}
|
2018-07-10 03:23:16 +08:00
|
|
|
}
|
2023-02-18 01:09:07 +08:00
|
|
|
const breakoutUserIsIn = BreakoutsService.getBreakoutUserIsIn(Auth.userID);
|
|
|
|
if(!!breakoutUserIsIn && !meetingIsBreakout) {
|
|
|
|
const userBreakout = Breakouts.find({id: breakoutUserIsIn.id})
|
|
|
|
userBreakout.observeChanges({
|
|
|
|
removed() {
|
|
|
|
// if the user joined a breakout room, the main room's audio was
|
|
|
|
// programmatically dropped to avoid interference. On breakout end,
|
|
|
|
// offer to rejoin main room audio only if the user is not in audio already
|
|
|
|
if (Service.isUsingAudio()
|
|
|
|
|| userSelectedMicrophone
|
|
|
|
|| userSelectedListenOnly) {
|
|
|
|
if (enableVideo && autoShareWebcam) {
|
|
|
|
openVideoPreviewModal();
|
|
|
|
}
|
2017-11-01 00:46:14 +08:00
|
|
|
|
2023-02-18 01:09:07 +08:00
|
|
|
return;
|
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
|
|
|
}
|
2023-03-24 23:29:09 +08:00
|
|
|
setTimeout(() => {
|
|
|
|
openAudioModal();
|
|
|
|
if (enableVideo && autoShareWebcam) {
|
|
|
|
openVideoPreviewModal();
|
2023-02-18 01:09:07 +08:00
|
|
|
}
|
2023-03-24 23:29:09 +08:00
|
|
|
}, 0);
|
2023-02-18 01:09:07 +08:00
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
2017-08-04 20:24:57 +08:00
|
|
|
|
2017-03-28 04:40:44 +08:00
|
|
|
return {
|
2020-03-03 04:49:15 +08:00
|
|
|
hasBreakoutRooms,
|
|
|
|
meetingIsBreakout,
|
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
|
|
|
userSelectedMicrophone,
|
|
|
|
userSelectedListenOnly,
|
2023-03-24 23:29:09 +08:00
|
|
|
isAudioModalOpen,
|
|
|
|
setAudioModalIsOpen,
|
2021-11-10 02:04:10 +08:00
|
|
|
init: async () => {
|
|
|
|
await Service.init(messages, intl);
|
2019-07-25 01:04:46 +08:00
|
|
|
const enableVideo = getFromUserSettings('bbb_enable_video', KURENTO_CONFIG.enableVideo);
|
2019-07-22 22:28:13 +08:00
|
|
|
const autoShareWebcam = getFromUserSettings('bbb_auto_share_webcam', KURENTO_CONFIG.autoShareWebcam);
|
2020-03-03 04:49:15 +08:00
|
|
|
if ((!autoJoin || didMountAutoJoin)) {
|
2019-08-23 04:08:24 +08:00
|
|
|
if (enableVideo && autoShareWebcam) {
|
|
|
|
openVideoPreviewModal();
|
|
|
|
}
|
2021-11-10 02:04:10 +08:00
|
|
|
return Promise.resolve(false);
|
2019-08-23 04:08:24 +08:00
|
|
|
}
|
|
|
|
Session.set('audioModalIsOpen', true);
|
2018-11-16 03:38:04 +08:00
|
|
|
if (enableVideo && autoShareWebcam) {
|
2023-03-24 23:29:09 +08:00
|
|
|
openAudioModal()
|
|
|
|
openVideoPreviewModal();
|
|
|
|
didMountAutoJoin = true;
|
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
|
|
|
} else if (!(
|
|
|
|
userSelectedMicrophone
|
|
|
|
&& userSelectedListenOnly
|
|
|
|
&& meetingIsBreakout)) {
|
2018-11-16 03:38:04 +08:00
|
|
|
openAudioModal();
|
|
|
|
didMountAutoJoin = true;
|
|
|
|
}
|
2021-11-10 02:04:10 +08:00
|
|
|
return Promise.resolve(true);
|
2017-05-02 03:52:57 +08:00
|
|
|
},
|
2017-03-28 04:40:44 +08:00
|
|
|
};
|
2023-03-24 23:29:09 +08:00
|
|
|
})(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 = {
|
|
|
|
hasBreakoutRooms: PropTypes.bool.isRequired,
|
|
|
|
meetingIsBreakout: PropTypes.bool.isRequired,
|
|
|
|
userSelectedListenOnly: PropTypes.bool.isRequired,
|
|
|
|
userSelectedMicrophone: PropTypes.bool.isRequired,
|
|
|
|
};
|