Просмотр исходного кода

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 лет назад
Родитель
Сommit
e398584187
Аккаунт пользователя с таким Email не найден
1 измененных файлов: 5 добавлений и 3 удалений
  1. 5
    3
      modules/browser/BrowserCapabilities.js

+ 5
- 3
modules/browser/BrowserCapabilities.js Просмотреть файл

@@ -278,12 +278,14 @@ export default class BrowserCapabilities extends BrowserDetection {
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 284
     supportsGetDisplayMedia() {
285 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
     /**

Загрузка…
Отмена
Сохранить