|
@@ -58,13 +58,6 @@ var ScreenObtainer = {
|
58
|
58
|
* Initializes the function used to obtain a screen capture
|
59
|
59
|
* (this.obtainStream).
|
60
|
60
|
*
|
61
|
|
- * If the browser is Chrome, it uses the value of
|
62
|
|
- * 'options.desktopSharingChromeMethod' (or 'options.desktopSharing') to
|
63
|
|
- * decide whether to use the a Chrome extension (if the value is 'ext'),
|
64
|
|
- * use the "screen" media source (if the value is 'webrtc'),
|
65
|
|
- * or disable screen capture (if the value is other).
|
66
|
|
- * Note that for the "screen" media source to work the
|
67
|
|
- * 'chrome://flags/#enable-usermedia-screen-capture' flag must be set.
|
68
|
61
|
* @param options {object}
|
69
|
62
|
* @param gum {Function} GUM method
|
70
|
63
|
*/
|
|
@@ -76,10 +69,6 @@ var ScreenObtainer = {
|
76
|
69
|
if (RTCBrowserType.isFirefox())
|
77
|
70
|
initFirefoxExtensionDetection(options);
|
78
|
71
|
|
79
|
|
- // TODO remove this, options.desktopSharing is deprecated.
|
80
|
|
- var chromeMethod =
|
81
|
|
- (options.desktopSharingChromeMethod || options.desktopSharing);
|
82
|
|
-
|
83
|
72
|
if (RTCBrowserType.isNWJS()) {
|
84
|
73
|
obtainDesktopStream = (options, onSuccess, onFailure) => {
|
85
|
74
|
window.JitsiMeetNW.obtainDesktopStream (
|
|
@@ -138,18 +127,18 @@ var ScreenObtainer = {
|
138
|
127
|
logger.info("Using Temasys plugin for desktop sharing");
|
139
|
128
|
}
|
140
|
129
|
} else if (RTCBrowserType.isChrome()) {
|
141
|
|
- if (chromeMethod == "ext") {
|
142
|
|
- if (RTCBrowserType.getChromeVersion() >= 34) {
|
143
|
|
- obtainDesktopStream =
|
144
|
|
- this.obtainScreenFromExtension;
|
145
|
|
- logger.info("Using Chrome extension for desktop sharing");
|
146
|
|
- initChromeExtension(options);
|
147
|
|
- } else {
|
148
|
|
- logger.info("Chrome extension not supported until ver 34");
|
149
|
|
- }
|
150
|
|
- } else if (chromeMethod == "webrtc") {
|
151
|
|
- obtainDesktopStream = obtainWebRTCScreen;
|
152
|
|
- logger.info("Using Chrome WebRTC for desktop sharing");
|
|
130
|
+ if (options.desktopSharingChromeDisabled ||
|
|
131
|
+ options.desktopSharingChromeMethod === false ||
|
|
132
|
+ !options.desktopSharingChromeExtId) {
|
|
133
|
+ // TODO: desktopSharingChromeMethod is deprecated, remove.
|
|
134
|
+ obtainDesktopStream = null;
|
|
135
|
+ } else if (RTCBrowserType.getChromeVersion() >= 34) {
|
|
136
|
+ obtainDesktopStream =
|
|
137
|
+ this.obtainScreenFromExtension;
|
|
138
|
+ logger.info("Using Chrome extension for desktop sharing");
|
|
139
|
+ initChromeExtension(options);
|
|
140
|
+ } else {
|
|
141
|
+ logger.info("Chrome extension not supported until ver 34");
|
153
|
142
|
}
|
154
|
143
|
} else if (RTCBrowserType.isFirefox()) {
|
155
|
144
|
if (options.desktopSharingFirefoxDisabled) {
|
|
@@ -331,14 +320,13 @@ function obtainWebRTCScreen(options, streamCallback, failCallback) {
|
331
|
320
|
/**
|
332
|
321
|
* Constructs inline install URL for Chrome desktop streaming extension.
|
333
|
322
|
* The 'chromeExtensionId' must be defined in options parameter.
|
334
|
|
- * @param options supports "desktopSharingChromeExtId" and "chromeExtensionId"
|
|
323
|
+ * @param options supports "desktopSharingChromeExtId"
|
335
|
324
|
* @returns {string}
|
336
|
325
|
*/
|
337
|
326
|
function getWebStoreInstallUrl(options)
|
338
|
327
|
{
|
339
|
|
- //TODO remove chromeExtensionId (deprecated)
|
340
|
328
|
return "https://chrome.google.com/webstore/detail/" +
|
341
|
|
- (options.desktopSharingChromeExtId || options.chromeExtensionId);
|
|
329
|
+ options.desktopSharingChromeExtId;
|
342
|
330
|
}
|
343
|
331
|
|
344
|
332
|
/**
|
|
@@ -387,8 +375,7 @@ function checkChromeExtInstalled(callback, options) {
|
387
|
375
|
return;
|
388
|
376
|
}
|
389
|
377
|
chrome.runtime.sendMessage(
|
390
|
|
- //TODO: remove chromeExtensionId (deprecated)
|
391
|
|
- (options.desktopSharingChromeExtId || options.chromeExtensionId),
|
|
378
|
+ options.desktopSharingChromeExtId,
|
392
|
379
|
{ getVersion: true },
|
393
|
380
|
response => {
|
394
|
381
|
if (!response || !response.version) {
|
|
@@ -401,11 +388,9 @@ function checkChromeExtInstalled(callback, options) {
|
401
|
388
|
// Check installed extension version
|
402
|
389
|
var extVersion = response.version;
|
403
|
390
|
logger.log('Extension version is: ' + extVersion);
|
404
|
|
- //TODO: remove minChromeExtVersion (deprecated)
|
405
|
391
|
var updateRequired
|
406
|
392
|
= isUpdateRequired(
|
407
|
|
- (options.desktopSharingChromeMinExtVersion ||
|
408
|
|
- options.minChromeExtVersion),
|
|
393
|
+ options.desktopSharingChromeMinExtVersion,
|
409
|
394
|
extVersion);
|
410
|
395
|
callback(!updateRequired, updateRequired);
|
411
|
396
|
}
|
|
@@ -416,13 +401,10 @@ function doGetStreamFromExtension(options, streamCallback, failCallback) {
|
416
|
401
|
// Sends 'getStream' msg to the extension.
|
417
|
402
|
// Extension id must be defined in the config.
|
418
|
403
|
chrome.runtime.sendMessage(
|
419
|
|
- //TODO: remove chromeExtensionId (deprecated)
|
420
|
|
- (options.desktopSharingChromeExtId || options.chromeExtensionId),
|
|
404
|
+ options.desktopSharingChromeExtId,
|
421
|
405
|
{
|
422
|
406
|
getStream: true,
|
423
|
|
- //TODO: remove desktopSharingSources (deprecated).
|
424
|
|
- sources: (options.desktopSharingChromeSources ||
|
425
|
|
- options.desktopSharingSources)
|
|
407
|
+ sources: options.desktopSharingChromeSources
|
426
|
408
|
},
|
427
|
409
|
response => {
|
428
|
410
|
if (!response) {
|
|
@@ -445,7 +427,7 @@ function doGetStreamFromExtension(options, streamCallback, failCallback) {
|
445
|
427
|
* Initializes <link rel=chrome-webstore-item /> with extension id set in
|
446
|
428
|
* config.js to support inline installs. Host site must be selected as main
|
447
|
429
|
* website of published extension.
|
448
|
|
- * @param options supports "desktopSharingChromeExtId" and "chromeExtensionId"
|
|
430
|
+ * @param options supports "desktopSharingChromeExtId"
|
449
|
431
|
*/
|
450
|
432
|
function initInlineInstalls(options)
|
451
|
433
|
{
|
|
@@ -537,7 +519,7 @@ function onGetStreamResponse(response, onSuccess, onFailure) {
|
537
|
519
|
/**
|
538
|
520
|
* Starts the detection of an installed jidesha extension for firefox.
|
539
|
521
|
* @param options supports "desktopSharingFirefoxDisabled",
|
540
|
|
- * "desktopSharingFirefoxExtId" and "chromeExtensionId"
|
|
522
|
+ * "desktopSharingFirefoxExtId"
|
541
|
523
|
*/
|
542
|
524
|
function initFirefoxExtensionDetection(options) {
|
543
|
525
|
if (options.desktopSharingFirefoxDisabled) {
|