2022-01-13 06:35:49 +08:00
|
|
|
import { check } from 'meteor/check';
|
|
|
|
import addScreenshare from '../modifiers/addScreenshare';
|
|
|
|
import clearScreenshare from '../modifiers/clearScreenshare';
|
|
|
|
|
2023-03-17 02:13:43 +08:00
|
|
|
export default async function handleScreenshareSync({ body }, meetingId) {
|
2022-01-13 06:35:49 +08:00
|
|
|
check(meetingId, String);
|
|
|
|
check(body, Object);
|
|
|
|
|
|
|
|
const { isBroadcasting, screenshareConf } = body;
|
|
|
|
|
|
|
|
check(screenshareConf, String);
|
|
|
|
check(isBroadcasting, Boolean);
|
|
|
|
|
|
|
|
if (!isBroadcasting) {
|
2023-03-17 02:13:43 +08:00
|
|
|
const result = await clearScreenshare(meetingId, screenshareConf);
|
|
|
|
return result;
|
2022-01-13 06:35:49 +08:00
|
|
|
}
|
2023-03-17 02:13:43 +08:00
|
|
|
const result = await addScreenshare(meetingId, body);
|
|
|
|
return result;
|
2022-01-13 06:35:49 +08:00
|
|
|
}
|