bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/actions-bar/mute-button/container.jsx

27 lines
753 B
React
Raw Normal View History

import React from 'react';
2017-04-29 04:01:02 +08:00
import { createContainer } from 'meteor/react-meteor-data';
import { makeCall } from '/imports/ui/services/api';
2017-08-01 21:10:12 +08:00
import VoiceUsers from '/imports/api/2.0/voice-users';
import Auth from '/imports/ui/services/auth/index';
import MuteAudio from './component';
2017-08-01 21:10:12 +08:00
const MuteAudioContainer = props => (<MuteAudio {...props} />);
2017-08-01 21:10:12 +08:00
export default createContainer(() => {
const userId = Auth.userID;
2017-08-01 21:10:12 +08:00
const voiceUser = VoiceUsers.findOne({ intId: userId });
const { muted, joined, talking, listenOnly } = voiceUser;
2017-02-03 00:46:49 +08:00
2017-08-05 04:05:18 +08:00
const callback = () => makeCall('toggleSelfVoice');
const data = {
2017-08-01 21:41:24 +08:00
isInAudio: joined,
isMuted: muted,
callback,
2017-08-01 21:41:24 +08:00
isTalking: talking,
listenOnly,
};
return data;
}, MuteAudioContainer);