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-03-14 00:08:45 +08:00
|
|
|
export default async function startExternalVideo(meetingId, userId, externalVideoUrl) {
|
2021-06-07 00:13:16 +08:00
|
|
|
try {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(userId, String);
|
|
|
|
check(externalVideoUrl, String);
|
2021-05-27 03:09:25 +08:00
|
|
|
|
2021-06-07 00:13:16 +08:00
|
|
|
const selector = { meetingId };
|
|
|
|
const modifier = { $set: { externalVideoUrl } };
|
2021-05-27 03:09:25 +08:00
|
|
|
|
|
|
|
Logger.info(`User id=${userId} sharing an external video: ${externalVideoUrl} for meeting ${meetingId}`);
|
2023-03-14 00:08:45 +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 start in Meetings collection: ${err}`);
|
|
|
|
}
|
|
|
|
}
|