Kaynağa Gözat

feat(api): Expose event used for sending browser support

master
Vlad Piersec 3 yıl önce
ebeveyn
işleme
0bf52b613b
2 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 15
    0
      modules/API/API.js
  2. 1
    0
      modules/API/external/external_api.js

+ 15
- 0
modules/API/API.js Dosyayı Görüntüle

@@ -15,6 +15,7 @@ import {
15 15
 } from '../../react/features/base/conference';
16 16
 import { overwriteConfig, getWhitelistedJSON } from '../../react/features/base/config';
17 17
 import { toggleDialog } from '../../react/features/base/dialog/actions';
18
+import { isSupportedBrowser } from '../../react/features/base/environment';
18 19
 import { parseJWTFromURLParams } from '../../react/features/base/jwt';
19 20
 import JitsiMeetJS, { JitsiRecordingConstants } from '../../react/features/base/lib-jitsi-meet';
20 21
 import { MEDIA_TYPE } from '../../react/features/base/media';
@@ -692,6 +693,7 @@ class API {
692 693
         this._enabled = true;
693 694
 
694 695
         initCommands();
696
+        this.notifyBrowserSupport(isSupportedBrowser());
695 697
     }
696 698
 
697 699
     /**
@@ -1355,6 +1357,19 @@ class API {
1355 1357
         });
1356 1358
     }
1357 1359
 
1360
+    /**
1361
+     * Notify external application (if API is enabled) wether the used browser is supported or not.
1362
+     *
1363
+     * @param {boolean} supported - If browser is supported or not.
1364
+     * @returns {void}
1365
+     */
1366
+    notifyBrowserSupport(supported: boolean) {
1367
+        this._sendEvent({
1368
+            name: 'browser-support',
1369
+            supported
1370
+        });
1371
+    }
1372
+
1358 1373
     /**
1359 1374
      * Disposes the allocated resources.
1360 1375
      *

+ 1
- 0
modules/API/external/external_api.js Dosyayı Görüntüle

@@ -76,6 +76,7 @@ const events = {
76 76
     'avatar-changed': 'avatarChanged',
77 77
     'audio-availability-changed': 'audioAvailabilityChanged',
78 78
     'audio-mute-status-changed': 'audioMuteStatusChanged',
79
+    'browser-support': 'browserSupport',
79 80
     'camera-error': 'cameraError',
80 81
     'chat-updated': 'chatUpdated',
81 82
     'content-sharing-participants-changed': 'contentSharingParticipantsChanged',

Loading…
İptal
Kaydet