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

53 lines
2.2 KiB
JavaScript

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import { injectIntl } from 'react-intl';
import getFromUserSettings from '/imports/ui/services/users-settings';
import Meetings from '/imports/api/meetings';
import Auth from '/imports/ui/services/auth';
import PresentationService from '/imports/ui/components/presentation/service';
import ActionsBar from './component';
import Service from './service';
import VideoService from '../video-provider/service';
import {
shareScreen, unshareScreen, isVideoBroadcasting, screenShareEndAlert,
} from '../screenshare/service';
import MediaService, { getSwapLayout } from '../media/service';
const ActionsBarContainer = props => <ActionsBar {...props} />;
export default withTracker(() => {
Meetings.find({ meetingId: Auth.meetingID }).observeChanges({
changed: (id, fields) => {
if (fields.recordProp && fields.recordProp.recording) {
this.window.parent.postMessage({ response: 'recordingStarted' }, '*');
}
if (fields.recordProp && !fields.recordProp.recording) {
this.window.parent.postMessage({ response: 'recordingStopped' }, '*');
}
},
});
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),
isLayoutSwapped: getSwapLayout(),
toggleSwapLayout: MediaService.toggleSwapLayout,
handleTakePresenter: Service.takePresenterRole,
currentSlidHasContent: PresentationService.currentSlidHasContent(),
parseCurrentSlideContent: PresentationService.parseCurrentSlideContent,
isSharingVideo: Service.isSharingVideo(),
screenShareEndAlert,
};
})(injectIntl(ActionsBarContainer));