Skip to content
Snippets Groups Projects
Commit 636f49cd authored by KDSBrowne's avatar KDSBrowne
Browse files

add error messages for getUserMedia failing with mic

parent b4c5d2cc
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,7 @@ class AudioModal extends Component { ...@@ -124,6 +124,7 @@ class AudioModal extends Component {
this.state = { this.state = {
content: null, content: null,
hasError: false, hasError: false,
errCode: null,
}; };
this.handleGoToAudioOptions = this.handleGoToAudioOptions.bind(this); this.handleGoToAudioOptions = this.handleGoToAudioOptions.bind(this);
...@@ -250,6 +251,7 @@ class AudioModal extends Component { ...@@ -250,6 +251,7 @@ class AudioModal extends Component {
if (err.type === 'MEDIA_ERROR') { if (err.type === 'MEDIA_ERROR') {
this.setState({ this.setState({
content: 'help', content: 'help',
errCode: err.code,
}); });
} }
}); });
...@@ -441,9 +443,12 @@ class AudioModal extends Component { ...@@ -441,9 +443,12 @@ class AudioModal extends Component {
} }
renderHelp() { renderHelp() {
const { errCode } = this.state;
return ( return (
<Help <Help
handleBack={this.handleGoToAudioOptions} handleBack={this.handleGoToAudioOptions}
errCode={errCode}
/> />
); );
} }
......
...@@ -11,34 +11,57 @@ const intlMessages = defineMessages({ ...@@ -11,34 +11,57 @@ const intlMessages = defineMessages({
backLabel: { backLabel: {
id: 'app.audio.backLabel', id: 'app.audio.backLabel',
description: 'audio settings back button label', description: 'audio settings back button label',
} },
}) noSSL: {
id: 'app.audioModal.help.noSSL',
description: 'Text decription for domain not using https',
},
macNotAllowed: {
id: 'app.audioModal.help.macNotAllowed',
description: 'Text decription for mac needed to enable OS setting',
},
});
class Help extends Component { class Help extends Component {
render() { render() {
const { const {
intl, intl,
handleBack, handleBack,
errCode,
} = this.props; } = this.props;
let helpMessage = null;
switch (errCode) {
case 2:
helpMessage = intl.formatMessage(intlMessages.noSSL);
break;
case 3:
helpMessage = intl.formatMessage(intlMessages.macNotAllowed);
break;
default:
helpMessage = intl.formatMessage(intlMessages.descriptionHelp);
break;
}
return ( return (
<span className={styles.help}> <span className={styles.help}>
<div className={styles.text}> <div className={styles.text}>
{ intl.formatMessage(intlMessages.descriptionHelp) } { helpMessage }
</div> </div>
<div className={styles.enterAudio}> <div className={styles.enterAudio}>
<Button <Button
className={styles.backBtn} className={styles.backBtn}
label={intl.formatMessage(intlMessages.backLabel)} label={intl.formatMessage(intlMessages.backLabel)}
size={'md'} size="md"
color={'primary'} color="primary"
onClick={handleBack} onClick={handleBack}
ghost ghost
/> />
</div> </div>
</span> </span>
) );
} }
}; }
export default injectIntl(Help); export default injectIntl(Help);
...@@ -432,9 +432,19 @@ class AudioManager { ...@@ -432,9 +432,19 @@ class AudioManager {
errorMessage: error.message, errorMessage: error.message,
}, },
}, `Error getting microphone - {${error.name}: ${error.message}}`); }, `Error getting microphone - {${error.name}: ${error.message}}`);
const disabledSysSetting = error.message.includes('Permission denied by system');
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;
return Promise.reject({ return Promise.reject({
type: 'MEDIA_ERROR', type: 'MEDIA_ERROR',
message: this.messages.error.MEDIA_ERROR, message: this.messages.error.MEDIA_ERROR,
code,
}); });
}; };
......
...@@ -398,6 +398,8 @@ ...@@ -398,6 +398,8 @@
"app.audioModal.settingsTitle": "Change your audio settings", "app.audioModal.settingsTitle": "Change your audio settings",
"app.audioModal.helpTitle": "There was an issue with your media devices", "app.audioModal.helpTitle": "There was an issue with your media devices",
"app.audioModal.helpText": "Did you give permission for access to your microphone? Note that a dialog should appear when you try to join audio, asking for your media device permissions, please accept that in order to join the audio conference. If that is not the case, try changing your microphone permissions in your browser's settings.", "app.audioModal.helpText": "Did you give permission for access to your microphone? Note that a dialog should appear when you try to join audio, asking for your media device permissions, please accept that in order to join the audio conference. If that is not the case, try changing your microphone permissions in your browser's settings.",
"app.audioModal.help.noSSL": "The webpage must use HTTPS for microphone access to work. Please contact the administrator of your website",
"app.audioModal.help.macNotAllowed": "Check in your Mac system preferences > Security & Privacy > Privacy > Microphone, that it's checked.",
"app.audioModal.audioDialTitle": "Join using your phone", "app.audioModal.audioDialTitle": "Join using your phone",
"app.audioDial.audioDialDescription": "Dial", "app.audioDial.audioDialDescription": "Dial",
"app.audioDial.audioDialConfrenceText": "and enter the conference PIN number:", "app.audioDial.audioDialConfrenceText": "and enter the conference PIN number:",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment