2019-09-06 02:29:30 +08:00
|
|
|
import { Meteor } from 'meteor/meteor';
|
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import Logger from '/imports/startup/server/logger';
|
2019-09-07 00:50:31 +08:00
|
|
|
import VideoStreams from '/imports/api/video-streams';
|
2019-09-06 02:29:30 +08:00
|
|
|
|
2019-09-07 00:50:31 +08:00
|
|
|
function videoStreams(credentials) {
|
2019-09-06 02:29:30 +08:00
|
|
|
const { meetingId, requesterUserId, requesterToken } = credentials;
|
|
|
|
|
|
|
|
check(meetingId, String);
|
|
|
|
check(requesterUserId, String);
|
|
|
|
check(requesterToken, String);
|
|
|
|
|
|
|
|
Logger.debug(`video users of meeting id=${meetingId}`);
|
|
|
|
|
|
|
|
const selector = {
|
|
|
|
meetingId,
|
|
|
|
};
|
|
|
|
|
2019-09-07 00:50:31 +08:00
|
|
|
return VideoStreams.find(selector);
|
2019-09-06 02:29:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
function publish(...args) {
|
2019-09-07 00:50:31 +08:00
|
|
|
const boundVideoStreams = videoStreams.bind(this);
|
|
|
|
return boundVideoStreams(...args);
|
2019-09-06 02:29:30 +08:00
|
|
|
}
|
|
|
|
|
2019-09-07 00:50:31 +08:00
|
|
|
Meteor.publish('video-streams', publish);
|