bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/streamer.js
2019-10-22 22:26:25 -03:00

27 lines
579 B
JavaScript

const streamers = {};
export function removeAnnotationsStreamer(meetingId) {
delete streamers[meetingId];
}
export function addAnnotationsStreamer(meetingId) {
const streamer = new Meteor.Streamer(`annotations-${meetingId}`, { retransmit: false });
streamer.allowRead(function a() {
if (!this.userId) return false;
return this.userId && this.userId.includes(meetingId);
});
streamer.allowWrite(function allowWrite() {
return false;
});
streamers[meetingId] = streamer;
}
export default function get(meetingId) {
return streamers[meetingId];
}