2017-07-25 03:29:34 +08:00
|
|
|
import Screenshare from '/imports/api/2.0/screenshare';
|
2017-07-26 04:56:40 +08:00
|
|
|
import VertoBridge from '/imports/api/2.0/screenshare/client/bridge';
|
2017-07-25 03:29:34 +08:00
|
|
|
import PresentationService from '/imports/ui/components/presentation/service';
|
|
|
|
|
|
|
|
// when the meeting information has been updated check to see if it was
|
|
|
|
// screensharing. If it has changed either trigger a call to receive video
|
|
|
|
// and display it, or end the call and hide the video
|
|
|
|
function isVideoBroadcasting() {
|
|
|
|
const ds = Screenshare.findOne({});
|
|
|
|
|
2017-07-26 04:56:40 +08:00
|
|
|
if (!ds) {
|
|
|
|
return false;
|
|
|
|
}
|
2017-07-27 23:27:06 +08:00
|
|
|
return ds.screenshare.stream && !PresentationService.isPresenter();
|
2017-07-25 03:29:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// if remote screenshare has been ended disconnect and hide the video stream
|
|
|
|
function presenterScreenshareHasEnded() {
|
|
|
|
// references a function in the global namespace inside verto_extension.js
|
|
|
|
// that we load dynamically
|
2017-07-26 04:56:40 +08:00
|
|
|
VertoBridge.vertoExitVideo();
|
2017-07-25 03:29:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// if remote screenshare has been started connect and display the video stream
|
|
|
|
function presenterScreenshareHasStarted() {
|
|
|
|
// references a function in the global namespace inside verto_extension.js
|
|
|
|
// that we load dynamically
|
2017-07-26 04:56:40 +08:00
|
|
|
VertoBridge.vertoWatchVideo();
|
2017-07-25 03:29:34 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export {
|
|
|
|
isVideoBroadcasting, presenterScreenshareHasEnded, presenterScreenshareHasStarted,
|
|
|
|
};
|