248dc7fa08
Added chrome extension ID to HTML5 screenshare call
34 lines
682 B
JavaScript
34 lines
682 B
JavaScript
import Logger from '/imports/startup/server/logger';
|
|
import Users from '/imports/api/users';
|
|
import { check } from 'meteor/check';
|
|
|
|
export default function sharedWebcam(meetingId, userId) {
|
|
check(meetingId, String);
|
|
check(userId, String);
|
|
|
|
const selector = {
|
|
meetingId,
|
|
userId,
|
|
};
|
|
|
|
const modifier = {
|
|
$set: {
|
|
meetingId,
|
|
userId,
|
|
has_stream: true,
|
|
},
|
|
};
|
|
|
|
const cb = (err, numChanged) => {
|
|
if (err) {
|
|
return Logger.error(`Adding user to collection: ${err}`);
|
|
}
|
|
|
|
if (numChanged) {
|
|
return Logger.info(`Upserted user id=${userId} meeting=${meetingId}`);
|
|
}
|
|
};
|
|
|
|
return Users.upsert(selector, modifier, cb);
|
|
}
|