2016-05-27 04:01:49 +08:00
|
|
|
import Deskshare from '/imports/api/deskshare';
|
2017-04-19 22:59:57 +08:00
|
|
|
import VertoBridge from '/imports/api/deskshare/client/bridge/verto';
|
2016-06-02 21:46:35 +08:00
|
|
|
import Auth from '/imports/ui/services/auth';
|
2016-05-07 04:15:47 +08:00
|
|
|
|
2017-03-31 23:46:33 +08:00
|
|
|
const vertoBridge = new VertoBridge();
|
2017-03-31 01:57:05 +08:00
|
|
|
|
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-22 01:00:58 +08:00
|
|
|
return (ds.broadcasting && ds.startedBy != Auth.userID);
|
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
|
2017-04-01 03:21:14 +08:00
|
|
|
vertoBridge.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
|
2017-03-31 23:46:33 +08:00
|
|
|
vertoBridge.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
|
|
|
|