Browse Source

Updated screen sharing error messages.

pull/77/head
Simon Eisenmann 11 years ago
parent
commit
35c06d56bc
  1. 18
      static/js/directives/screenshare.js

18
static/js/directives/screenshare.js

@ -18,7 +18,7 @@ @@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials/screensharepeer.html', 'bigscreen'], function($, _, template, templatePeer, BigScreen) {
define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials/screensharepeer.html', 'bigscreen', 'webrtc.adapter'], function($, _, template, templatePeer, BigScreen) {
return ["$window", "mediaStream", "$compile", "safeApply", "videoWaiter", "$timeout", "alertify", "translation", "screensharing", function($window, mediaStream, $compile, safeApply, videoWaiter, $timeout, alertify, translation, screensharing) {
@ -266,8 +266,20 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials @@ -266,8 +266,20 @@ define(['jquery', 'underscore', 'text!partials/screenshare.html', 'text!partials
$scope.$apply(function(scope) {
scope.stopScreenshare();
});
if (error && error.name === "PermissionDeniedError") {
alertify.dialog.alert(translation._("Permission to start screen sharing was denied. Make sure to have enabled screen sharing access for your browser. Copy chrome://flags/#enable-usermedia-screen-capture and open it with your browser and enable the flag on top. Then restart the browser and you are ready to go."));
if (error && error.name) {
switch (error.name) {
case "PermissionDeniedError":
if ($window.webrtcDetectedVersion >= 32 &&
$window.webrtcDetectedVersion < 37) {
alertify.dialog.alert(translation._("Permission to start screen sharing was denied. Make sure to have enabled screen sharing access for your browser. Copy chrome://flags/#enable-usermedia-screen-capture and open it with your browser and enable the flag on top. Then restart the browser and you are ready to go."));
} else {
alertify.dialog.alert(translation._("Permission to start screen sharing was denied."));
}
break;
default:
alertify.dialog.alert(translation._("Failed to start screen sharing (%s).", error.name));
break
}
}
});

Loading…
Cancel
Save