Browse Source

Fixing screen sharing auto start after inline install.

pull/79/head
Simon Eisenmann 11 years ago
parent
commit
669c47b57c
  1. 65
      static/js/services/screensharing.js

65
static/js/services/screensharing.js

@ -125,39 +125,38 @@ define(['underscore', 'webrtc.adapter'], function(_) {
var d = $q.defer(); var d = $q.defer();
var install = chromeExtension.autoinstall.install(); var install = chromeExtension.autoinstall.install();
install.then(function() { install.then(function() {
that.initialize(); // Seems we triggered install - this can take a while.
if (that.autoinstall) { console.log("Auto install success");
// We are still on auto install - must have failed. waiting = true;
d.reject("Auto install failed"); $timeout(function() {
} else { var starter = function() {
// Seems we triggered install - this can take a while. waiting = false;
console.log("Auto install success"); var prepare = that.prepare(options);
waiting = true; prepare.then(function(id) {
$timeout(function() { d.resolve(id);
var starter = function() { }, function(err) {
waiting = false; d.reject(err);
var prepare = that.prepare(options); });
prepare.then(function(id) { };
d.resolve(id); if (!that.autoinstall && that.supported) {
}, function(err) { // Got something.
d.reject(err); starter();
}); } else {
}; // Wait for it.
if (!that.autoinstall && that.supported) { chromeExtension.e.one("available", function() {
// Got something. $timeout(function() {
starter(); if (waiting && !that.autoinstall && that.supported) {
} else { starter();
// Wait for it. }
chromeExtension.e.one("available", function() { }, 0);
$timeout(function() { });
if (waiting && !that.autoinstall && that.supported) { }
starter(); }, 100);
} // Add a timeout of 30 seconds.
}, 0); $timeout(function() {
}); waiting = false;
} d.reject("Timeout while waiting for extension getting installed");
}, 0); }, 30000);
}
}, function(err) { }, function(err) {
d.reject(err); d.reject(err);
}); });

Loading…
Cancel
Save