2021-05-27 03:09:25 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
|
|
|
import ExternalVideoStreamer from '/imports/api/external-videos/server/streamer';
|
|
|
|
|
2023-03-14 00:08:45 +08:00
|
|
|
export default async function updateExternalVideo(meetingId, userId, status, rate, time, state) {
|
2021-06-07 00:13:16 +08:00
|
|
|
try {
|
|
|
|
check(meetingId, String);
|
|
|
|
check(userId, String);
|
|
|
|
check(status, String);
|
|
|
|
check(rate, Number);
|
|
|
|
check(time, Number);
|
|
|
|
check(state, Number);
|
2021-05-27 03:09:25 +08:00
|
|
|
|
2021-06-07 00:13:16 +08:00
|
|
|
const modifier = {
|
|
|
|
meetingId,
|
|
|
|
userId,
|
|
|
|
rate,
|
|
|
|
time,
|
|
|
|
state,
|
|
|
|
};
|
2021-05-27 03:09:25 +08:00
|
|
|
|
2021-06-01 06:42:39 +08:00
|
|
|
Logger.debug(`UpdateExternalVideoEvtMsg received for user ${userId} and meeting ${meetingId} event:${status}`);
|
2021-05-27 03:09:25 +08:00
|
|
|
ExternalVideoStreamer(meetingId).emit(status, modifier);
|
|
|
|
} catch (err) {
|
|
|
|
Logger.error(`Error on setting shared external video update in Meetings collection: ${err}`);
|
|
|
|
}
|
|
|
|
}
|