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';
|
2017-07-25 03:29:34 +08:00
|
|
|
import { isVideoBroadcasting, presenterScreenshareHasEnded,
|
|
|
|
presenterScreenshareHasStarted } from './service';
|
|
|
|
import ScreenshareComponent from './component';
|
|
|
|
|
|
|
|
class ScreenshareContainer extends React.Component {
|
2018-01-08 12:44:42 +08:00
|
|
|
componentWillUnmount() {
|
|
|
|
this.props.presenterScreenshareHasEnded();
|
|
|
|
}
|
|
|
|
|
2017-07-25 03:29:34 +08:00
|
|
|
render() {
|
|
|
|
if (this.props.isVideoBroadcasting()) {
|
|
|
|
return <ScreenshareComponent {...this.props} />;
|
|
|
|
}
|
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
return null;
|
2017-07-25 03:29:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-08 12:44:42 +08:00
|
|
|
export default withTracker(() => ({
|
2017-07-25 03:29:34 +08:00
|
|
|
isVideoBroadcasting,
|
|
|
|
presenterScreenshareHasStarted,
|
|
|
|
presenterScreenshareHasEnded,
|
2018-01-08 12:44:42 +08:00
|
|
|
}))(ScreenshareContainer);
|
2017-07-25 03:29:34 +08:00
|
|
|
|