2017-09-26 04:28:36 +08:00
|
|
|
import React, { Component } from 'react';
|
2017-10-11 02:03:29 +08:00
|
|
|
import PropTypes from 'prop-types';
|
2019-03-29 05:53:42 +08:00
|
|
|
import cx from 'classnames';
|
2018-12-03 14:01:19 +08:00
|
|
|
import Modal from '/imports/ui/components/modal/simple/component';
|
2017-09-26 04:28:36 +08:00
|
|
|
import Button from '/imports/ui/components/button/component';
|
2019-03-29 05:53:42 +08:00
|
|
|
import {
|
|
|
|
defineMessages, injectIntl, intlShape, FormattedMessage,
|
|
|
|
} from 'react-intl';
|
2018-01-08 14:17:18 +08:00
|
|
|
import { styles } from './styles';
|
2017-11-09 02:41:15 +08:00
|
|
|
import PermissionsOverlay from '../permissions-overlay/component';
|
2017-03-25 00:01:35 +08:00
|
|
|
import AudioSettings from '../audio-settings/component';
|
2017-10-04 04:42:10 +08:00
|
|
|
import EchoTest from '../echo-test/component';
|
2017-11-17 19:52:48 +08:00
|
|
|
import Help from '../help/component';
|
2019-04-11 04:51:06 +08:00
|
|
|
import AudioDial from '../audio-dial/component';
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2018-12-03 14:01:19 +08:00
|
|
|
|
2017-10-11 02:03:29 +08:00
|
|
|
const propTypes = {
|
|
|
|
intl: intlShape.isRequired,
|
|
|
|
closeModal: PropTypes.func.isRequired,
|
|
|
|
joinMicrophone: PropTypes.func.isRequired,
|
|
|
|
joinListenOnly: PropTypes.func.isRequired,
|
|
|
|
joinEchoTest: PropTypes.func.isRequired,
|
|
|
|
exitAudio: PropTypes.func.isRequired,
|
|
|
|
leaveEchoTest: PropTypes.func.isRequired,
|
|
|
|
changeInputDevice: PropTypes.func.isRequired,
|
|
|
|
changeOutputDevice: PropTypes.func.isRequired,
|
|
|
|
isEchoTest: PropTypes.bool.isRequired,
|
|
|
|
isConnecting: PropTypes.bool.isRequired,
|
|
|
|
isConnected: PropTypes.bool.isRequired,
|
2017-10-23 20:41:09 +08:00
|
|
|
inputDeviceId: PropTypes.string,
|
|
|
|
outputDeviceId: PropTypes.string,
|
2019-04-11 04:51:06 +08:00
|
|
|
dialNumber: PropTypes.string.isRequired,
|
|
|
|
telVoice: PropTypes.string.isRequired,
|
2019-04-16 00:39:36 +08:00
|
|
|
formattedDialNum: PropTypes.string.isRequired,
|
2018-03-02 20:01:34 +08:00
|
|
|
showPermissionsOvelay: PropTypes.bool.isRequired,
|
|
|
|
listenOnlyMode: PropTypes.bool.isRequired,
|
|
|
|
skipCheck: PropTypes.bool.isRequired,
|
2018-03-06 04:00:52 +08:00
|
|
|
joinFullAudioImmediately: PropTypes.bool.isRequired,
|
|
|
|
joinFullAudioEchoTest: PropTypes.bool.isRequired,
|
|
|
|
forceListenOnlyAttendee: PropTypes.bool.isRequired,
|
2017-10-23 20:41:09 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
const defaultProps = {
|
|
|
|
inputDeviceId: null,
|
|
|
|
outputDeviceId: null,
|
2017-10-11 02:03:29 +08:00
|
|
|
};
|
2017-09-26 04:28:36 +08:00
|
|
|
|
2017-10-11 02:03:29 +08:00
|
|
|
const intlMessages = defineMessages({
|
2017-09-26 04:28:36 +08:00
|
|
|
microphoneLabel: {
|
|
|
|
id: 'app.audioModal.microphoneLabel',
|
|
|
|
description: 'Join mic audio button label',
|
|
|
|
},
|
|
|
|
listenOnlyLabel: {
|
|
|
|
id: 'app.audioModal.listenOnlyLabel',
|
|
|
|
description: 'Join listen only audio button label',
|
|
|
|
},
|
|
|
|
closeLabel: {
|
|
|
|
id: 'app.audioModal.closeLabel',
|
|
|
|
description: 'close audio modal button label',
|
|
|
|
},
|
|
|
|
audioChoiceLabel: {
|
|
|
|
id: 'app.audioModal.audioChoiceLabel',
|
|
|
|
description: 'Join audio modal title',
|
|
|
|
},
|
2018-05-25 03:39:17 +08:00
|
|
|
iOSError: {
|
|
|
|
id: 'app.audioModal.iOSBrowser',
|
|
|
|
description: 'Audio/Video Not supported warning',
|
|
|
|
},
|
|
|
|
iOSErrorDescription: {
|
|
|
|
id: 'app.audioModal.iOSErrorDescription',
|
|
|
|
description: 'Audio/Video not supported description',
|
|
|
|
},
|
|
|
|
iOSErrorRecommendation: {
|
|
|
|
id: 'app.audioModal.iOSErrorRecommendation',
|
|
|
|
description: 'Audio/Video recommended action',
|
|
|
|
},
|
2017-10-11 02:03:29 +08:00
|
|
|
echoTestTitle: {
|
|
|
|
id: 'app.audioModal.echoTestTitle',
|
|
|
|
description: 'Title for the echo test',
|
|
|
|
},
|
|
|
|
settingsTitle: {
|
|
|
|
id: 'app.audioModal.settingsTitle',
|
|
|
|
description: 'Title for the audio modal',
|
|
|
|
},
|
2017-11-17 19:52:48 +08:00
|
|
|
helpTitle: {
|
|
|
|
id: 'app.audioModal.helpTitle',
|
|
|
|
description: 'Title for the audio help',
|
|
|
|
},
|
2019-04-11 04:51:06 +08:00
|
|
|
audioDialTitle: {
|
|
|
|
id: 'app.audioModal.audioDialTitle',
|
|
|
|
description: 'Title for the audio dial',
|
|
|
|
},
|
2017-10-11 02:03:29 +08:00
|
|
|
connecting: {
|
|
|
|
id: 'app.audioModal.connecting',
|
|
|
|
description: 'Message for audio connecting',
|
|
|
|
},
|
|
|
|
connectingEchoTest: {
|
|
|
|
id: 'app.audioModal.connectingEchoTest',
|
|
|
|
description: 'Message for echo test connecting',
|
|
|
|
},
|
2017-09-26 04:28:36 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
class AudioModal extends Component {
|
2016-11-16 05:00:28 +08:00
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
|
2017-09-26 04:28:36 +08:00
|
|
|
this.state = {
|
2017-10-11 02:03:29 +08:00
|
|
|
content: null,
|
2018-03-20 20:09:45 +08:00
|
|
|
hasError: false,
|
2017-09-26 04:28:36 +08:00
|
|
|
};
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2017-10-04 04:42:10 +08:00
|
|
|
this.handleGoToAudioOptions = this.handleGoToAudioOptions.bind(this);
|
2017-09-29 21:38:10 +08:00
|
|
|
this.handleGoToAudioSettings = this.handleGoToAudioSettings.bind(this);
|
2018-04-24 22:52:37 +08:00
|
|
|
this.handleRetryGoToEchoTest = this.handleRetryGoToEchoTest.bind(this);
|
2017-10-04 04:42:10 +08:00
|
|
|
this.handleGoToEchoTest = this.handleGoToEchoTest.bind(this);
|
2017-10-12 22:49:50 +08:00
|
|
|
this.handleJoinMicrophone = this.handleJoinMicrophone.bind(this);
|
2017-11-17 19:52:48 +08:00
|
|
|
this.handleJoinListenOnly = this.handleJoinListenOnly.bind(this);
|
2018-03-20 20:09:45 +08:00
|
|
|
this.skipAudioOptions = this.skipAudioOptions.bind(this);
|
2017-10-04 04:42:10 +08:00
|
|
|
|
|
|
|
this.contents = {
|
2017-10-11 02:03:29 +08:00
|
|
|
echoTest: {
|
2019-03-26 06:43:25 +08:00
|
|
|
title: intlMessages.echoTestTitle,
|
2017-10-11 02:03:29 +08:00
|
|
|
component: () => this.renderEchoTest(),
|
|
|
|
},
|
|
|
|
settings: {
|
2019-03-26 06:43:25 +08:00
|
|
|
title: intlMessages.settingsTitle,
|
2017-10-11 02:03:29 +08:00
|
|
|
component: () => this.renderAudioSettings(),
|
|
|
|
},
|
2017-11-17 19:52:48 +08:00
|
|
|
help: {
|
2019-03-26 06:43:25 +08:00
|
|
|
title: intlMessages.helpTitle,
|
2017-11-17 19:52:48 +08:00
|
|
|
component: () => this.renderHelp(),
|
2018-03-02 20:01:34 +08:00
|
|
|
},
|
2019-04-11 04:51:06 +08:00
|
|
|
audioDial: {
|
|
|
|
title: intlMessages.audioDialTitle,
|
|
|
|
component: () => this.renderAudioDial(),
|
|
|
|
},
|
2017-10-04 04:42:10 +08:00
|
|
|
};
|
2016-11-16 05:00:28 +08:00
|
|
|
}
|
|
|
|
|
2018-03-02 20:01:34 +08:00
|
|
|
componentWillMount() {
|
2018-03-06 04:00:52 +08:00
|
|
|
const {
|
|
|
|
joinFullAudioImmediately,
|
|
|
|
joinFullAudioEchoTest,
|
|
|
|
forceListenOnlyAttendee,
|
2019-01-24 00:06:14 +08:00
|
|
|
audioLocked,
|
2018-03-06 04:00:52 +08:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
if (joinFullAudioImmediately) {
|
2018-03-02 20:01:34 +08:00
|
|
|
this.handleJoinMicrophone();
|
|
|
|
}
|
2018-03-06 04:00:52 +08:00
|
|
|
|
|
|
|
if (joinFullAudioEchoTest) {
|
|
|
|
this.handleGoToEchoTest();
|
|
|
|
}
|
|
|
|
|
2019-01-24 00:06:14 +08:00
|
|
|
if (forceListenOnlyAttendee || audioLocked) {
|
2018-03-06 04:00:52 +08:00
|
|
|
this.handleJoinListenOnly();
|
|
|
|
}
|
2018-03-02 20:01:34 +08:00
|
|
|
}
|
|
|
|
|
2017-10-10 04:48:10 +08:00
|
|
|
componentWillUnmount() {
|
|
|
|
const {
|
|
|
|
isEchoTest,
|
2019-01-18 00:33:43 +08:00
|
|
|
exitAudio,
|
2017-10-10 04:48:10 +08:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
if (isEchoTest) {
|
2019-01-18 00:33:43 +08:00
|
|
|
exitAudio();
|
2017-10-10 04:48:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-04 04:42:10 +08:00
|
|
|
handleGoToAudioOptions() {
|
2017-09-26 04:28:36 +08:00
|
|
|
this.setState({
|
2017-10-04 04:42:10 +08:00
|
|
|
content: null,
|
2018-03-20 20:09:45 +08:00
|
|
|
hasError: true,
|
2017-09-26 04:28:36 +08:00
|
|
|
});
|
2016-11-16 05:00:28 +08:00
|
|
|
}
|
|
|
|
|
2017-09-29 21:38:10 +08:00
|
|
|
handleGoToAudioSettings() {
|
2019-01-18 00:33:43 +08:00
|
|
|
const { leaveEchoTest } = this.props;
|
|
|
|
leaveEchoTest().then(() => {
|
2017-10-05 04:49:11 +08:00
|
|
|
this.setState({
|
|
|
|
content: 'settings',
|
|
|
|
});
|
2017-10-10 04:48:10 +08:00
|
|
|
});
|
2017-10-04 04:42:10 +08:00
|
|
|
}
|
|
|
|
|
2018-04-24 22:52:37 +08:00
|
|
|
handleRetryGoToEchoTest() {
|
|
|
|
const { joinFullAudioImmediately } = this.props;
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
hasError: false,
|
|
|
|
content: null,
|
|
|
|
});
|
|
|
|
|
|
|
|
if (joinFullAudioImmediately) return this.joinMicrophone();
|
|
|
|
|
|
|
|
return this.handleGoToEchoTest();
|
|
|
|
}
|
|
|
|
|
2017-10-04 04:42:10 +08:00
|
|
|
handleGoToEchoTest() {
|
2017-11-17 19:52:48 +08:00
|
|
|
const {
|
|
|
|
inputDeviceId,
|
|
|
|
outputDeviceId,
|
2019-01-18 00:33:43 +08:00
|
|
|
joinEchoTest,
|
2017-11-17 19:52:48 +08:00
|
|
|
} = this.props;
|
|
|
|
|
2018-03-08 21:38:18 +08:00
|
|
|
this.setState({
|
2018-03-20 20:09:45 +08:00
|
|
|
hasError: false,
|
2018-03-08 21:38:18 +08:00
|
|
|
});
|
2018-03-06 04:00:52 +08:00
|
|
|
|
2019-01-18 00:33:43 +08:00
|
|
|
return joinEchoTest().then(() => {
|
2017-11-17 19:52:48 +08:00
|
|
|
console.log(inputDeviceId, outputDeviceId);
|
2017-10-05 04:49:11 +08:00
|
|
|
this.setState({
|
|
|
|
content: 'echoTest',
|
|
|
|
});
|
2018-03-02 20:01:34 +08:00
|
|
|
}).catch((err) => {
|
2017-11-17 19:52:48 +08:00
|
|
|
if (err.type === 'MEDIA_ERROR') {
|
|
|
|
this.setState({
|
|
|
|
content: 'help',
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
handleJoinListenOnly() {
|
|
|
|
const {
|
|
|
|
joinListenOnly,
|
|
|
|
} = this.props;
|
|
|
|
|
2018-03-02 20:01:34 +08:00
|
|
|
return joinListenOnly().catch((err) => {
|
2017-11-17 19:52:48 +08:00
|
|
|
if (err.type === 'MEDIA_ERROR') {
|
|
|
|
this.setState({
|
|
|
|
content: 'help',
|
|
|
|
});
|
|
|
|
}
|
2017-10-10 04:48:10 +08:00
|
|
|
});
|
2016-11-16 05:00:28 +08:00
|
|
|
}
|
|
|
|
|
2017-10-12 22:49:50 +08:00
|
|
|
handleJoinMicrophone() {
|
|
|
|
const {
|
|
|
|
joinMicrophone,
|
|
|
|
} = this.props;
|
|
|
|
|
2018-03-08 21:38:18 +08:00
|
|
|
this.setState({
|
2018-03-20 20:09:45 +08:00
|
|
|
hasError: false,
|
2018-03-08 21:38:18 +08:00
|
|
|
});
|
|
|
|
|
2017-10-12 22:49:50 +08:00
|
|
|
joinMicrophone().catch(this.handleGoToAudioOptions);
|
|
|
|
}
|
|
|
|
|
2018-03-20 20:09:45 +08:00
|
|
|
skipAudioOptions() {
|
|
|
|
const {
|
|
|
|
isConnecting,
|
|
|
|
joinFullAudioImmediately,
|
|
|
|
joinFullAudioEchoTest,
|
|
|
|
forceListenOnlyAttendee,
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
const {
|
|
|
|
content,
|
|
|
|
hasError,
|
|
|
|
} = this.state;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
2019-01-18 00:33:43 +08:00
|
|
|
isConnecting
|
|
|
|
|| forceListenOnlyAttendee
|
|
|
|
|| joinFullAudioImmediately
|
|
|
|
|| joinFullAudioEchoTest
|
2018-03-20 20:09:45 +08:00
|
|
|
) && !content && !hasError;
|
|
|
|
}
|
|
|
|
|
2017-09-26 04:28:36 +08:00
|
|
|
renderAudioOptions() {
|
|
|
|
const {
|
|
|
|
intl,
|
2018-03-02 20:01:34 +08:00
|
|
|
listenOnlyMode,
|
2018-03-06 04:00:52 +08:00
|
|
|
forceListenOnlyAttendee,
|
2018-03-08 21:38:18 +08:00
|
|
|
skipCheck,
|
2018-07-10 03:23:16 +08:00
|
|
|
audioLocked,
|
2019-02-01 01:17:03 +08:00
|
|
|
isMobileNative,
|
2019-03-29 05:53:42 +08:00
|
|
|
isIEOrEdge,
|
2019-04-11 04:51:06 +08:00
|
|
|
dialNumber,
|
2017-09-26 04:28:36 +08:00
|
|
|
} = this.props;
|
2016-11-16 05:00:28 +08:00
|
|
|
|
2019-01-24 00:06:14 +08:00
|
|
|
const showMicrophone = forceListenOnlyAttendee || audioLocked;
|
2019-04-16 00:39:36 +08:00
|
|
|
const showAudioDial = dialNumber !== '613-555-1212' && Number(dialNumber) !== 0 && dialNumber;
|
2019-01-24 00:06:14 +08:00
|
|
|
|
2017-09-26 04:28:36 +08:00
|
|
|
return (
|
2019-03-29 05:53:42 +08:00
|
|
|
<div>
|
|
|
|
<span className={styles.audioOptions}>
|
|
|
|
{!showMicrophone && !isMobileNative
|
|
|
|
? (
|
|
|
|
<Button
|
|
|
|
className={styles.audioBtn}
|
|
|
|
label={intl.formatMessage(intlMessages.microphoneLabel)}
|
|
|
|
icon="unmute"
|
|
|
|
circle
|
|
|
|
size="jumbo"
|
|
|
|
disabled={audioLocked}
|
|
|
|
onClick={skipCheck ? this.handleJoinMicrophone : this.handleGoToEchoTest}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
: null}
|
|
|
|
{listenOnlyMode
|
|
|
|
? (
|
|
|
|
<Button
|
|
|
|
className={styles.audioBtn}
|
|
|
|
label={intl.formatMessage(intlMessages.listenOnlyLabel)}
|
|
|
|
icon="listen"
|
|
|
|
circle
|
|
|
|
size="jumbo"
|
|
|
|
onClick={this.handleJoinListenOnly}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
: null}
|
|
|
|
</span>
|
|
|
|
{isIEOrEdge ? (
|
|
|
|
<p className={cx(styles.text, styles.browserWarning)}>
|
|
|
|
<FormattedMessage
|
|
|
|
id="app.audioModal.unsupportedBrowserLabel"
|
|
|
|
description="Warning when someone joins with a browser that isnt supported"
|
|
|
|
values={{
|
|
|
|
0: <a href="https://www.google.com/chrome/">Chrome</a>,
|
|
|
|
1: <a href="https://getfirefox.com">Firefox</a>,
|
|
|
|
}}
|
2019-01-18 00:33:43 +08:00
|
|
|
/>
|
2019-03-29 05:53:42 +08:00
|
|
|
</p>
|
2019-04-11 04:51:06 +08:00
|
|
|
) : null}
|
|
|
|
{showAudioDial ? (
|
|
|
|
<Button
|
|
|
|
className={styles.audioDial}
|
2019-04-16 00:39:36 +08:00
|
|
|
label={`${intl.formatMessage(intlMessages.audioDialTitle)}➔`}
|
2019-04-11 04:51:06 +08:00
|
|
|
size="md"
|
|
|
|
color="primary"
|
|
|
|
onClick={() => {
|
|
|
|
this.setState({
|
|
|
|
content: 'audioDial',
|
|
|
|
});
|
|
|
|
}}
|
|
|
|
ghost
|
|
|
|
/>
|
|
|
|
) : null}
|
2019-03-29 05:53:42 +08:00
|
|
|
</div>
|
2017-09-26 04:28:36 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-10-05 04:49:11 +08:00
|
|
|
renderContent() {
|
|
|
|
const {
|
|
|
|
isEchoTest,
|
2017-10-11 02:03:29 +08:00
|
|
|
intl,
|
2018-06-12 07:12:43 +08:00
|
|
|
isIOSChrome,
|
2017-10-05 04:49:11 +08:00
|
|
|
} = this.props;
|
|
|
|
|
2018-03-20 20:09:45 +08:00
|
|
|
const { content } = this.state;
|
2017-09-26 04:28:36 +08:00
|
|
|
|
2018-06-12 07:12:43 +08:00
|
|
|
if (isIOSChrome) {
|
2018-05-25 03:39:17 +08:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div className={styles.warning}>!</div>
|
|
|
|
<h4 className={styles.main}>{intl.formatMessage(intlMessages.iOSError)}</h4>
|
|
|
|
<div className={styles.text}>{intl.formatMessage(intlMessages.iOSErrorDescription)}</div>
|
2019-01-18 00:33:43 +08:00
|
|
|
<div className={styles.text}>
|
|
|
|
{intl.formatMessage(intlMessages.iOSErrorRecommendation)}
|
2018-05-25 03:39:17 +08:00
|
|
|
</div>
|
|
|
|
</div>);
|
|
|
|
}
|
2018-03-20 20:09:45 +08:00
|
|
|
if (this.skipAudioOptions()) {
|
2017-10-05 04:49:11 +08:00
|
|
|
return (
|
2018-09-01 00:58:47 +08:00
|
|
|
<div className={styles.connecting} role="alert">
|
|
|
|
<span>
|
2019-01-18 00:33:43 +08:00
|
|
|
{!isEchoTest
|
|
|
|
? intl.formatMessage(intlMessages.connecting)
|
|
|
|
: intl.formatMessage(intlMessages.connectingEchoTest)
|
2018-05-25 03:39:17 +08:00
|
|
|
}
|
2018-09-01 00:58:47 +08:00
|
|
|
</span>
|
|
|
|
<span className={styles.connectingAnimation} />
|
|
|
|
</div>
|
2017-10-11 02:03:29 +08:00
|
|
|
);
|
2017-10-05 04:49:11 +08:00
|
|
|
}
|
2017-10-11 02:03:29 +08:00
|
|
|
return content ? this.contents[content].component() : this.renderAudioOptions();
|
2017-10-05 04:49:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
renderEchoTest() {
|
2016-11-16 05:00:28 +08:00
|
|
|
return (
|
2017-10-05 04:49:11 +08:00
|
|
|
<EchoTest
|
|
|
|
handleNo={this.handleGoToAudioSettings}
|
2017-10-11 02:03:29 +08:00
|
|
|
handleYes={this.handleJoinMicrophone}
|
|
|
|
/>
|
2016-11-16 05:00:28 +08:00
|
|
|
);
|
|
|
|
}
|
2017-10-05 04:49:11 +08:00
|
|
|
|
2017-10-11 02:03:29 +08:00
|
|
|
renderAudioSettings() {
|
2017-10-05 04:49:11 +08:00
|
|
|
const {
|
|
|
|
isConnecting,
|
|
|
|
isConnected,
|
|
|
|
isEchoTest,
|
2017-10-11 02:03:29 +08:00
|
|
|
inputDeviceId,
|
|
|
|
outputDeviceId,
|
2019-01-18 00:33:43 +08:00
|
|
|
joinEchoTest,
|
|
|
|
changeInputDevice,
|
|
|
|
changeOutputDevice,
|
2017-10-05 04:49:11 +08:00
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<AudioSettings
|
|
|
|
handleBack={this.handleGoToAudioOptions}
|
2018-04-24 22:52:37 +08:00
|
|
|
handleRetry={this.handleRetryGoToEchoTest}
|
2019-01-18 00:33:43 +08:00
|
|
|
joinEchoTest={joinEchoTest}
|
|
|
|
changeInputDevice={changeInputDevice}
|
|
|
|
changeOutputDevice={changeOutputDevice}
|
2017-10-05 04:49:11 +08:00
|
|
|
isConnecting={isConnecting}
|
|
|
|
isConnected={isConnected}
|
|
|
|
isEchoTest={isEchoTest}
|
|
|
|
inputDeviceId={inputDeviceId}
|
2017-10-11 02:03:29 +08:00
|
|
|
outputDeviceId={outputDeviceId}
|
2017-10-05 04:49:11 +08:00
|
|
|
/>
|
2017-10-11 02:03:29 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-11-17 19:52:48 +08:00
|
|
|
renderHelp() {
|
|
|
|
return (
|
|
|
|
<Help
|
|
|
|
handleBack={this.handleGoToAudioOptions}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-04-11 04:51:06 +08:00
|
|
|
renderAudioDial() {
|
2019-04-16 00:39:36 +08:00
|
|
|
const { formattedDialNum, telVoice } = this.props;
|
2019-04-11 04:51:06 +08:00
|
|
|
return (
|
|
|
|
<AudioDial
|
2019-04-16 00:39:36 +08:00
|
|
|
formattedDialNum={formattedDialNum}
|
2019-04-11 04:51:06 +08:00
|
|
|
telVoice={telVoice}
|
|
|
|
handleBack={this.handleGoToAudioOptions}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2017-10-11 02:03:29 +08:00
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
intl,
|
2017-11-09 02:41:15 +08:00
|
|
|
showPermissionsOvelay,
|
2018-06-12 07:12:43 +08:00
|
|
|
isIOSChrome,
|
2019-01-18 00:33:43 +08:00
|
|
|
closeModal,
|
2017-10-11 02:03:29 +08:00
|
|
|
} = this.props;
|
|
|
|
|
2018-03-20 20:09:45 +08:00
|
|
|
const { content } = this.state;
|
2017-10-11 02:03:29 +08:00
|
|
|
|
|
|
|
return (
|
2017-11-09 02:41:15 +08:00
|
|
|
<span>
|
2018-05-25 03:39:17 +08:00
|
|
|
{showPermissionsOvelay ? <PermissionsOverlay /> : null}
|
2018-12-03 14:01:19 +08:00
|
|
|
<Modal
|
2017-11-09 02:41:15 +08:00
|
|
|
overlayClassName={styles.overlay}
|
|
|
|
className={styles.modal}
|
2019-01-18 00:33:43 +08:00
|
|
|
onRequestClose={closeModal}
|
2018-12-03 14:01:19 +08:00
|
|
|
hideBorder
|
2017-11-04 15:38:44 +08:00
|
|
|
>
|
2019-01-18 00:33:43 +08:00
|
|
|
{!this.skipAudioOptions()
|
|
|
|
|
|
|
|
? (
|
|
|
|
<header
|
|
|
|
data-test="audioModalHeader"
|
|
|
|
className={styles.header}
|
|
|
|
>
|
|
|
|
{
|
2019-04-11 04:51:06 +08:00
|
|
|
isIOSChrome ? null
|
|
|
|
: (
|
|
|
|
<h3 className={styles.title}>
|
|
|
|
{content
|
|
|
|
? intl.formatMessage(this.contents[content].title)
|
|
|
|
: intl.formatMessage(intlMessages.audioChoiceLabel)}
|
|
|
|
</h3>
|
|
|
|
)
|
|
|
|
}
|
2019-01-18 00:33:43 +08:00
|
|
|
</header>
|
|
|
|
)
|
2018-03-21 01:18:36 +08:00
|
|
|
: null
|
2017-11-09 02:41:15 +08:00
|
|
|
}
|
|
|
|
<div className={styles.content}>
|
2018-05-25 03:39:17 +08:00
|
|
|
{this.renderContent()}
|
2017-11-09 02:41:15 +08:00
|
|
|
</div>
|
2018-12-03 14:01:19 +08:00
|
|
|
</Modal>
|
2017-11-09 02:41:15 +08:00
|
|
|
</span>
|
2017-10-11 02:03:29 +08:00
|
|
|
);
|
2017-10-05 04:49:11 +08:00
|
|
|
}
|
2017-06-03 03:25:02 +08:00
|
|
|
}
|
2017-09-26 04:28:36 +08:00
|
|
|
|
2017-10-11 02:03:29 +08:00
|
|
|
AudioModal.propTypes = propTypes;
|
2017-10-23 20:41:09 +08:00
|
|
|
AudioModal.defaultProps = defaultProps;
|
2017-10-11 02:03:29 +08:00
|
|
|
|
2017-09-26 04:28:36 +08:00
|
|
|
export default injectIntl(AudioModal);
|