bigbluebutton-Github/bigbluebutton-html5/imports/api/video-streams/server/modifiers/unsharedWebcam.js

27 lines
678 B
JavaScript
Raw Normal View History

2017-09-01 23:26:57 +08:00
import Logger from '/imports/startup/server/logger';
2019-09-07 00:50:31 +08:00
import VideoStreams from '/imports/api/video-streams';
import { check } from 'meteor/check';
2019-11-23 05:08:27 +08:00
import { getDeviceId } from '/imports/api/video-streams/server/helpers';
2017-09-01 23:26:57 +08:00
export default async function unsharedWebcam(meetingId, userId, stream) {
2017-09-01 23:26:57 +08:00
check(meetingId, String);
check(userId, String);
2019-11-23 05:08:27 +08:00
check(stream, String);
const deviceId = getDeviceId(stream);
2017-09-01 23:26:57 +08:00
const selector = {
meetingId,
userId,
2019-11-23 05:08:27 +08:00
deviceId,
2017-09-01 23:26:57 +08:00
};
try {
await VideoStreams.removeAsync(selector);
2017-09-01 23:26:57 +08:00
Logger.info(`Removed stream=${stream} meeting=${meetingId}`);
} catch (err) {
Logger.error(`Error removing stream: ${err}`);
}
2017-09-01 23:26:57 +08:00
}