2021-05-27 03:09:25 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import { ExternalVideoMeetings } from '/imports/api/meetings';
|
|
|
|
|
2023-04-01 04:40:41 +08:00
|
|
|
export default async function stopExternalVideo(userId, meetingId) {
|
2021-06-07 00:13:16 +08:00
|
|
|
try {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(userId, String);
|
2021-05-27 03:09:25 +08:00
|
|
|
|
2021-06-07 00:13:16 +08:00
|
|
|
const selector = { meetingId };
|
|
|
|
const modifier = { $set: { externalVideoUrl: null } };
|
2021-05-27 03:09:25 +08:00
|
|
|
|
|
|
|
Logger.info(`External video stop sharing was initiated by:[${userId}] for meeting ${meetingId}`);
|
2023-04-01 04:40:41 +08:00
|
|
|
await ExternalVideoMeetings.updateAsync(selector, modifier);
|
2021-05-27 03:09:25 +08:00
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Error on setting shared external video stop in Meetings collection: ${err}`);
|
|
|
|
}
|
|
|
|
}
|