2017-09-29 21:38:10 +08:00
|
|
|
import React from 'react';
|
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { withModalMounter } from '/imports/ui/components/modal/service';
|
|
|
|
// import AudioControls from './component';
|
|
|
|
// import AudioModal from '../audio-modal/component';
|
|
|
|
import AudioModal from './component';
|
|
|
|
import Service from '../service';
|
|
|
|
|
|
|
|
// const propTypes = {
|
|
|
|
// children: PropTypes.element,
|
|
|
|
// };
|
|
|
|
//
|
|
|
|
// const defaultProps = {
|
|
|
|
// children: null,
|
|
|
|
// };
|
|
|
|
|
|
|
|
const AudioModalContainer = props => <AudioModal {...props} />;
|
|
|
|
|
2017-09-29 21:42:08 +08:00
|
|
|
export default withModalMounter(createContainer(({ mountModal }) =>
|
2017-09-29 21:38:10 +08:00
|
|
|
// const APP_CONFIG = Meteor.settings.public.app;
|
|
|
|
//
|
|
|
|
// const { autoJoinAudio } = APP_CONFIG;
|
|
|
|
// const { isConnected, isConnecting, isListenOnly } = Service.getStats();
|
|
|
|
// let shouldShowMute = isConnected && !isListenOnly;
|
|
|
|
// let shouldShowUnmute = isConnected && !isListenOnly && isMuted;
|
|
|
|
// let shouldShowJoin = !isConnected;
|
|
|
|
|
2017-09-29 21:42:08 +08:00
|
|
|
({
|
|
|
|
closeModal: () => mountModal(null),
|
2017-09-30 04:42:34 +08:00
|
|
|
joinMicrophone: () => Service.joinMicrophone().then(() => mountModal(null)),
|
|
|
|
// Service.exitAudio().then(() => Service.joinMicrophone())
|
|
|
|
// .then(() => mountModal(null));
|
|
|
|
// },
|
2017-09-29 21:42:08 +08:00
|
|
|
joinListenOnly: () => {
|
|
|
|
Service.joinMicrophone().then(a => mountModal(null));
|
|
|
|
},
|
2017-09-30 04:42:34 +08:00
|
|
|
changeInputDevice: (inputDeviceId) => Service.changeInputDevice(inputDeviceId),
|
2017-09-29 21:42:08 +08:00
|
|
|
joinEchoTest: () => Service.joinEchoTest(),
|
|
|
|
exitAudio: () => Service.exitAudio(),
|
|
|
|
isConnecting: Service.isConnecting(),
|
|
|
|
isConnected: Service.isConnected(),
|
|
|
|
isEchoTest: Service.isEchoTest(),
|
2017-10-04 04:42:10 +08:00
|
|
|
inputDeviceId: Service.inputDeviceId(),
|
2017-09-29 21:42:08 +08:00
|
|
|
}), AudioModalContainer));
|
2017-09-29 21:38:10 +08:00
|
|
|
|
|
|
|
// AudioControlsContainer.propTypes = propTypes;
|
|
|
|
// AudioControlsContainer.defaultProps = defaultProps;
|