bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/screenshare/container.jsx
2020-06-11 13:16:22 +00:00

33 lines
1.0 KiB
JavaScript
Executable File

import React from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import Users from '/imports/api/users/';
import Auth from '/imports/ui/services/auth';
import MediaService, { getSwapLayout, shouldEnableSwapLayout } from '/imports/ui/components/media/service';
import {
isVideoBroadcasting, presenterScreenshareHasEnded, unshareScreen,
presenterScreenshareHasStarted,
} from './service';
import ScreenshareComponent from './component';
const ScreenshareContainer = (props) => {
const { isVideoBroadcasting: isVB } = props;
if (isVB()) {
return <ScreenshareComponent {...props} />;
}
return null;
};
export default withTracker(() => {
const user = Users.findOne({ userId: Auth.userID }, { fields: { presenter: 1 } });
return {
isPresenter: user.presenter,
unshareScreen,
isVideoBroadcasting,
presenterScreenshareHasStarted,
presenterScreenshareHasEnded,
getSwapLayout,
shouldEnableSwapLayout,
toggleSwapLayout: MediaService.toggleSwapLayout,
};
})(ScreenshareContainer);