Removed unused session vars logic
This commit is contained in:
parent
df6dd33c82
commit
debd8f714a
@ -12,9 +12,7 @@ const propTypes = {
|
|||||||
hideOverlay: PropTypes.bool,
|
hideOverlay: PropTypes.bool,
|
||||||
swapLayout: PropTypes.bool,
|
swapLayout: PropTypes.bool,
|
||||||
disableVideo: PropTypes.bool,
|
disableVideo: PropTypes.bool,
|
||||||
userWasInWebcam: PropTypes.bool,
|
|
||||||
audioModalIsOpen: PropTypes.bool,
|
audioModalIsOpen: PropTypes.bool,
|
||||||
joinVideo: PropTypes.func,
|
|
||||||
webcamPlacement: PropTypes.string,
|
webcamPlacement: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -23,9 +21,7 @@ const defaultProps = {
|
|||||||
hideOverlay: true,
|
hideOverlay: true,
|
||||||
swapLayout: false,
|
swapLayout: false,
|
||||||
disableVideo: false,
|
disableVideo: false,
|
||||||
userWasInWebcam: false,
|
|
||||||
audioModalIsOpen: false,
|
audioModalIsOpen: false,
|
||||||
joinVideo: null,
|
|
||||||
webcamPlacement: 'top',
|
webcamPlacement: 'top',
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -40,23 +36,6 @@ export default class Media extends Component {
|
|||||||
window.dispatchEvent(new Event('resize'));
|
window.dispatchEvent(new Event('resize'));
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps) {
|
|
||||||
const {
|
|
||||||
userWasInWebcam,
|
|
||||||
audioModalIsOpen,
|
|
||||||
joinVideo,
|
|
||||||
} = this.props;
|
|
||||||
|
|
||||||
const {
|
|
||||||
audioModalIsOpen: oldAudioModalIsOpen,
|
|
||||||
} = prevProps;
|
|
||||||
|
|
||||||
if ((!audioModalIsOpen && oldAudioModalIsOpen) && userWasInWebcam) {
|
|
||||||
Session.set('userWasInWebcam', false);
|
|
||||||
joinVideo();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
swapLayout,
|
swapLayout,
|
||||||
|
@ -110,7 +110,6 @@ export default withModalMounter(withTracker(() => {
|
|||||||
const data = {
|
const data = {
|
||||||
children: <DefaultContent />,
|
children: <DefaultContent />,
|
||||||
audioModalIsOpen: Session.get('audioModalIsOpen'),
|
audioModalIsOpen: Session.get('audioModalIsOpen'),
|
||||||
userWasInWebcam: Session.get('userWasInWebcam'),
|
|
||||||
joinVideo: VideoService.joinVideo,
|
joinVideo: VideoService.joinVideo,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -98,7 +98,6 @@ class VideoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sendUserUnshareWebcam(cameraId) {
|
sendUserUnshareWebcam(cameraId) {
|
||||||
Session.set('userWasInWebcam', true);
|
|
||||||
makeCall('userUnshareWebcam', cameraId);
|
makeCall('userUnshareWebcam', cameraId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +285,6 @@ class VideoProvider extends Component {
|
|||||||
// Unshare user webcam
|
// Unshare user webcam
|
||||||
if (this.sharedWebcam) {
|
if (this.sharedWebcam) {
|
||||||
this.unshareWebcam();
|
this.unshareWebcam();
|
||||||
Session.set('userWasInWebcam', true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.keys(this.webRtcPeers).forEach((id) => {
|
Object.keys(this.webRtcPeers).forEach((id) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user