Browse Source

feat(ScreenObtainer): add getDisplayMedia support for Firefox

Supported since Firefox 66.
dev1
Saúl Ibarra Corretgé 6 years ago
parent
commit
92b51e1850
1 changed files with 6 additions and 5 deletions
  1. 6
    5
      modules/RTC/ScreenObtainer.js

+ 6
- 5
modules/RTC/ScreenObtainer.js View File

@@ -135,13 +135,12 @@ const ScreenObtainer = {
135 135
         } else if (browser.isFirefox()) {
136 136
             if (options.desktopSharingFirefoxDisabled) {
137 137
                 return null;
138
-            } else if (window.location.protocol === 'http:') {
139
-                logger.log('Screen sharing is not supported over HTTP. '
140
-                    + 'Use of HTTPS is required.');
141
-
142
-                return null;
138
+            } else if (browser.supportsGetDisplayMedia()) {
139
+                // Firefox 66 support getDisplayMedia
140
+                return this.obtainScreenFromGetDisplayMedia;
143 141
             }
144 142
 
143
+            // Legacy Firefox
145 144
             return this.obtainScreenOnFirefox;
146 145
         } else if (browser.isEdge() && browser.supportsGetDisplayMedia()) {
147 146
             return this.obtainScreenFromGetDisplayMedia;
@@ -304,6 +303,8 @@ const ScreenObtainer = {
304 303
      * @param errorCallback - The error callback.
305 304
      */
306 305
     obtainScreenFromGetDisplayMedia(options, callback, errorCallback) {
306
+        logger.info('Using getDisplayMedia for screen sharing');
307
+
307 308
         let getDisplayMedia;
308 309
 
309 310
         if (navigator.getDisplayMedia) {

Loading…
Cancel
Save