2017-09-20 11:12:10 +08:00
|
|
|
import React from 'react';
|
2018-01-08 12:44:42 +08:00
|
|
|
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';
|
2017-12-09 00:38:51 +08:00
|
|
|
import VideoMenuService from './service';
|
2018-01-11 09:15:44 +08:00
|
|
|
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
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
export default withTracker((params) => {
|
2017-12-09 00:38:51 +08:00
|
|
|
const isSharingVideo = VideoMenuService.isSharingVideo();
|
2018-01-11 09:15:44 +08:00
|
|
|
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,
|
2018-01-11 09:15:44 +08:00
|
|
|
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
|
|
|
};
|
2018-01-08 12:44:42 +08:00
|
|
|
})(JoinVideoOptionsContainer);
|