bigbluebutton-Github/bigbluebutton-html5/imports/api/video-streams/server/modifiers/sharedWebcam.js
2019-09-06 13:50:31 -03:00

32 lines
689 B
JavaScript

import Logger from '/imports/startup/server/logger';
import VideoStreams from '/imports/api/video-streams';
import { check } from 'meteor/check';
export default function sharedWebcam(meetingId, userId, stream) {
check(meetingId, String);
check(userId, String);
const selector = {
meetingId,
userId,
};
const modifier = {
$set: {
stream,
},
};
const cb = (err, numChanged) => {
if (err) {
return Logger.error(`Error setting hasStream to true: ${err}`);
}
if (numChanged) {
return Logger.info(`Updated hasStream for user id=${userId} meeting=${meetingId}`);
}
};
return VideoStreams.upsert(selector, modifier, cb);
}