|
@@ -5,6 +5,7 @@ var RTCBrowserType = require("./RTCBrowserType");
|
5
|
5
|
var AdapterJS = require("./adapter.screenshare");
|
6
|
6
|
var DesktopSharingEventTypes
|
7
|
7
|
= require("../../service/desktopsharing/DesktopSharingEventTypes");
|
|
8
|
+var JitsiTrackErrors = require("../../JitsiTrackErrors");
|
8
|
9
|
|
9
|
10
|
/**
|
10
|
11
|
* Indicates whether the Chrome desktop sharing extension is installed.
|
|
@@ -39,16 +40,11 @@ var GUM = null;
|
39
|
40
|
* Handles obtaining a stream from a screen capture on different browsers.
|
40
|
41
|
*/
|
41
|
42
|
var ScreenObtainer = {
|
42
|
|
- /**
|
43
|
|
- * The EventEmitter to use to emit events.
|
44
|
|
- * @type {null}
|
45
|
|
- */
|
46
|
|
- eventEmitter: null,
|
47
|
43
|
obtainStream: null,
|
48
|
44
|
/**
|
49
|
45
|
* Initializes the function used to obtain a screen capture
|
50
|
46
|
* (this.obtainStream).
|
51
|
|
- *
|
|
47
|
+ *
|
52
|
48
|
* If the browser is Chrome, it uses the value of
|
53
|
49
|
* 'options.desktopSharingChromeMethod' (or 'options.desktopSharing') to
|
54
|
50
|
* decide whether to use the a Chrome extension (if the value is 'ext'),
|
|
@@ -57,8 +53,7 @@ var ScreenObtainer = {
|
57
|
53
|
* Note that for the "screen" media source to work the
|
58
|
54
|
* 'chrome://flags/#enable-usermedia-screen-capture' flag must be set.
|
59
|
55
|
*/
|
60
|
|
- init: function(eventEmitter, options, gum) {
|
61
|
|
- this.eventEmitter = eventEmitter;
|
|
56
|
+ init: function(options, gum) {
|
62
|
57
|
var obtainDesktopStream = null;
|
63
|
58
|
this.options = options = options || {};
|
64
|
59
|
GUM = gum;
|
|
@@ -174,14 +169,9 @@ var ScreenObtainer = {
|
174
|
169
|
firefoxExtInstalled = null;
|
175
|
170
|
reDetectFirefoxExtension = true;
|
176
|
171
|
|
177
|
|
- // Prompt the user to install the extension
|
178
|
|
- this.eventEmitter.emit(
|
179
|
|
- DesktopSharingEventTypes.FIREFOX_EXTENSION_NEEDED,
|
180
|
|
- this.options.desktopSharingFirefoxExtensionURL);
|
181
|
|
-
|
182
|
172
|
// Make sure desktopsharing knows that we failed, so that it doesn't get
|
183
|
173
|
// stuck in 'switching' mode.
|
184
|
|
- errorCallback('Firefox extension required.');
|
|
174
|
+ errorCallback(JitsiTrackErrors.FIREFOX_EXTENSION_NEEDED);
|
185
|
175
|
},
|
186
|
176
|
/**
|
187
|
177
|
* Asks Chrome extension to call chooseDesktopMedia and gets chrome
|