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

53 lines
2.3 KiB
React
Raw Normal View History

2017-10-06 20:50:01 +08:00
import React from 'react';
import { Meteor } from 'meteor/meteor';
import { withTracker } from 'meteor/react-meteor-data';
2019-02-22 05:01:39 +08:00
import { injectIntl } from 'react-intl';
import getFromUserSettings from '/imports/ui/services/users-settings';
2018-11-13 06:09:04 +08:00
import Auth from '/imports/ui/services/auth';
2019-02-22 05:01:39 +08:00
import PresentationService from '/imports/ui/components/presentation/service';
import Presentations from '/imports/api/presentations';
import ActionsBar from './component';
import Service from './service';
import ExternalVideoService from '/imports/ui/components/external-video-player/service';
import CaptionsService from '/imports/ui/components/captions/service';
import {
shareScreen,
unshareScreen,
isVideoBroadcasting,
screenShareEndAlert,
dataSavingSetting,
} from '../screenshare/service';
2017-05-02 03:52:57 +08:00
import MediaService, {
getSwapLayout,
shouldEnableSwapLayout,
} from '../media/service';
2017-11-24 01:20:27 +08:00
const ActionsBarContainer = props => <ActionsBar {...props} />;
2019-09-05 02:32:58 +08:00
const POLLING_ENABLED = Meteor.settings.public.poll.enabled;
2016-04-29 03:02:51 +08:00
2019-09-05 02:32:58 +08:00
export default withTracker(() => ({
amIPresenter: Service.amIPresenter(),
amIModerator: Service.amIModerator(),
2019-09-05 02:32:58 +08:00
stopExternalVideoShare: ExternalVideoService.stopWatching,
handleShareScreen: onFail => shareScreen(onFail),
handleUnshareScreen: () => unshareScreen(),
isVideoBroadcasting: isVideoBroadcasting(),
screenSharingCheck: getFromUserSettings('bbb_enable_screen_sharing', Meteor.settings.public.kurento.enableScreensharing),
enableVideo: getFromUserSettings('bbb_enable_video', Meteor.settings.public.kurento.enableVideo),
2019-09-05 02:32:58 +08:00
isLayoutSwapped: getSwapLayout() && shouldEnableSwapLayout(),
toggleSwapLayout: MediaService.toggleSwapLayout,
handleTakePresenter: Service.takePresenterRole,
currentSlidHasContent: PresentationService.currentSlidHasContent(),
parseCurrentSlideContent: PresentationService.parseCurrentSlideContent,
isSharingVideo: Service.isSharingVideo(),
screenShareEndAlert,
screenshareDataSavingSetting: dataSavingSetting(),
isCaptionsAvailable: CaptionsService.isCaptionsAvailable(),
isMeteorConnected: Meteor.status().connected,
isPollingEnabled: POLLING_ENABLED,
isThereCurrentPresentation: Presentations.findOne({ meetingId: Auth.meetingID, current: true },
{ fields: {} }),
allowExternalVideo: Meteor.settings.public.externalVideoPlayer.enabled,
2019-09-05 02:32:58 +08:00
}))(injectIntl(ActionsBarContainer));