bigbluebutton-Github/bigbluebutton-html5/imports/api/annotations/server/streamer.js

25 lines
741 B
JavaScript
Raw Normal View History

2019-11-14 00:53:45 +08:00
import Logger from '/imports/startup/server/logger';
2019-10-23 09:26:25 +08:00
export function removeAnnotationsStreamer(meetingId) {
2019-11-14 00:53:45 +08:00
Logger.info(`Removing Annotations streamer object for meeting ${meetingId}`);
delete Meteor.StreamerCentral.instances[`annotations-${meetingId}`];
2019-10-23 09:26:25 +08:00
}
export function addAnnotationsStreamer(meetingId) {
const streamer = new Meteor.Streamer(`annotations-${meetingId}`, { retransmit: false });
streamer.allowRead(function allowRead() {
2019-10-23 09:26:25 +08:00
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}`];
2019-10-23 09:26:25 +08:00
}