bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-dock/video-menu/container.jsx

32 lines
1.2 KiB
React
Raw Normal View History

2017-09-20 11:12:10 +08:00
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
2018-01-29 19:52:07 +08:00
import mapUser from '/imports/ui/services/user/mapUser';
import Auth from '/imports/ui/services/auth';
import Meetings from '/imports/api/meetings/';
import Users from '/imports/api/users/';
2017-09-20 11:12:10 +08:00
import JoinVideoOptions from './component';
import VideoMenuService from './service';
import VideoService from '../service';
2017-09-20 11:12:10 +08:00
2018-01-29 19:52:07 +08:00
const JoinVideoOptionsContainer = props => <JoinVideoOptions {...props} />;
2017-09-20 11:12:10 +08:00
export default withTracker((params) => {
const isSharingVideo = VideoMenuService.isSharingVideo();
const isWaitingResponse = VideoService.isWaitingResponse();
const isConnected = VideoService.isConnected();
2018-01-29 19:52:07 +08:00
const meeting = Meetings.findOne({ meetingId: Auth.meetingID });
const LockCam = meeting.lockSettingsProp ? meeting.lockSettingsProp.disableCam : false;
const user = Users.findOne({ userId: Auth.userID });
const userLocked = mapUser(user).isLocked;
2017-09-20 11:12:10 +08:00
return {
isSharingVideo,
isWaitingResponse,
isConnected,
2017-09-20 11:12:10 +08:00
handleJoinVideo: params.handleJoinVideo,
handleCloseVideo: params.handleCloseVideo,
2018-01-29 19:52:07 +08:00
isLocked: LockCam && userLocked,
2017-09-20 11:12:10 +08:00
};
})(JoinVideoOptionsContainer);