Browse Source

Merge b824eff0cd into a61ad61979

pull/236/merge
theurere 9 years ago committed by GitHub
parent
commit
9d42e1db5d
  1. 3
      static/js/directives/screenshare.js
  2. 14
      static/js/services/screensharing.js

3
static/js/directives/screenshare.js

@ -172,6 +172,7 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
} }
$scope.layout.screenshare = true; $scope.layout.screenshare = true;
screensharing.globalNotify().screensharingStart();
screensharing.getScreen().then(function(options) { screensharing.getScreen().then(function(options) {
if (options) { if (options) {
$scope.startScreenshare(options); $scope.startScreenshare(options);
@ -307,6 +308,8 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
$scope.layout.screenshare = false; $scope.layout.screenshare = false;
} }
screensharing.globalNotify().screensharingStop();
}; };
$scope.toggleFullscreen = function(elem) { $scope.toggleFullscreen = function(elem) {

14
static/js/services/screensharing.js

@ -32,6 +32,9 @@ define(['underscore', 'text!partials/screensharedialogff.html', 'webrtc.adapter'
}; };
}]; }];
var GLOBAL_SCREENSHARING_START_EVENT = new Event('webrtcStartScreensharing');
var GLOBAL_SCREENSHARING_STOP_EVENT = new Event('webrtcStopScreensharing');
// screensharing // screensharing
return ["$window", "$q", "$timeout", "chromeExtension", "dialogs", "$templateCache", function($window, $q, $timeout, chromeExtension, dialogs, $templateCache) { return ["$window", "$q", "$timeout", "chromeExtension", "dialogs", "$templateCache", function($window, $q, $timeout, chromeExtension, dialogs, $templateCache) {
@ -45,6 +48,17 @@ define(['underscore', 'text!partials/screensharedialogff.html', 'webrtc.adapter'
}, this)); }, this));
}; };
Screensharing.prototype.globalNotify = function() {
return {
screensharingStart: function() {
$window.dispatchEvent(GLOBAL_SCREENSHARING_START_EVENT);
},
screensharingStop: function() {
$window.dispatchEvent(GLOBAL_SCREENSHARING_STOP_EVENT);
}
};
};
Screensharing.prototype.initialize = function() { Screensharing.prototype.initialize = function() {
// Check if we can do screensharing. // Check if we can do screensharing.

Loading…
Cancel
Save