Html5 clean up

This commit is contained in:
perroned 2017-03-21 21:46:41 +00:00
parent 47c6e3fe69
commit c64c97b582
5 changed files with 23 additions and 18 deletions

View File

@ -1,11 +1,17 @@
import Deskshare from '/imports/api/deskshare';
import Meetings from '/imports/api/meetings';
import modifyDeskshareStatus from '../modifiers/modifyDeskshareStatus';
import { check } from 'meteor/check';
export default function incomingDeskshareEvent({ payload }) {
check(payload, Object);
check(payload.meeting_id, String);
check(payload.broadcasting, Boolean);
check(payload.vh, Number);
check(payload.vw, Number);
export default function incomingDeskshareEvent(arg) {
const payload = arg.payload;
const meetingId = payload.meeting_id;
const voiceBridge = Meetings.findOne({ meetingId: payload.meeting_id }).voiceConf;
const voiceBridge = Meetings.findOne({ meetingId }).voiceConf;
const deskShareInfo = {
vw: payload.vw,
@ -15,3 +21,4 @@ export default function incomingDeskshareEvent(arg) {
};
modifyDeskshareStatus(meetingId, deskShareInfo);
}

View File

@ -3,17 +3,14 @@ import Meetings from '/imports/api/meetings';
import Logger from '/imports/startup/server/logger';
import Users from '/imports/api/users';
import { Meteor } from 'meteor/meteor';
import { Match } from 'meteor/check';
import { check } from 'meteor/check';
export default function modifyDeskshareStatus(meetingId, deskshareInfo) {
const presenter = Users.findOne({ meetingId: meetingId, 'user.presenter': true });
let startedById = null;
if (Match.test(presenter, Object) && Match.test(presenter.user.userid, String)) {
startedById = presenter.user.userid;
} else {
throw new Meteor.Error('not-allowed', `Deskshare presenter does not exist in this meeting`);
}
check(meetingId, String);
const presenter = Users.findOne({ meetingId, 'user.presenter': true });
check(presenter, Object);
check(presenter.user.userid, String);
const startedById = presenter.user.userid;
Deskshare.upsert({ meetingId: meetingId }, { $set: {
broadcasting: deskshareInfo.broadcasting,

View File

@ -1,5 +1,6 @@
import React from 'react';
import {isVideoBroadcasting, presenterDeskshareHasEnded, presenterDeskshareHasStarted} from './service';
import {isVideoBroadcasting, presenterDeskshareHasEnded,
presenterDeskshareHasStarted} from './service';
import { createContainer } from 'meteor/react-meteor-data';
import DeskshareComponent from './component';
@ -7,8 +8,6 @@ class DeskshareContainer extends React.Component {
render() {
if (this.props.isVideoBroadcasting()) {
return <DeskshareComponent {...this.props} />;
} else {
return null;
}
}
@ -27,3 +26,4 @@ export default createContainer(() => {
return data;
}, DeskshareContainer);

View File

@ -57,6 +57,8 @@ export default createContainer(() => {
let data = {};
data.currentPresentation = MediaService.getPresentationInfo();
data.content = <DefaultContent />;
if (MediaService.shouldShowWhiteboard()) {
data.content = <PresentationAreaContainer />;
}
@ -69,6 +71,5 @@ export default createContainer(() => {
data.overlay = <VideoDockContainer />;
}
return data;
}, MediaContainer);

View File

@ -1,6 +1,6 @@
import Presentations from '/imports/api/presentations';
import Slides from '/imports/api/slides';
import {isVideoBroadcasting} from '../deskshare/service';
import { isVideoBroadcasting } from '../deskshare/service';
let getPresentationInfo = () => {
let currentPresentation;
@ -23,9 +23,9 @@ function shouldShowDeskshare() {
}
function shouldShowOverlay() {
return false;
}
export default {
getPresentationInfo,
shouldShowWhiteboard,