bigbluebutton-Github/bigbluebutton-html5/imports/api/video/server/handlers/userSharedHtml5Webcam.js

21 lines
602 B
JavaScript
Raw Normal View History

2017-09-01 23:26:57 +08:00
import sharedWebcam from '../modifiers/sharedWebcam';
import { check } from 'meteor/check';
export default function handleUserSharedHtml5Webcam({ header, body }, meetingId ) {
const { userId, stream } = body;
const isValidStream = (match) => {
// Checking if the stream name is a flash one
const regexp = /^([A-z0-9]+)-([A-z0-9]+)-([A-z0-9]+)(-recorded)?$/;
return !regexp.test(match);
};
2017-09-01 23:26:57 +08:00
check(header, Object);
2017-09-01 23:26:57 +08:00
check(meetingId, String);
check(userId, String);
check(stream, String);
if (!isValidStream(stream)) return false;
2017-09-01 23:26:57 +08:00
return sharedWebcam(meetingId, userId);
}