2017-10-06 20:50:01 +08:00
|
|
|
import React from 'react';
|
2019-06-13 02:40:58 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2019-02-22 05:01:39 +08:00
|
|
|
import { injectIntl } from 'react-intl';
|
2018-09-14 02:09:30 +08:00
|
|
|
import getFromUserSettings from '/imports/ui/services/users-settings';
|
2018-11-13 06:09:04 +08:00
|
|
|
import Meetings from '/imports/api/meetings';
|
|
|
|
import Auth from '/imports/ui/services/auth';
|
2019-02-22 05:01:39 +08:00
|
|
|
import PresentationService from '/imports/ui/components/presentation/service';
|
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';
|
2019-04-25 01:19:35 +08:00
|
|
|
import ExternalVideoService from '/imports/ui/components/external-video-player/service';
|
2019-05-17 04:11:10 +08:00
|
|
|
import CaptionsService from '/imports/ui/components/captions/service';
|
2019-04-16 05:39:07 +08:00
|
|
|
import {
|
2019-05-29 04:46:29 +08:00
|
|
|
shareScreen, unshareScreen, isVideoBroadcasting, screenShareEndAlert, dataSavingSetting,
|
2019-04-16 05:39:07 +08:00
|
|
|
} from '../screenshare/service';
|
2017-05-02 03:52:57 +08:00
|
|
|
|
2019-06-25 22:06:15 +08:00
|
|
|
import MediaService, { getSwapLayout, shouldEnableSwapLayout } from '../media/service';
|
2018-12-15 04:16:15 +08:00
|
|
|
|
2017-11-24 01:20:27 +08:00
|
|
|
const ActionsBarContainer = props => <ActionsBar {...props} />;
|
2016-04-29 03:02:51 +08:00
|
|
|
|
2018-11-13 06:09:04 +08:00
|
|
|
export default withTracker(() => {
|
2019-07-02 22:54:37 +08:00
|
|
|
const POLLING_ENABLED = Meteor.settings.public.poll.enabled;
|
|
|
|
|
2018-11-13 06:09:04 +08:00
|
|
|
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' }, '*');
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
2018-09-15 00:29:19 +08:00
|
|
|
return {
|
|
|
|
isUserPresenter: Service.isUserPresenter(),
|
|
|
|
isUserModerator: Service.isUserModerator(),
|
2019-04-25 01:19:35 +08:00
|
|
|
stopExternalVideoShare: ExternalVideoService.stopWatching,
|
2018-09-15 00:29:19 +08:00
|
|
|
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),
|
2019-06-25 22:06:15 +08:00
|
|
|
isLayoutSwapped: getSwapLayout() && shouldEnableSwapLayout(),
|
2018-12-15 04:16:15 +08:00
|
|
|
toggleSwapLayout: MediaService.toggleSwapLayout,
|
2019-01-14 19:30:59 +08:00
|
|
|
handleTakePresenter: Service.takePresenterRole,
|
2019-02-22 05:01:39 +08:00
|
|
|
currentSlidHasContent: PresentationService.currentSlidHasContent(),
|
|
|
|
parseCurrentSlideContent: PresentationService.parseCurrentSlideContent,
|
2019-02-16 01:32:03 +08:00
|
|
|
isSharingVideo: Service.isSharingVideo(),
|
2019-04-16 05:39:07 +08:00
|
|
|
screenShareEndAlert,
|
2019-05-29 04:46:29 +08:00
|
|
|
screenshareDataSavingSetting: dataSavingSetting(),
|
2019-05-17 04:11:10 +08:00
|
|
|
isCaptionsAvailable: CaptionsService.isCaptionsAvailable(),
|
2019-06-27 00:29:34 +08:00
|
|
|
isMeteorConnected: Meteor.status().connected,
|
2019-07-02 22:54:37 +08:00
|
|
|
isPollingEnabled: POLLING_ENABLED,
|
2018-09-15 00:29:19 +08:00
|
|
|
};
|
2019-02-22 05:01:39 +08:00
|
|
|
})(injectIntl(ActionsBarContainer));
|