7f926edfcc
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.
28 lines
809 B
JavaScript
28 lines
809 B
JavaScript
import { check } from 'meteor/check';
|
|
import Logger from '/imports/startup/server/logger';
|
|
import ExternalVideoStreamer from '/imports/api/external-videos/server/streamer';
|
|
|
|
export default function updateExternalVideo(meetingId, userId, status, rate, time, state) {
|
|
check(meetingId, String);
|
|
check(status, String);
|
|
check(userId, String);
|
|
check(rate, Number);
|
|
check(time, Number);
|
|
check(state, Number);
|
|
|
|
const modifier = {
|
|
meetingId,
|
|
userId,
|
|
rate,
|
|
time,
|
|
state,
|
|
};
|
|
|
|
try {
|
|
Logger.verbose(`UpdateExternalVideoEvtMsg received for user ${userId} and meeting ${meetingId} event:${status}`);
|
|
ExternalVideoStreamer(meetingId).emit(status, modifier);
|
|
} catch (err) {
|
|
Logger.error(`Error on setting shared external video update in Meetings collection: ${err}`);
|
|
}
|
|
}
|