2017-10-06 20:50:01 +08:00
|
|
|
import React from 'react';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2018-10-18 22:31:17 +08:00
|
|
|
import { Session } from 'meteor/session';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2016-05-20 21:46:30 +08:00
|
|
|
import ActionsBar from './component';
|
2016-11-08 02:19:00 +08:00
|
|
|
import Service from './service';
|
2018-02-19 12:23:05 +08:00
|
|
|
import VideoService from '../video-provider/service';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { shareScreen, unshareScreen, isVideoBroadcasting } from '../screenshare/service';
|
2018-09-15 00:29:19 +08:00
|
|
|
import { withRouter } from 'react-router';
|
2017-05-02 03:52:57 +08:00
|
|
|
|
2017-11-24 01:20:27 +08:00
|
|
|
const ActionsBarContainer = props => <ActionsBar {...props} />;
|
2016-04-29 03:02:51 +08:00
|
|
|
|
2018-10-18 22:31:17 +08:00
|
|
|
export default withRouter(withTracker(({ }) => {
|
|
|
|
const togglePollMenu = () => {
|
2018-10-26 06:41:45 +08:00
|
|
|
const showPoll = Session.equals('isPollOpen', false) || !Session.get('isPollOpen');
|
|
|
|
|
2018-10-26 20:37:29 +08:00
|
|
|
const show = () => { Session.set('isPollOpen', true); Session.set('forcePollOpen', true); };
|
2018-10-24 22:17:13 +08:00
|
|
|
|
2018-10-26 06:41:45 +08:00
|
|
|
const hide = () => Session.set('isPollOpen', false);
|
|
|
|
|
|
|
|
if (Session.equals('isChatOpen', true)) Session.set('isChatOpen', false);
|
2018-10-18 22:31:17 +08:00
|
|
|
|
2018-10-26 06:41:45 +08:00
|
|
|
return showPoll ? show() : hide();
|
2018-10-18 22:31:17 +08:00
|
|
|
};
|
2018-09-15 00:29:19 +08:00
|
|
|
|
|
|
|
return {
|
|
|
|
isUserPresenter: Service.isUserPresenter(),
|
|
|
|
isUserModerator: Service.isUserModerator(),
|
|
|
|
handleExitVideo: () => VideoService.exitVideo(),
|
|
|
|
handleJoinVideo: () => VideoService.joinVideo(),
|
|
|
|
handleShareScreen: onFail => shareScreen(onFail),
|
|
|
|
handleUnshareScreen: () => unshareScreen(),
|
|
|
|
isVideoBroadcasting: isVideoBroadcasting(),
|
|
|
|
recordSettingsList: Service.recordSettingsList(),
|
|
|
|
toggleRecording: Service.toggleRecording,
|
2018-09-25 20:44:38 +08:00
|
|
|
screenSharingCheck: getFromUserSettings('enableScreensharing', Meteor.settings.public.kurento.enableScreensharing),
|
|
|
|
enableVideo: getFromUserSettings('enableVideo', Meteor.settings.public.kurento.enableVideo),
|
2018-09-15 00:29:19 +08:00
|
|
|
togglePollMenu,
|
|
|
|
};
|
|
|
|
})(ActionsBarContainer));
|