bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/streamer.js
2019-11-13 13:53:45 -03:00

25 lines
741 B
JavaScript

import Logger from '/imports/startup/server/logger';
export function removeAnnotationsStreamer(meetingId) {
Logger.info(`Removing Annotations streamer object for meeting ${meetingId}`);
delete Meteor.StreamerCentral.instances[`annotations-${meetingId}`];
}
export function addAnnotationsStreamer(meetingId) {
const streamer = new Meteor.Streamer(`annotations-${meetingId}`, { retransmit: false });
streamer.allowRead(function allowRead() {
if (!this.userId) return false;
return this.userId && this.userId.includes(meetingId);
});
streamer.allowWrite(function allowWrite() {
return false;
});
}
export default function get(meetingId) {
return Meteor.StreamerCentral.instances[`annotations-${meetingId}`];
}