diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx index 005b7ea0abbd9011865e52416b98690bf26576de..06dae909d2ccc6a9baf4a32919167da260b28c78 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/component.jsx @@ -444,11 +444,17 @@ class AudioModal extends Component { renderHelp() { const { errCode } = this.state; + const { AudioError } = this.props; + + const audioErr = { + ...AudioError, + code: errCode, + }; return ( <Help handleBack={this.handleGoToAudioOptions} - errCode={errCode} + audioErr={audioErr} /> ); } diff --git a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx index 94b88889a3a87d7b965dfd08565c9c8c9851b0d3..13e433567500a57d17c0661b92c1f8a0ecc847c3 100755 --- a/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/audio-modal/container.jsx @@ -8,6 +8,7 @@ import Meetings from '/imports/api/meetings'; import Auth from '/imports/ui/services/auth'; import deviceInfo from '/imports/utils/deviceInfo'; import lockContextContainer from '/imports/ui/components/lock-viewers/context/container'; +import AudioError from '/imports/ui/services/audio-manager/error-codes'; import Service from '../service'; const AudioModalContainer = props => <AudioModal {...props} />; @@ -17,7 +18,6 @@ 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(({ mountModal, userLocks }) => { const listenOnlyMode = getFromUserSettings('listenOnlyMode', APP_CONFIG.listenOnlyMode); const forceListenOnly = getFromUserSettings('forceListenOnly', APP_CONFIG.forceListenOnly); @@ -106,5 +106,6 @@ export default lockContextContainer(withModalMounter(withTracker(({ mountModal, autoplayBlocked: Service.autoplayBlocked(), handleAllowAutoplay: () => Service.handleAllowAutoplay(), isRTL, + AudioError, }); })(AudioModalContainer))); diff --git a/bigbluebutton-html5/imports/ui/components/audio/help/component.jsx b/bigbluebutton-html5/imports/ui/components/audio/help/component.jsx index e6ddb92eb6d1dd8caea4927a3a3b5517a67f5d4c..4bdc51681e586c12aa5d76ad3a39d188b9ce8338 100644 --- a/bigbluebutton-html5/imports/ui/components/audio/help/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/audio/help/component.jsx @@ -27,18 +27,21 @@ class Help extends Component { const { intl, handleBack, - errCode, + audioErr, } = this.props; + const { code, MIC_ERROR } = audioErr; + let helpMessage = null; - switch (errCode) { - case 2: + switch (code) { + case MIC_ERROR.NO_SSL: helpMessage = intl.formatMessage(intlMessages.noSSL); break; - case 3: + case MIC_ERROR.MAC_OS_BLOCK: helpMessage = intl.formatMessage(intlMessages.macNotAllowed); break; + case MIC_ERROR.NO_PERMISSION: default: helpMessage = intl.formatMessage(intlMessages.descriptionHelp); break; diff --git a/bigbluebutton-html5/imports/ui/services/audio-manager/error-codes.js b/bigbluebutton-html5/imports/ui/services/audio-manager/error-codes.js new file mode 100644 index 0000000000000000000000000000000000000000..7e8fede881bded9620fd07e365f7465efc8f0f66 --- /dev/null +++ b/bigbluebutton-html5/imports/ui/services/audio-manager/error-codes.js @@ -0,0 +1,7 @@ +const MIC_ERROR = { + NO_SSL: 9, + MAC_OS_BLOCK: 8, + NO_PERMISSION: 7, +}; + +export default { MIC_ERROR }; diff --git a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js index 5a717942c9a352750405596c6a9ad8857e141ed0..3611daebd7829b9e85b2411444cc3102110b1316 100755 --- a/bigbluebutton-html5/imports/ui/services/audio-manager/index.js +++ b/bigbluebutton-html5/imports/ui/services/audio-manager/index.js @@ -6,9 +6,10 @@ import SIPBridge from '/imports/api/audio/client/bridge/sip'; import logger from '/imports/startup/client/logger'; import { notify } from '/imports/ui/services/notification'; import browser from 'browser-detect'; +import playAndRetry from '/imports/utils/mediaElementPlayRetry'; import iosWebviewAudioPolyfills from '../../../utils/ios-webview-audio-polyfills'; import { tryGenerateIceCandidates } from '../../../utils/safari-webrtc'; -import playAndRetry from '/imports/utils/mediaElementPlayRetry'; +import AudioErrors from './error-codes'; const MEDIA = Meteor.settings.public.media; const MEDIA_TAG = MEDIA.mediaTag; @@ -433,13 +434,14 @@ class AudioManager { }, }, `Error getting microphone - {${error.name}: ${error.message}}`); + const { MIC_ERROR } = AudioErrors; const disabledSysSetting = error.message.includes('Permission denied by system'); - const isMac = navigator.platform.indexOf('Mac') != -1; + const isMac = navigator.platform.indexOf('Mac') !== -1; const noSSL = !window.location.protocol.includes('https'); - let code = 1; - if (noSSL) code = 2; - if (isMac && disabledSysSetting) code = 3; + let code = MIC_ERROR.NO_PERMISSION; + if (noSSL) code = MIC_ERROR.NO_SSL; + if (isMac && disabledSysSetting) code = MIC_ERROR.MAC_OS_BLOCK; return Promise.reject({ type: 'MEDIA_ERROR',