2016-05-27 04:01:49 +08:00
|
|
|
import Deskshare from '/imports/api/deskshare';
|
2017-02-24 03:00:20 +08:00
|
|
|
import {vertoWatchVideo} from '/imports/api/verto';
|
2016-06-02 21:46:35 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2016-05-07 04:15:47 +08:00
|
|
|
|
|
|
|
// when the meeting information has been updated check to see if it was
|
|
|
|
// desksharing. If it has changed either trigger a call to receive video
|
|
|
|
// and display it, or end the call and hide the video
|
2016-09-15 04:25:31 +08:00
|
|
|
function isVideoBroadcasting() {
|
2016-05-07 04:15:47 +08:00
|
|
|
const ds = Deskshare.findOne({});
|
|
|
|
if (ds == null || !ds.broadcasting) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2017-03-21 23:42:14 +08:00
|
|
|
if (ds.broadcasting) {
|
|
|
|
return (ds.startedBy != Auth.userID);
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
2016-05-07 04:15:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// if remote deskshare has been ended disconnect and hide the video stream
|
|
|
|
function presenterDeskshareHasEnded() {
|
2017-03-07 04:30:07 +08:00
|
|
|
// references a functiion in the global namespace inside verto_extension.js
|
|
|
|
// that we load dynamically
|
|
|
|
window.vertoExitVideo();
|
2016-05-07 04:15:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
// if remote deskshare has been started connect and display the video stream
|
|
|
|
function presenterDeskshareHasStarted() {
|
2017-03-07 04:30:07 +08:00
|
|
|
// references a functiion in the global namespace inside verto_extension.js
|
|
|
|
// that we load dynamically
|
|
|
|
window.vertoWatchVideo();
|
2016-05-07 04:15:47 +08:00
|
|
|
};
|
|
|
|
|
2016-05-31 01:21:30 +08:00
|
|
|
export {
|
2016-09-15 04:25:31 +08:00
|
|
|
isVideoBroadcasting, presenterDeskshareHasEnded, presenterDeskshareHasStarted,
|
2016-05-07 04:15:47 +08:00
|
|
|
};
|
2016-08-19 22:07:47 +08:00
|
|
|
|