Merge pull request #5840 from Tainan404/issue-5833

Comply audio lock setting.
This commit is contained in:
Anton Georgiev 2018-07-12 14:38:19 -04:00 committed by GitHub
commit f50cf96100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 0 deletions

View File

@ -273,6 +273,7 @@ class AudioModal extends Component {
listenOnlyMode,
forceListenOnlyAttendee,
skipCheck,
audioLocked,
} = this.props;
return (
@ -284,6 +285,7 @@ class AudioModal extends Component {
icon="unmute"
circle
size="jumbo"
disabled={audioLocked}
onClick={skipCheck ? this.handleJoinMicrophone : this.handleGoToEchoTest}
/>
: null}

View File

@ -53,6 +53,7 @@ export default withModalMounter(withTracker(({ mountModal }) =>
showPermissionsOvelay: Service.isWaitingPermissions(),
listenOnlyMode,
skipCheck,
audioLocked: Service.audioLocked(),
joinFullAudioImmediately: !listenOnlyMode && skipCheck,
joinFullAudioEchoTest: !listenOnlyMode && !skipCheck,
forceListenOnlyAttendee: listenOnlyMode && forceListenOnly && !Service.isUserModerator(),

View File

@ -4,6 +4,7 @@ import { withModalMounter } from '/imports/ui/components/modal/service';
import { injectIntl, defineMessages } from 'react-intl';
import _ from 'lodash';
import Breakouts from '/imports/api/breakouts';
import { notify } from '/imports/ui/services/notification';
import Service from './service';
import AudioModalContainer from './audio-modal/container';
@ -48,6 +49,10 @@ const intlMessages = defineMessages({
id: 'app.audioNotification.audioFailedError1007',
description: 'ice negociation error messsage',
},
reconectingAsListener: {
id: 'app.audioNotificaion.reconnectingAsListenOnly',
description: 'ice negociation error messsage',
},
});
@ -77,6 +82,11 @@ export default withModalMounter(injectIntl(withTracker(({ mountModal, intl }) =>
null,
<AudioModalContainer />,
);
if (Service.audioLocked() && Service.isConnected() && !Service.isListenOnly()) {
Service.exitAudio();
notify(intl.formatMessage(intlMessages.reconectingAsListener), 'info', 'audio_on');
Service.joinListenOnly();
}
Breakouts.find().observeChanges({
removed() {

View File

@ -2,6 +2,7 @@ import Users from '/imports/api/users';
import Auth from '/imports/ui/services/auth';
import AudioManager from '/imports/ui/services/audio-manager';
import Meetings from '/imports/api/meetings';
import mapUser from '/imports/ui/services/user/mapUser';
const init = (messages) => {
AudioManager.setAudioMessages(messages);
@ -29,6 +30,17 @@ const init = (messages) => {
AudioManager.init(userData);
};
const audioLocked = () => {
const userId = Auth.userID;
const User = mapUser(Users.findOne({ userId }));
const Meeting = Meetings.findOne({ meetingId: Auth.meetingID });
const lockSetting = Meeting.lockSettingProps;
const audioLock = lockSetting ? lockSetting.disableMic : false;
return audioLock && User.isLocked;
};
export default {
init,
exitAudio: () => AudioManager.exitAudio(),
@ -52,4 +64,5 @@ export default {
isEchoTest: () => AudioManager.isEchoTest,
error: () => AudioManager.error,
isUserModerator: () => Users.findOne({ userId: Auth.userID }).moderator,
audioLocked,
};

View File

@ -236,6 +236,7 @@
"app.audioNotification.audioFailedMessage": "Your audio connection failed to connect",
"app.audioNotification.mediaFailedMessage": "getUserMicMedia failed, Only secure origins are allowed",
"app.audioNotification.closeLabel": "Close",
"app.audioNotificaion.reconnectingAsListenOnly": "Audio has been locked for moderators only, you are being connected as listen only",
"app.breakoutJoinConfirmation.title": "Join Breakout Room",
"app.breakoutJoinConfirmation.message": "Do you want to join",
"app.breakoutJoinConfirmation.confirmLabel": "Join",