Bläddra i källkod

feat(ScreenObtainer): add getDisplayMedia support for Firefox

Supported since Firefox 66.
dev1
Saúl Ibarra Corretgé 6 år sedan
förälder
incheckning
92b51e1850
1 ändrade filer med 6 tillägg och 5 borttagningar
  1. 6
    5
      modules/RTC/ScreenObtainer.js

+ 6
- 5
modules/RTC/ScreenObtainer.js Visa fil

135
         } else if (browser.isFirefox()) {
135
         } else if (browser.isFirefox()) {
136
             if (options.desktopSharingFirefoxDisabled) {
136
             if (options.desktopSharingFirefoxDisabled) {
137
                 return null;
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
             return this.obtainScreenOnFirefox;
144
             return this.obtainScreenOnFirefox;
146
         } else if (browser.isEdge() && browser.supportsGetDisplayMedia()) {
145
         } else if (browser.isEdge() && browser.supportsGetDisplayMedia()) {
147
             return this.obtainScreenFromGetDisplayMedia;
146
             return this.obtainScreenFromGetDisplayMedia;
304
      * @param errorCallback - The error callback.
303
      * @param errorCallback - The error callback.
305
      */
304
      */
306
     obtainScreenFromGetDisplayMedia(options, callback, errorCallback) {
305
     obtainScreenFromGetDisplayMedia(options, callback, errorCallback) {
306
+        logger.info('Using getDisplayMedia for screen sharing');
307
+
307
         let getDisplayMedia;
308
         let getDisplayMedia;
308
 
309
 
309
         if (navigator.getDisplayMedia) {
310
         if (navigator.getDisplayMedia) {

Laddar…
Avbryt
Spara