bigbluebutton-Github/bigbluebutton-html5/imports/api/external-videos/server/modifiers/stopExternalVideo.js
Max Franke 7f926edfcc refactor(external videos): add own collection
Refactor the external videos collection, moving the logic and functionalities
outside of /imports/api/meetings to a new location in /external-videos/server/modifiers
in order to decrease the coupling between the functionalities, favoring
the maintenance.
2021-06-02 12:50:40 -03:00

19 lines
648 B
JavaScript

import { check } from 'meteor/check';
import Logger from '/imports/startup/server/logger';
import { ExternalVideoMeetings } from '/imports/api/meetings';
export default function stopExternalVideo(userId, meetingId) {
check(meetingId, String);
check(userId, String);
const selector = { meetingId };
const modifier = { $set: { externalVideoUrl: null } };
try {
Logger.info(`External video stop sharing was initiated by:[${userId}] for meeting ${meetingId}`);
ExternalVideoMeetings.update(selector, modifier);
} catch (err) {
Logger.error(`Error on setting shared external video stop in Meetings collection: ${err}`);
}
}