2016-05-07 04:15:47 +08:00
|
|
|
import React from 'react';
|
2017-06-03 03:25:02 +08:00
|
|
|
import { isVideoBroadcasting, presenterDeskshareHasEnded,
|
|
|
|
presenterDeskshareHasStarted } from './service';
|
2016-05-07 04:15:47 +08:00
|
|
|
import { createContainer } from 'meteor/react-meteor-data';
|
2016-05-20 21:46:30 +08:00
|
|
|
import DeskshareComponent from './component';
|
2016-05-07 04:15:47 +08:00
|
|
|
|
|
|
|
class DeskshareContainer extends React.Component {
|
|
|
|
render() {
|
2017-02-24 03:00:20 +08:00
|
|
|
if (this.props.isVideoBroadcasting()) {
|
|
|
|
return <DeskshareComponent {...this.props} />;
|
2016-05-07 04:15:47 +08:00
|
|
|
}
|
|
|
|
}
|
2016-09-15 04:25:31 +08:00
|
|
|
|
|
|
|
componentWillUnmount() {
|
2017-02-24 03:00:20 +08:00
|
|
|
this.props.presenterDeskshareHasEnded();
|
2016-09-15 04:25:31 +08:00
|
|
|
}
|
|
|
|
|
2016-05-07 04:15:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default createContainer(() => {
|
2017-02-24 03:00:20 +08:00
|
|
|
const data = {
|
2017-02-24 03:05:53 +08:00
|
|
|
isVideoBroadcasting,
|
2017-02-24 03:00:20 +08:00
|
|
|
presenterDeskshareHasStarted,
|
|
|
|
presenterDeskshareHasEnded,
|
|
|
|
};
|
|
|
|
|
2016-05-07 04:15:47 +08:00
|
|
|
return data;
|
|
|
|
}, DeskshareContainer);
|
2017-03-22 05:46:41 +08:00
|
|
|
|