2017-07-25 03:29:34 +08:00
|
|
|
import React from 'react';
|
2018-01-08 12:44:42 +08:00
|
|
|
import { withTracker } from 'meteor/react-meteor-data';
|
2018-03-15 02:28:28 +08:00
|
|
|
import Users from '/imports/api/users/';
|
|
|
|
import Auth from '/imports/ui/services/auth';
|
2019-04-16 05:39:07 +08:00
|
|
|
import {
|
|
|
|
isVideoBroadcasting, presenterScreenshareHasEnded, unshareScreen,
|
|
|
|
presenterScreenshareHasStarted,
|
|
|
|
} from './service';
|
2017-07-25 03:29:34 +08:00
|
|
|
import ScreenshareComponent from './component';
|
|
|
|
|
2019-07-24 03:56:39 +08:00
|
|
|
const ScreenshareContainer = (props) => {
|
|
|
|
const { isVideoBroadcasting: isVB } = props;
|
|
|
|
if (isVB()) {
|
|
|
|
return <ScreenshareComponent {...props} />;
|
2017-07-25 03:29:34 +08:00
|
|
|
}
|
2019-07-24 03:56:39 +08:00
|
|
|
return null;
|
|
|
|
};
|
2017-07-25 03:29:34 +08:00
|
|
|
|
2018-03-15 02:28:28 +08:00
|
|
|
export default withTracker(() => {
|
2019-08-30 00:26:07 +08:00
|
|
|
const user = Users.findOne({ userId: Auth.userID }, { fields: { presenter: 1 } });
|
2018-03-15 02:28:28 +08:00
|
|
|
return {
|
2019-08-22 04:39:06 +08:00
|
|
|
isPresenter: user.presenter,
|
2018-03-15 02:28:28 +08:00
|
|
|
unshareScreen,
|
|
|
|
isVideoBroadcasting,
|
|
|
|
presenterScreenshareHasStarted,
|
|
|
|
presenterScreenshareHasEnded,
|
|
|
|
};
|
|
|
|
})(ScreenshareContainer);
|