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

31 lines
1.4 KiB
React
Raw Normal View History

2017-10-06 20:50:01 +08:00
import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import getFromUserSettings from '/imports/ui/services/users-settings';
import ActionsBar from './component';
import Service from './service';
import VideoService from '../video-provider/service';
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-09-15 00:29:19 +08:00
export default withRouter(withTracker(({ location, router }) => {
const togglePollMenu = () => (location.pathname.includes('poll')
? router.push('/') : router.push('/users/poll'));
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,
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));