瀏覽代碼

fix(screenshare): defensively check for getDisplayMedia (#879)

jitsi-meet-spot currently supports mobile browsers. A
line should be drawn somewhere but maybe not here.
Chrome iOS does not have navigator.mediaDevices so add
a truthy check before checking for getDisplayMedia.
dev1
virtuacoplenny 6 年之前
父節點
當前提交
e398584187
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 5 行新增3 行删除
  1. 5
    3
      modules/browser/BrowserCapabilities.js

+ 5
- 3
modules/browser/BrowserCapabilities.js 查看文件

278
     }
278
     }
279
 
279
 
280
     /**
280
     /**
281
-     * Checks if the browser supposrts getDisplayMedia.
282
-     * @returns {boolean} {@code true} if the browser supposrts getDisplayMedia.
281
+     * Checks if the browser supports getDisplayMedia.
282
+     * @returns {boolean} {@code true} if the browser supports getDisplayMedia.
283
      */
283
      */
284
     supportsGetDisplayMedia() {
284
     supportsGetDisplayMedia() {
285
         return typeof navigator.getDisplayMedia !== 'undefined'
285
         return typeof navigator.getDisplayMedia !== 'undefined'
286
-            || typeof navigator.mediaDevices.getDisplayMedia !== 'undefined';
286
+            || (typeof navigator.mediaDevices !== 'undefined'
287
+                && typeof navigator.mediaDevices.getDisplayMedia
288
+                    !== 'undefined');
287
     }
289
     }
288
 
290
 
289
     /**
291
     /**

Loading…
取消
儲存