Sfoglia il codice sorgente

Enables desktop sharing when using opera.

To install the chrome webstore extension, the user must already have installed "Download Chrome Extension". On missing extension we open a popup window which allows the user to add the extension and then install it.
dev1
damencho 7 anni fa
parent
commit
f742218e4a
2 ha cambiato i file con 31 aggiunte e 4 eliminazioni
  1. 8
    0
      modules/RTC/RTCBrowserType.js
  2. 23
    4
      modules/RTC/ScreenObtainer.js

+ 8
- 0
modules/RTC/RTCBrowserType.js Vedi File

@@ -181,6 +181,14 @@ const RTCBrowserType = {
181 181
         return RTCBrowserType.isChrome() ? browserVersion : null;
182 182
     },
183 183
 
184
+    /**
185
+     * Returns Opera version.
186
+     * @returns {number|null}
187
+     */
188
+    getOperaVersion() {
189
+        return RTCBrowserType.isOpera() ? browserVersion : null;
190
+    },
191
+
184 192
     /**
185 193
      * Returns Internet Explorer version.
186 194
      *

+ 23
- 4
modules/RTC/ScreenObtainer.js Vedi File

@@ -198,8 +198,9 @@ const ScreenObtainer = {
198 198
             logger.info('Using Temasys plugin for desktop sharing');
199 199
 
200 200
             return obtainWebRTCScreen;
201
-        } else if (RTCBrowserType.isChrome()) {
202
-            if (RTCBrowserType.getChromeVersion() < 34) {
201
+        } else if (RTCBrowserType.isChrome() || RTCBrowserType.isOpera()) {
202
+            if ((RTCBrowserType.getChromeVersion()
203
+                    || RTCBrowserType.getOperaVersion()) < 34) {
203 204
                 logger.info('Chrome extension not supported until ver 34');
204 205
 
205 206
                 return null;
@@ -389,6 +390,17 @@ const ScreenObtainer = {
389 390
                 /* eslint-enable no-alert */
390 391
             }
391 392
 
393
+            // for opera there is no inline install
394
+            // extension "Download Chrome Extension" allows us to open
395
+            // the chrome webstore and install from there and then activate our
396
+            // extension
397
+            if (RTCBrowserType.isOpera()) {
398
+                this.handleExternalInstall(options, streamCallback,
399
+                    failCallback);
400
+
401
+                return;
402
+            }
403
+
392 404
             try {
393 405
                 chrome.webstore.install(
394 406
                     getWebStoreInstallUrl(this.options),
@@ -422,6 +434,14 @@ const ScreenObtainer = {
422 434
 
423 435
     /* eslint-disable max-params */
424 436
 
437
+    handleExternalInstall(options, streamCallback, failCallback, e) {
438
+        const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
439
+
440
+        options.listener('waitingForExtension', webStoreInstallUrl);
441
+        this.checkForChromeExtensionOnInterval(options, streamCallback,
442
+            failCallback, e);
443
+    },
444
+
425 445
     handleExtensionInstallationError(options, streamCallback, failCallback, e) {
426 446
         const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
427 447
 
@@ -432,8 +452,7 @@ const ScreenObtainer = {
432 452
                 && options.interval > 0
433 453
                 && typeof options.checkAgain === 'function'
434 454
                 && typeof options.listener === 'function') {
435
-            options.listener('waitingForExtension', webStoreInstallUrl);
436
-            this.checkForChromeExtensionOnInterval(options, streamCallback,
455
+            this.handleExternalInstall(options, streamCallback,
437 456
                 failCallback, e);
438 457
 
439 458
             return;

Loading…
Annulla
Salva