bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/mute-button/container.jsx
2017-09-20 17:42:35 -07:00

27 lines
753 B
JavaScript
Executable File

import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';
import { makeCall } from '/imports/ui/services/api';
import VoiceUsers from '/imports/api/2.0/voice-users';
import Auth from '/imports/ui/services/auth/index';
import MuteAudio from './component';
const MuteAudioContainer = props => (<MuteAudio {...props} />);
export default createContainer(() => {
const userId = Auth.userID;
const voiceUser = VoiceUsers.findOne({ intId: userId });
const { muted, joined, talking, listenOnly } = voiceUser;
const callback = () => makeCall('toggleSelfVoice');
const data = {
isInAudio: joined,
isMuted: muted,
callback,
isTalking: talking,
listenOnly,
};
return data;
}, MuteAudioContainer);