Fix autosharewebcam option not working on first join

This commit is contained in:
Oswaldo Acauan 2018-04-25 11:23:44 -03:00
parent ad57657b18
commit fb6aeb90f9
2 changed files with 13 additions and 7 deletions

View File

@ -23,6 +23,11 @@ const intlMessages = defineMessages({
});
class MediaContainer extends Component {
componentWillMount() {
const { willMount } = this.props;
willMount && willMount();
}
componentWillReceiveProps(nextProps) {
const {
isScreensharing,
@ -74,10 +79,14 @@ export default withTracker(() => {
if (data.swapLayout) {
data.floatingOverlay = true;
data.hideOverlay = hidePresentation;
}
if (hidePresentation) {
data.hideOverlay = true;
}
const enableVideo = Meteor.settings.public.kurento.enableVideo;
const autoShareWebcam = SessionStorage.getItem('meta_html5autosharewebcam') || false;
if (enableVideo && autoShareWebcam) {
data.willMount = VideoService.joinVideo;
}
return data;

View File

@ -9,11 +9,8 @@ import SessionStorage from '/imports/ui/services/storage/session';
class VideoService {
constructor() {
const enableVideo = Meteor.settings.public.kurento.enableVideo;
const autoShareWebcam = SessionStorage.getItem('meta_html5autosharewebcam') || false;
this.defineProperties({
isSharing: autoShareWebcam && enableVideo,
isSharing: false,
isConnected: false,
isWaitingResponse: false,
});