stop screenshare when change the presenter
This commit is contained in:
parent
52152c8543
commit
2526d17c7e
8
bigbluebutton-html5/imports/ui/components/screenshare/component.jsx
Normal file → Executable file
8
bigbluebutton-html5/imports/ui/components/screenshare/component.jsx
Normal file → Executable file
@ -4,6 +4,14 @@ export default class ScreenshareComponent extends React.Component {
|
||||
componentDidMount() {
|
||||
this.props.presenterScreenshareHasStarted();
|
||||
}
|
||||
componentWillReceiveProps(nextProps) {
|
||||
if (this.props.isPresenter && !nextProps.isPresenter) {
|
||||
this.props.unshareScreen();
|
||||
}
|
||||
}
|
||||
componentWillUnmount() {
|
||||
this.props.presenterScreenshareHasEnded();
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
|
26
bigbluebutton-html5/imports/ui/components/screenshare/container.jsx
Normal file → Executable file
26
bigbluebutton-html5/imports/ui/components/screenshare/container.jsx
Normal file → Executable file
@ -1,14 +1,13 @@
|
||||
import React from 'react';
|
||||
import { withTracker } from 'meteor/react-meteor-data';
|
||||
import { isVideoBroadcasting, presenterScreenshareHasEnded,
|
||||
import Users from '/imports/api/users/';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import mapUser from '/imports/ui/services/user/mapUser';
|
||||
import { isVideoBroadcasting, presenterScreenshareHasEnded, unshareScreen,
|
||||
presenterScreenshareHasStarted } from './service';
|
||||
import ScreenshareComponent from './component';
|
||||
|
||||
class ScreenshareContainer extends React.Component {
|
||||
componentWillUnmount() {
|
||||
this.props.presenterScreenshareHasEnded();
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.props.isVideoBroadcasting()) {
|
||||
return <ScreenshareComponent {...this.props} />;
|
||||
@ -18,9 +17,14 @@ class ScreenshareContainer extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default withTracker(() => ({
|
||||
isVideoBroadcasting,
|
||||
presenterScreenshareHasStarted,
|
||||
presenterScreenshareHasEnded,
|
||||
}))(ScreenshareContainer);
|
||||
|
||||
export default withTracker(() => {
|
||||
const user = Users.findOne({ userId: Auth.userID });
|
||||
const MappedUser = mapUser(user);
|
||||
return {
|
||||
isPresenter: MappedUser.isPresenter,
|
||||
unshareScreen,
|
||||
isVideoBroadcasting,
|
||||
presenterScreenshareHasStarted,
|
||||
presenterScreenshareHasEnded,
|
||||
};
|
||||
})(ScreenshareContainer);
|
||||
|
Loading…
Reference in New Issue
Block a user