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

fix(lib-jitsi-meet): Use the exported constants

j8
hristoterezov 8 лет назад
Родитель
Сommit
a3a871d4b3

+ 79
- 82
conference.js Просмотреть файл

35
 import { updateDeviceList } from './react/features/base/devices';
35
 import { updateDeviceList } from './react/features/base/devices';
36
 import {
36
 import {
37
     isAnalyticsEnabled,
37
     isAnalyticsEnabled,
38
-    isFatalJitsiConnectionError
38
+    isFatalJitsiConnectionError,
39
+    JitsiConferenceErrors,
40
+    JitsiConferenceEvents,
41
+    JitsiConnectionErrors,
42
+    JitsiConnectionEvents,
43
+    JitsiMediaDevicesEvents,
44
+    JitsiParticipantConnectionStatus,
45
+    JitsiTrackErrors,
46
+    JitsiTrackEvents
39
 } from './react/features/base/lib-jitsi-meet';
47
 } from './react/features/base/lib-jitsi-meet';
40
 import {
48
 import {
41
     isVideoMutedByUser,
49
     isVideoMutedByUser,
77
     showDesktopSharingButton
85
     showDesktopSharingButton
78
 } from './react/features/toolbox';
86
 } from './react/features/toolbox';
79
 
87
 
80
-const { participantConnectionStatus } = JitsiMeetJS.constants;
81
-
82
-const ConnectionEvents = JitsiMeetJS.events.connection;
83
-const ConnectionErrors = JitsiMeetJS.errors.connection;
84
-
85
-const ConferenceEvents = JitsiMeetJS.events.conference;
86
-const ConferenceErrors = JitsiMeetJS.errors.conference;
87
-
88
-const TrackEvents = JitsiMeetJS.events.track;
89
-const TrackErrors = JitsiMeetJS.errors.track;
90
-
91
 const eventEmitter = new EventEmitter();
88
 const eventEmitter = new EventEmitter();
92
 
89
 
93
 let room;
90
 let room;
123
 function connect(roomName) {
120
 function connect(roomName) {
124
     return openConnection({retry: true, roomName: roomName})
121
     return openConnection({retry: true, roomName: roomName})
125
             .catch(function (err) {
122
             .catch(function (err) {
126
-                if (err === ConnectionErrors.PASSWORD_REQUIRED) {
123
+                if (err === JitsiConnectionErrors.PASSWORD_REQUIRED) {
127
                     APP.UI.notifyTokenAuthFailed();
124
                     APP.UI.notifyTokenAuthFailed();
128
                 } else {
125
                 } else {
129
                     APP.UI.notifyConnectionFailed(err);
126
                     APP.UI.notifyConnectionFailed(err);
270
         this._resolve = resolve;
267
         this._resolve = resolve;
271
         this._reject = reject;
268
         this._reject = reject;
272
         this.reconnectTimeout = null;
269
         this.reconnectTimeout = null;
273
-        room.on(ConferenceEvents.CONFERENCE_JOINED,
270
+        room.on(JitsiConferenceEvents.CONFERENCE_JOINED,
274
             this._handleConferenceJoined.bind(this));
271
             this._handleConferenceJoined.bind(this));
275
-        room.on(ConferenceEvents.CONFERENCE_FAILED,
272
+        room.on(JitsiConferenceEvents.CONFERENCE_FAILED,
276
             this._onConferenceFailed.bind(this));
273
             this._onConferenceFailed.bind(this));
277
-        room.on(ConferenceEvents.CONFERENCE_ERROR,
274
+        room.on(JitsiConferenceEvents.CONFERENCE_ERROR,
278
             this._onConferenceError.bind(this));
275
             this._onConferenceError.bind(this));
279
     }
276
     }
280
     _handleConferenceFailed(err) {
277
     _handleConferenceFailed(err) {
286
         logger.error('CONFERENCE FAILED:', err, ...params);
283
         logger.error('CONFERENCE FAILED:', err, ...params);
287
 
284
 
288
         switch (err) {
285
         switch (err) {
289
-        case ConferenceErrors.CONNECTION_ERROR: {
286
+        case JitsiConferenceErrors.CONNECTION_ERROR: {
290
             let [msg] = params;
287
             let [msg] = params;
291
             APP.UI.notifyConnectionFailed(msg);
288
             APP.UI.notifyConnectionFailed(msg);
292
             break;
289
             break;
293
         }
290
         }
294
 
291
 
295
-        case ConferenceErrors.NOT_ALLOWED_ERROR: {
292
+        case JitsiConferenceErrors.NOT_ALLOWED_ERROR: {
296
             // let's show some auth not allowed page
293
             // let's show some auth not allowed page
297
             assignWindowLocationPathname('static/authError.html');
294
             assignWindowLocationPathname('static/authError.html');
298
             break;
295
             break;
299
         }
296
         }
300
 
297
 
301
         // not enough rights to create conference
298
         // not enough rights to create conference
302
-        case ConferenceErrors.AUTHENTICATION_REQUIRED: {
299
+        case JitsiConferenceErrors.AUTHENTICATION_REQUIRED: {
303
             // Schedule reconnect to check if someone else created the room.
300
             // Schedule reconnect to check if someone else created the room.
304
             this.reconnectTimeout = setTimeout(() => room.join(), 5000);
301
             this.reconnectTimeout = setTimeout(() => room.join(), 5000);
305
 
302
 
311
             break;
308
             break;
312
         }
309
         }
313
 
310
 
314
-        case ConferenceErrors.RESERVATION_ERROR: {
311
+        case JitsiConferenceErrors.RESERVATION_ERROR: {
315
             let [code, msg] = params;
312
             let [code, msg] = params;
316
             APP.UI.notifyReservationError(code, msg);
313
             APP.UI.notifyReservationError(code, msg);
317
             break;
314
             break;
318
         }
315
         }
319
 
316
 
320
-        case ConferenceErrors.GRACEFUL_SHUTDOWN:
317
+        case JitsiConferenceErrors.GRACEFUL_SHUTDOWN:
321
             APP.UI.notifyGracefulShutdown();
318
             APP.UI.notifyGracefulShutdown();
322
             break;
319
             break;
323
 
320
 
324
-        case ConferenceErrors.JINGLE_FATAL_ERROR:
321
+        case JitsiConferenceErrors.JINGLE_FATAL_ERROR:
325
             APP.UI.notifyInternalError();
322
             APP.UI.notifyInternalError();
326
             break;
323
             break;
327
 
324
 
328
-        case ConferenceErrors.CONFERENCE_DESTROYED: {
325
+        case JitsiConferenceErrors.CONFERENCE_DESTROYED: {
329
             let [reason] = params;
326
             let [reason] = params;
330
             APP.UI.hideStats();
327
             APP.UI.hideStats();
331
             APP.UI.notifyConferenceDestroyed(reason);
328
             APP.UI.notifyConferenceDestroyed(reason);
336
         // What really happens there is that the library is not ready yet,
333
         // What really happens there is that the library is not ready yet,
337
         // because Jicofo is not available, but it is going to give it another
334
         // because Jicofo is not available, but it is going to give it another
338
         // try.
335
         // try.
339
-        case ConferenceErrors.FOCUS_DISCONNECTED: {
336
+        case JitsiConferenceErrors.FOCUS_DISCONNECTED: {
340
             let [focus, retrySec] = params;
337
             let [focus, retrySec] = params;
341
             APP.UI.notifyFocusDisconnected(focus, retrySec);
338
             APP.UI.notifyFocusDisconnected(focus, retrySec);
342
             break;
339
             break;
343
         }
340
         }
344
 
341
 
345
-        case ConferenceErrors.FOCUS_LEFT:
346
-        case ConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
342
+        case JitsiConferenceErrors.FOCUS_LEFT:
343
+        case JitsiConferenceErrors.VIDEOBRIDGE_NOT_AVAILABLE:
347
             // FIXME the conference should be stopped by the library and not by
344
             // FIXME the conference should be stopped by the library and not by
348
             // the app. Both the errors above are unrecoverable from the library
345
             // the app. Both the errors above are unrecoverable from the library
349
             // perspective.
346
             // perspective.
350
             room.leave().then(() => connection.disconnect());
347
             room.leave().then(() => connection.disconnect());
351
             break;
348
             break;
352
 
349
 
353
-        case ConferenceErrors.CONFERENCE_MAX_USERS:
350
+        case JitsiConferenceErrors.CONFERENCE_MAX_USERS:
354
             connection.disconnect();
351
             connection.disconnect();
355
             APP.UI.notifyMaxUsersLimitReached();
352
             APP.UI.notifyMaxUsersLimitReached();
356
             break;
353
             break;
357
 
354
 
358
-        case ConferenceErrors.INCOMPATIBLE_SERVER_VERSIONS:
355
+        case JitsiConferenceErrors.INCOMPATIBLE_SERVER_VERSIONS:
359
             reload();
356
             reload();
360
             break;
357
             break;
361
 
358
 
366
     _onConferenceError(err, ...params) {
363
     _onConferenceError(err, ...params) {
367
         logger.error('CONFERENCE Error:', err, params);
364
         logger.error('CONFERENCE Error:', err, params);
368
         switch (err) {
365
         switch (err) {
369
-        case ConferenceErrors.CHAT_ERROR:
366
+        case JitsiConferenceErrors.CHAT_ERROR:
370
             logger.error("Chat error.", err);
367
             logger.error("Chat error.", err);
371
             if (isButtonEnabled('chat')) {
368
             if (isButtonEnabled('chat')) {
372
                 let [code, msg] = params;
369
                 let [code, msg] = params;
379
     }
376
     }
380
     _unsubscribe() {
377
     _unsubscribe() {
381
         room.off(
378
         room.off(
382
-            ConferenceEvents.CONFERENCE_JOINED, this._handleConferenceJoined);
379
+            JitsiConferenceEvents.CONFERENCE_JOINED, this._handleConferenceJoined);
383
         room.off(
380
         room.off(
384
-            ConferenceEvents.CONFERENCE_FAILED, this._onConferenceFailed);
381
+            JitsiConferenceEvents.CONFERENCE_FAILED, this._onConferenceFailed);
385
         if (this.reconnectTimeout !== null) {
382
         if (this.reconnectTimeout !== null) {
386
             clearTimeout(this.reconnectTimeout);
383
             clearTimeout(this.reconnectTimeout);
387
         }
384
         }
410
 /**
407
 /**
411
  * Handles CONNECTION_FAILED events from lib-jitsi-meet.
408
  * Handles CONNECTION_FAILED events from lib-jitsi-meet.
412
  *
409
  *
413
- * @param {JitsiMeetJS.connection.error} error - The reported error.
410
+ * @param {JitsiConnectionError} error - The reported error.
414
  * @returns {void}
411
  * @returns {void}
415
  * @private
412
  * @private
416
  */
413
  */
417
 function _connectionFailedHandler(error) {
414
 function _connectionFailedHandler(error) {
418
     if (isFatalJitsiConnectionError(error)) {
415
     if (isFatalJitsiConnectionError(error)) {
419
         APP.connection.removeEventListener(
416
         APP.connection.removeEventListener(
420
-            ConnectionEvents.CONNECTION_FAILED,
417
+            JitsiConnectionEvents.CONNECTION_FAILED,
421
             _connectionFailedHandler);
418
             _connectionFailedHandler);
422
         if (room)
419
         if (room)
423
             room.leave();
420
             room.leave();
517
         }
514
         }
518
 
515
 
519
         JitsiMeetJS.mediaDevices.addEventListener(
516
         JitsiMeetJS.mediaDevices.addEventListener(
520
-            JitsiMeetJS.events.mediaDevices.PERMISSION_PROMPT_IS_SHOWN,
517
+            JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,
521
             browser =>
518
             browser =>
522
                 APP.store.dispatch(
519
                 APP.store.dispatch(
523
                     mediaPermissionPromptVisibilityChanged(true, browser))
520
                     mediaPermissionPromptVisibilityChanged(true, browser))
686
                 logger.log('initialized with %s local tracks', tracks.length);
683
                 logger.log('initialized with %s local tracks', tracks.length);
687
                 this._localTracksInitialized = true;
684
                 this._localTracksInitialized = true;
688
                 con.addEventListener(
685
                 con.addEventListener(
689
-                    ConnectionEvents.CONNECTION_FAILED,
686
+                    JitsiConnectionEvents.CONNECTION_FAILED,
690
                     _connectionFailedHandler);
687
                     _connectionFailedHandler);
691
                 APP.connection = connection = con;
688
                 APP.connection = connection = con;
692
 
689
 
1446
                 = this._turnScreenSharingOff
1443
                 = this._turnScreenSharingOff
1447
                       .bind(this, didHaveVideo, wasVideoMuted);
1444
                       .bind(this, didHaveVideo, wasVideoMuted);
1448
             desktopStream.on(
1445
             desktopStream.on(
1449
-                TrackEvents.LOCAL_TRACK_STOPPED,
1446
+                JitsiTrackEvents.LOCAL_TRACK_STOPPED,
1450
                 () => {
1447
                 () => {
1451
                     // If the stream was stopped during screen sharing
1448
                     // If the stream was stopped during screen sharing
1452
                     // session then we should switch back to video.
1449
                     // session then we should switch back to video.
1526
      * @private
1523
      * @private
1527
      */
1524
      */
1528
     _handleScreenSharingError(error) {
1525
     _handleScreenSharingError(error) {
1529
-        if (error.name === TrackErrors.CHROME_EXTENSION_USER_CANCELED) {
1526
+        if (error.name === JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED) {
1530
             return;
1527
             return;
1531
         }
1528
         }
1532
 
1529
 
1533
         logger.error('failed to share local desktop', error);
1530
         logger.error('failed to share local desktop', error);
1534
 
1531
 
1535
-        if (error.name === TrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED) {
1532
+        if (error.name === JitsiTrackErrors.CHROME_EXTENSION_USER_GESTURE_REQUIRED) {
1536
             // If start with screen sharing the extension will fail to install
1533
             // If start with screen sharing the extension will fail to install
1537
             // (if not found), because the request has been triggered by the
1534
             // (if not found), because the request has been triggered by the
1538
             // script. Show a dialog which asks user to click "install" and try
1535
             // script. Show a dialog which asks user to click "install" and try
1544
             );
1541
             );
1545
 
1542
 
1546
             return;
1543
             return;
1547
-        } else if (error.name === TrackErrors.FIREFOX_EXTENSION_NEEDED) {
1544
+        } else if (error.name === JitsiTrackErrors.FIREFOX_EXTENSION_NEEDED) {
1548
             APP.UI.showExtensionRequiredDialog(
1545
             APP.UI.showExtensionRequiredDialog(
1549
                 config.desktopSharingFirefoxExtensionURL
1546
                 config.desktopSharingFirefoxExtensionURL
1550
             );
1547
             );
1553
         }
1550
         }
1554
 
1551
 
1555
         // Handling:
1552
         // Handling:
1556
-        // TrackErrors.PERMISSION_DENIED
1557
-        // TrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
1558
-        // TrackErrors.GENERAL
1553
+        // JitsiTrackErrors.PERMISSION_DENIED
1554
+        // JitsiTrackErrors.CHROME_EXTENSION_INSTALLATION_ERROR
1555
+        // JitsiTrackErrors.GENERAL
1559
         // and any other
1556
         // and any other
1560
         let dialogTxt;
1557
         let dialogTxt;
1561
         let dialogTitleKey;
1558
         let dialogTitleKey;
1562
 
1559
 
1563
-        if (error.name === TrackErrors.PERMISSION_DENIED) {
1560
+        if (error.name === JitsiTrackErrors.PERMISSION_DENIED) {
1564
             dialogTxt = APP.translation.generateTranslationHTML(
1561
             dialogTxt = APP.translation.generateTranslationHTML(
1565
                 "dialog.screenSharingPermissionDeniedError");
1562
                 "dialog.screenSharingPermissionDeniedError");
1566
             dialogTitleKey = "dialog.error";
1563
             dialogTitleKey = "dialog.error";
1577
      */
1574
      */
1578
     _setupListeners() {
1575
     _setupListeners() {
1579
         // add local streams when joined to the conference
1576
         // add local streams when joined to the conference
1580
-        room.on(ConferenceEvents.CONFERENCE_JOINED, () => {
1577
+        room.on(JitsiConferenceEvents.CONFERENCE_JOINED, () => {
1581
             APP.store.dispatch(conferenceJoined(room));
1578
             APP.store.dispatch(conferenceJoined(room));
1582
 
1579
 
1583
             APP.UI.mucJoined();
1580
             APP.UI.mucJoined();
1586
         });
1583
         });
1587
 
1584
 
1588
         room.on(
1585
         room.on(
1589
-            ConferenceEvents.CONFERENCE_LEFT,
1586
+            JitsiConferenceEvents.CONFERENCE_LEFT,
1590
             (...args) => APP.store.dispatch(conferenceLeft(room, ...args)));
1587
             (...args) => APP.store.dispatch(conferenceLeft(room, ...args)));
1591
 
1588
 
1592
         room.on(
1589
         room.on(
1593
-            ConferenceEvents.AUTH_STATUS_CHANGED,
1590
+            JitsiConferenceEvents.AUTH_STATUS_CHANGED,
1594
             (authEnabled, authLogin) =>
1591
             (authEnabled, authLogin) =>
1595
                 APP.UI.updateAuthInfo(authEnabled, authLogin));
1592
                 APP.UI.updateAuthInfo(authEnabled, authLogin));
1596
 
1593
 
1597
-        room.on(ConferenceEvents.PARTCIPANT_FEATURES_CHANGED,
1594
+        room.on(JitsiConferenceEvents.PARTCIPANT_FEATURES_CHANGED,
1598
             user => APP.UI.onUserFeaturesChanged(user));
1595
             user => APP.UI.onUserFeaturesChanged(user));
1599
-        room.on(ConferenceEvents.USER_JOINED, (id, user) => {
1596
+        room.on(JitsiConferenceEvents.USER_JOINED, (id, user) => {
1600
             if (user.isHidden())
1597
             if (user.isHidden())
1601
                 return;
1598
                 return;
1602
 
1599
 
1614
             APP.UI.updateUserRole(user);
1611
             APP.UI.updateUserRole(user);
1615
         });
1612
         });
1616
 
1613
 
1617
-        room.on(ConferenceEvents.USER_LEFT, (id, user) => {
1614
+        room.on(JitsiConferenceEvents.USER_LEFT, (id, user) => {
1618
             APP.store.dispatch(participantLeft(id, user));
1615
             APP.store.dispatch(participantLeft(id, user));
1619
             logger.log('USER %s LEFT', id, user);
1616
             logger.log('USER %s LEFT', id, user);
1620
             APP.API.notifyUserLeft(id);
1617
             APP.API.notifyUserLeft(id);
1622
             APP.UI.onSharedVideoStop(id);
1619
             APP.UI.onSharedVideoStop(id);
1623
         });
1620
         });
1624
 
1621
 
1625
-        room.on(ConferenceEvents.USER_STATUS_CHANGED, (id, status) => {
1622
+        room.on(JitsiConferenceEvents.USER_STATUS_CHANGED, (id, status) => {
1626
             APP.store.dispatch(participantPresenceChanged(id, status));
1623
             APP.store.dispatch(participantPresenceChanged(id, status));
1627
 
1624
 
1628
             let user = room.getParticipantById(id);
1625
             let user = room.getParticipantById(id);
1631
             }
1628
             }
1632
         });
1629
         });
1633
 
1630
 
1634
-        room.on(ConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1631
+        room.on(JitsiConferenceEvents.USER_ROLE_CHANGED, (id, role) => {
1635
             if (this.isLocalId(id)) {
1632
             if (this.isLocalId(id)) {
1636
                 logger.info(`My role changed, new role: ${role}`);
1633
                 logger.info(`My role changed, new role: ${role}`);
1637
 
1634
 
1651
             }
1648
             }
1652
         });
1649
         });
1653
 
1650
 
1654
-        room.on(ConferenceEvents.TRACK_ADDED, (track) => {
1651
+        room.on(JitsiConferenceEvents.TRACK_ADDED, (track) => {
1655
             if (!track || track.isLocal())
1652
             if (!track || track.isLocal())
1656
                 return;
1653
                 return;
1657
 
1654
 
1658
             APP.store.dispatch(trackAdded(track));
1655
             APP.store.dispatch(trackAdded(track));
1659
         });
1656
         });
1660
 
1657
 
1661
-        room.on(ConferenceEvents.TRACK_REMOVED, (track) => {
1658
+        room.on(JitsiConferenceEvents.TRACK_REMOVED, (track) => {
1662
             if (!track || track.isLocal())
1659
             if (!track || track.isLocal())
1663
                 return;
1660
                 return;
1664
 
1661
 
1665
             APP.store.dispatch(trackRemoved(track));
1662
             APP.store.dispatch(trackRemoved(track));
1666
         });
1663
         });
1667
 
1664
 
1668
-        room.on(ConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED, (id, lvl) => {
1665
+        room.on(JitsiConferenceEvents.TRACK_AUDIO_LEVEL_CHANGED, (id, lvl) => {
1669
             if (this.isLocalId(id)
1666
             if (this.isLocalId(id)
1670
                 && this.localAudio && this.localAudio.isMuted()) {
1667
                 && this.localAudio && this.localAudio.isMuted()) {
1671
                 lvl = 0;
1668
                 lvl = 0;
1680
             APP.UI.setAudioLevel(id, lvl);
1677
             APP.UI.setAudioLevel(id, lvl);
1681
         });
1678
         });
1682
 
1679
 
1683
-        room.on(ConferenceEvents.TALK_WHILE_MUTED, () => {
1680
+        room.on(JitsiConferenceEvents.TALK_WHILE_MUTED, () => {
1684
             APP.UI.showToolbar(6000);
1681
             APP.UI.showToolbar(6000);
1685
 
1682
 
1686
             APP.UI.showCustomToolbarPopup(
1683
             APP.UI.showCustomToolbarPopup(
1688
         });
1685
         });
1689
 
1686
 
1690
         room.on(
1687
         room.on(
1691
-            ConferenceEvents.LAST_N_ENDPOINTS_CHANGED,
1688
+            JitsiConferenceEvents.LAST_N_ENDPOINTS_CHANGED,
1692
             (leavingIds, enteringIds) =>
1689
             (leavingIds, enteringIds) =>
1693
                 APP.UI.handleLastNEndpoints(leavingIds, enteringIds));
1690
                 APP.UI.handleLastNEndpoints(leavingIds, enteringIds));
1694
 
1691
 
1695
         room.on(
1692
         room.on(
1696
-            ConferenceEvents.P2P_STATUS,
1693
+            JitsiConferenceEvents.P2P_STATUS,
1697
             (jitsiConference, p2p) => APP.store.dispatch(p2pStatusChanged(p2p)));
1694
             (jitsiConference, p2p) => APP.store.dispatch(p2pStatusChanged(p2p)));
1698
 
1695
 
1699
         room.on(
1696
         room.on(
1700
-            ConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
1697
+            JitsiConferenceEvents.PARTICIPANT_CONN_STATUS_CHANGED,
1701
             (id, connectionStatus) => {
1698
             (id, connectionStatus) => {
1702
                 APP.store.dispatch(participantConnectionStatusChanged(
1699
                 APP.store.dispatch(participantConnectionStatusChanged(
1703
                     id, connectionStatus));
1700
                     id, connectionStatus));
1704
 
1701
 
1705
                 APP.UI.participantConnectionStatusChanged(id);
1702
                 APP.UI.participantConnectionStatusChanged(id);
1706
             });
1703
             });
1707
-        room.on(ConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => {
1704
+        room.on(JitsiConferenceEvents.DOMINANT_SPEAKER_CHANGED, (id) => {
1708
             APP.store.dispatch(dominantSpeakerChanged(id));
1705
             APP.store.dispatch(dominantSpeakerChanged(id));
1709
 
1706
 
1710
             if (this.isLocalId(id)) {
1707
             if (this.isLocalId(id)) {
1721
         });
1718
         });
1722
 
1719
 
1723
         if (!interfaceConfig.filmStripOnly) {
1720
         if (!interfaceConfig.filmStripOnly) {
1724
-            room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
1721
+            room.on(JitsiConferenceEvents.CONNECTION_INTERRUPTED, () => {
1725
                 APP.UI.markVideoInterrupted(true);
1722
                 APP.UI.markVideoInterrupted(true);
1726
             });
1723
             });
1727
-            room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
1724
+            room.on(JitsiConferenceEvents.CONNECTION_RESTORED, () => {
1728
                 APP.UI.markVideoInterrupted(false);
1725
                 APP.UI.markVideoInterrupted(false);
1729
             });
1726
             });
1730
 
1727
 
1731
             if (isButtonEnabled('chat')) {
1728
             if (isButtonEnabled('chat')) {
1732
-                room.on(ConferenceEvents.MESSAGE_RECEIVED, (id, body, ts) => {
1729
+                room.on(JitsiConferenceEvents.MESSAGE_RECEIVED, (id, body, ts) => {
1733
                     let nick = getDisplayName(id);
1730
                     let nick = getDisplayName(id);
1734
                     APP.API.notifyReceivedChatMessage({
1731
                     APP.API.notifyReceivedChatMessage({
1735
                         id,
1732
                         id,
1767
                 () => this._displayAudioOnlyTooltip('videoMute'));
1764
                 () => this._displayAudioOnlyTooltip('videoMute'));
1768
         }
1765
         }
1769
 
1766
 
1770
-        room.on(ConferenceEvents.CONNECTION_INTERRUPTED, () => {
1767
+        room.on(JitsiConferenceEvents.CONNECTION_INTERRUPTED, () => {
1771
             APP.store.dispatch(localParticipantConnectionStatusChanged(
1768
             APP.store.dispatch(localParticipantConnectionStatusChanged(
1772
-                participantConnectionStatus.INTERRUPTED));
1769
+                JitsiParticipantConnectionStatus.INTERRUPTED));
1773
 
1770
 
1774
             APP.UI.showLocalConnectionInterrupted(true);
1771
             APP.UI.showLocalConnectionInterrupted(true);
1775
         });
1772
         });
1776
 
1773
 
1777
-        room.on(ConferenceEvents.CONNECTION_RESTORED, () => {
1774
+        room.on(JitsiConferenceEvents.CONNECTION_RESTORED, () => {
1778
             APP.store.dispatch(localParticipantConnectionStatusChanged(
1775
             APP.store.dispatch(localParticipantConnectionStatusChanged(
1779
-                participantConnectionStatus.ACTIVE));
1776
+                JitsiParticipantConnectionStatus.ACTIVE));
1780
 
1777
 
1781
             APP.UI.showLocalConnectionInterrupted(false);
1778
             APP.UI.showLocalConnectionInterrupted(false);
1782
         });
1779
         });
1783
 
1780
 
1784
-        room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, (id, displayName) => {
1781
+        room.on(JitsiConferenceEvents.DISPLAY_NAME_CHANGED, (id, displayName) => {
1785
             const formattedDisplayName
1782
             const formattedDisplayName
1786
                 = displayName.substr(0, MAX_DISPLAY_NAME_LENGTH);
1783
                 = displayName.substr(0, MAX_DISPLAY_NAME_LENGTH);
1787
             APP.store.dispatch(participantUpdated({
1784
             APP.store.dispatch(participantUpdated({
1793
         });
1790
         });
1794
 
1791
 
1795
         room.on(
1792
         room.on(
1796
-            ConferenceEvents.LOCK_STATE_CHANGED,
1793
+            JitsiConferenceEvents.LOCK_STATE_CHANGED,
1797
             (...args) => APP.store.dispatch(lockStateChanged(room, ...args)));
1794
             (...args) => APP.store.dispatch(lockStateChanged(room, ...args)));
1798
 
1795
 
1799
         APP.remoteControl.on(RemoteControlEvents.ACTIVE_CHANGED, isActive => {
1796
         APP.remoteControl.on(RemoteControlEvents.ACTIVE_CHANGED, isActive => {
1805
         });
1802
         });
1806
 
1803
 
1807
         room.on(
1804
         room.on(
1808
-            ConferenceEvents.PARTICIPANT_PROPERTY_CHANGED,
1805
+            JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED,
1809
             (participant, name, oldValue, newValue) => {
1806
             (participant, name, oldValue, newValue) => {
1810
                 switch (name) {
1807
                 switch (name) {
1811
                 case 'raisedHand':
1808
                 case 'raisedHand':
1821
                 }
1818
                 }
1822
             });
1819
             });
1823
 
1820
 
1824
-        room.on(ConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
1821
+        room.on(JitsiConferenceEvents.RECORDER_STATE_CHANGED, (status, error) => {
1825
             logger.log("Received recorder status change: ", status, error);
1822
             logger.log("Received recorder status change: ", status, error);
1826
             APP.UI.updateRecordingState(status);
1823
             APP.UI.updateRecordingState(status);
1827
         });
1824
         });
1828
 
1825
 
1829
-        room.on(ConferenceEvents.KICKED, () => {
1826
+        room.on(JitsiConferenceEvents.KICKED, () => {
1830
             APP.UI.hideStats();
1827
             APP.UI.hideStats();
1831
             APP.UI.notifyKicked();
1828
             APP.UI.notifyKicked();
1832
             // FIXME close
1829
             // FIXME close
1833
         });
1830
         });
1834
 
1831
 
1835
-        room.on(ConferenceEvents.SUSPEND_DETECTED, () => {
1832
+        room.on(JitsiConferenceEvents.SUSPEND_DETECTED, () => {
1836
             APP.store.dispatch(suspendDetected());
1833
             APP.store.dispatch(suspendDetected());
1837
             // After wake up, we will be in a state where conference is left
1834
             // After wake up, we will be in a state where conference is left
1838
             // there will be dialog shown to user.
1835
             // there will be dialog shown to user.
1843
             // on resume after suspending PC.
1840
             // on resume after suspending PC.
1844
             if (this.deviceChangeListener)
1841
             if (this.deviceChangeListener)
1845
                 JitsiMeetJS.mediaDevices.removeEventListener(
1842
                 JitsiMeetJS.mediaDevices.removeEventListener(
1846
-                    JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
1843
+                    JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED,
1847
                     this.deviceChangeListener);
1844
                     this.deviceChangeListener);
1848
 
1845
 
1849
             // stop local video
1846
             // stop local video
1858
             }
1855
             }
1859
         });
1856
         });
1860
 
1857
 
1861
-        room.on(ConferenceEvents.DTMF_SUPPORT_CHANGED, (isDTMFSupported) => {
1858
+        room.on(JitsiConferenceEvents.DTMF_SUPPORT_CHANGED, (isDTMFSupported) => {
1862
             APP.UI.updateDTMFSupport(isDTMFSupported);
1859
             APP.UI.updateDTMFSupport(isDTMFSupported);
1863
         });
1860
         });
1864
 
1861
 
1921
             }
1918
             }
1922
         );
1919
         );
1923
         room.on(
1920
         room.on(
1924
-            ConferenceEvents.START_MUTED_POLICY_CHANGED,
1921
+            JitsiConferenceEvents.START_MUTED_POLICY_CHANGED,
1925
             ({ audio, video }) => {
1922
             ({ audio, video }) => {
1926
                 APP.UI.onStartMutedChanged(audio, video);
1923
                 APP.UI.onStartMutedChanged(audio, video);
1927
             }
1924
             }
1928
         );
1925
         );
1929
-        room.on(ConferenceEvents.STARTED_MUTED, () => {
1926
+        room.on(JitsiConferenceEvents.STARTED_MUTED, () => {
1930
             (room.isStartAudioMuted() || room.isStartVideoMuted())
1927
             (room.isStartAudioMuted() || room.isStartVideoMuted())
1931
                 && APP.UI.notifyInitiallyMuted();
1928
                 && APP.UI.notifyInitiallyMuted();
1932
         });
1929
         });
1933
 
1930
 
1934
         room.on(
1931
         room.on(
1935
-            ConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) {
1932
+            JitsiConferenceEvents.AVAILABLE_DEVICES_CHANGED, function (id, devices) {
1936
                 APP.UI.updateDevicesAvailability(id, devices);
1933
                 APP.UI.updateDevicesAvailability(id, devices);
1937
             }
1934
             }
1938
         );
1935
         );
1939
 
1936
 
1940
         room.on(
1937
         room.on(
1941
-            ConferenceEvents.DATA_CHANNEL_OPENED, () => {
1938
+            JitsiConferenceEvents.DATA_CHANNEL_OPENED, () => {
1942
                 APP.store.dispatch(dataChannelOpened());
1939
                 APP.store.dispatch(dataChannelOpened());
1943
             }
1940
             }
1944
         );
1941
         );
1989
         APP.UI.addListener(UIEvents.SUBJECT_CHANGED, (topic) => {
1986
         APP.UI.addListener(UIEvents.SUBJECT_CHANGED, (topic) => {
1990
             room.setSubject(topic);
1987
             room.setSubject(topic);
1991
         });
1988
         });
1992
-        room.on(ConferenceEvents.SUBJECT_CHANGED, function (subject) {
1989
+        room.on(JitsiConferenceEvents.SUBJECT_CHANGED, function (subject) {
1993
             APP.UI.setSubject(subject);
1990
             APP.UI.setSubject(subject);
1994
         });
1991
         });
1995
 
1992
 
2152
     },
2149
     },
2153
     /**
2150
     /**
2154
     * Adds any room listener.
2151
     * Adds any room listener.
2155
-    * @param {string} eventName one of the ConferenceEvents
2152
+    * @param {string} eventName one of the JitsiConferenceEvents
2156
     * @param {Function} listener the function to be called when the event
2153
     * @param {Function} listener the function to be called when the event
2157
     * occurs
2154
     * occurs
2158
     */
2155
     */
2162
 
2159
 
2163
     /**
2160
     /**
2164
     * Removes any room listener.
2161
     * Removes any room listener.
2165
-    * @param {string} eventName one of the ConferenceEvents
2162
+    * @param {string} eventName one of the JitsiConferenceEvents
2166
     * @param {Function} listener the listener to be removed.
2163
     * @param {Function} listener the listener to be removed.
2167
     */
2164
     */
2168
     removeConferenceListener(eventName, listener) {
2165
     removeConferenceListener(eventName, listener) {
2202
                         window.setTimeout(
2199
                         window.setTimeout(
2203
                             () => this._onDeviceListChanged(devices), 0);
2200
                             () => this._onDeviceListChanged(devices), 0);
2204
                     JitsiMeetJS.mediaDevices.addEventListener(
2201
                     JitsiMeetJS.mediaDevices.addEventListener(
2205
-                        JitsiMeetJS.events.mediaDevices.DEVICE_LIST_CHANGED,
2202
+                        JitsiMediaDevicesEvents.DEVICE_LIST_CHANGED,
2206
                         this.deviceChangeListener);
2203
                         this.deviceChangeListener);
2207
                 }
2204
                 }
2208
             })
2205
             })

+ 10
- 10
connection.js Просмотреть файл

8
     connectionFailed
8
     connectionFailed
9
 } from './react/features/base/connection';
9
 } from './react/features/base/connection';
10
 import {
10
 import {
11
-    isFatalJitsiConnectionError
11
+    isFatalJitsiConnectionError,
12
+    JitsiConnectionErrors,
13
+    JitsiConnectionEvents
12
 } from './react/features/base/lib-jitsi-meet';
14
 } from './react/features/base/lib-jitsi-meet';
13
 
15
 
14
-const ConnectionEvents = JitsiMeetJS.events.connection;
15
-const ConnectionErrors = JitsiMeetJS.errors.connection;
16
 const logger = require("jitsi-meet-logger").getLogger(__filename);
16
 const logger = require("jitsi-meet-logger").getLogger(__filename);
17
 
17
 
18
 /**
18
 /**
74
 
74
 
75
     return new Promise(function (resolve, reject) {
75
     return new Promise(function (resolve, reject) {
76
         connection.addEventListener(
76
         connection.addEventListener(
77
-            ConnectionEvents.CONNECTION_ESTABLISHED,
77
+            JitsiConnectionEvents.CONNECTION_ESTABLISHED,
78
             handleConnectionEstablished);
78
             handleConnectionEstablished);
79
         connection.addEventListener(
79
         connection.addEventListener(
80
-            ConnectionEvents.CONNECTION_FAILED,
80
+            JitsiConnectionEvents.CONNECTION_FAILED,
81
             handleConnectionFailed);
81
             handleConnectionFailed);
82
         connection.addEventListener(
82
         connection.addEventListener(
83
-            ConnectionEvents.CONNECTION_FAILED,
83
+            JitsiConnectionEvents.CONNECTION_FAILED,
84
             connectionFailedHandler);
84
             connectionFailedHandler);
85
 
85
 
86
         function connectionFailedHandler(error, message, credentials) {
86
         function connectionFailedHandler(error, message, credentials) {
89
 
89
 
90
             if (isFatalJitsiConnectionError(error)) {
90
             if (isFatalJitsiConnectionError(error)) {
91
                 connection.removeEventListener(
91
                 connection.removeEventListener(
92
-                    ConnectionEvents.CONNECTION_FAILED,
92
+                    JitsiConnectionEvents.CONNECTION_FAILED,
93
                     connectionFailedHandler);
93
                     connectionFailedHandler);
94
             }
94
             }
95
         }
95
         }
96
 
96
 
97
         function unsubscribe() {
97
         function unsubscribe() {
98
             connection.removeEventListener(
98
             connection.removeEventListener(
99
-                ConnectionEvents.CONNECTION_ESTABLISHED,
99
+                JitsiConnectionEvents.CONNECTION_ESTABLISHED,
100
                 handleConnectionEstablished);
100
                 handleConnectionEstablished);
101
             connection.removeEventListener(
101
             connection.removeEventListener(
102
-                ConnectionEvents.CONNECTION_FAILED,
102
+                JitsiConnectionEvents.CONNECTION_FAILED,
103
                 handleConnectionFailed);
103
                 handleConnectionFailed);
104
         }
104
         }
105
 
105
 
149
         if (retry) {
149
         if (retry) {
150
             const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
150
             const { issuer, jwt } = APP.store.getState()['features/base/jwt'];
151
 
151
 
152
-            if (err === ConnectionErrors.PASSWORD_REQUIRED
152
+            if (err === JitsiConnectionErrors.PASSWORD_REQUIRED
153
                     && (!jwt || issuer === 'anonymous')) {
153
                     && (!jwt || issuer === 'anonymous')) {
154
                 return AuthHandler.requestAuth(roomName, connect);
154
                 return AuthHandler.requestAuth(roomName, connect);
155
             }
155
             }

+ 29
- 23
modules/UI/UI.js Просмотреть файл

1
-/* global APP, JitsiMeetJS, $, config, interfaceConfig */
1
+/* global APP, $, config, interfaceConfig */
2
 
2
 
3
 const logger = require("jitsi-meet-logger").getLogger(__filename);
3
 const logger = require("jitsi-meet-logger").getLogger(__filename);
4
 
4
 
22
 import Settings from "./../settings/Settings";
22
 import Settings from "./../settings/Settings";
23
 
23
 
24
 import { updateDeviceList } from '../../react/features/base/devices';
24
 import { updateDeviceList } from '../../react/features/base/devices';
25
+import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
25
 import {
26
 import {
26
     openDeviceSelectionDialog
27
     openDeviceSelectionDialog
27
 } from '../../react/features/device-selection';
28
 } from '../../react/features/device-selection';
54
 
55
 
55
 let followMeHandler;
56
 let followMeHandler;
56
 
57
 
57
-const TrackErrors = JitsiMeetJS.errors.track;
58
-
59
 const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
58
 const JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP = {
60
     microphone: {},
59
     microphone: {},
61
     camera: {}
60
     camera: {}
62
 };
61
 };
63
 
62
 
64
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.UNSUPPORTED_RESOLUTION]
65
-    = "dialog.cameraUnsupportedResolutionError";
66
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.GENERAL]
63
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
64
+    .camera[JitsiTrackErrors.UNSUPPORTED_RESOLUTION]
65
+        = "dialog.cameraUnsupportedResolutionError";
66
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[JitsiTrackErrors.GENERAL]
67
     = "dialog.cameraUnknownError";
67
     = "dialog.cameraUnknownError";
68
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.PERMISSION_DENIED]
68
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[JitsiTrackErrors.PERMISSION_DENIED]
69
     = "dialog.cameraPermissionDeniedError";
69
     = "dialog.cameraPermissionDeniedError";
70
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.NOT_FOUND]
70
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[JitsiTrackErrors.NOT_FOUND]
71
     = "dialog.cameraNotFoundError";
71
     = "dialog.cameraNotFoundError";
72
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.CONSTRAINT_FAILED]
72
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[JitsiTrackErrors.CONSTRAINT_FAILED]
73
     = "dialog.cameraConstraintFailedError";
73
     = "dialog.cameraConstraintFailedError";
74
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.NO_DATA_FROM_SOURCE]
75
-    = "dialog.cameraNotSendingData";
76
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.GENERAL]
74
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
75
+    .camera[JitsiTrackErrors.NO_DATA_FROM_SOURCE]
76
+        = "dialog.cameraNotSendingData";
77
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[JitsiTrackErrors.GENERAL]
77
     = "dialog.micUnknownError";
78
     = "dialog.micUnknownError";
78
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.PERMISSION_DENIED]
79
-    = "dialog.micPermissionDeniedError";
80
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.NOT_FOUND]
79
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
80
+    .microphone[JitsiTrackErrors.PERMISSION_DENIED]
81
+        = "dialog.micPermissionDeniedError";
82
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[JitsiTrackErrors.NOT_FOUND]
81
     = "dialog.micNotFoundError";
83
     = "dialog.micNotFoundError";
82
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.CONSTRAINT_FAILED]
83
-    = "dialog.micConstraintFailedError";
84
-JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.NO_DATA_FROM_SOURCE]
85
-    = "dialog.micNotSendingData";
84
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
85
+    .microphone[JitsiTrackErrors.CONSTRAINT_FAILED]
86
+        = "dialog.micConstraintFailedError";
87
+JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
88
+    .microphone[JitsiTrackErrors.NO_DATA_FROM_SOURCE]
89
+        = "dialog.micNotSendingData";
86
 
90
 
87
 /**
91
 /**
88
  * Toggles the application in and out of full screen mode
92
  * Toggles the application in and out of full screen mode
1073
     const micJitsiTrackErrorMsg
1077
     const micJitsiTrackErrorMsg
1074
         = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[name];
1078
         = JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[name];
1075
     const micErrorMsg = micJitsiTrackErrorMsg
1079
     const micErrorMsg = micJitsiTrackErrorMsg
1076
-        || JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.microphone[TrackErrors.GENERAL];
1080
+        || JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
1081
+            .microphone[JitsiTrackErrors.GENERAL];
1077
     const additionalMicErrorMsg = micJitsiTrackErrorMsg ? null : message;
1082
     const additionalMicErrorMsg = micJitsiTrackErrorMsg ? null : message;
1078
 
1083
 
1079
     APP.store.dispatch(maybeShowNotificationWithDoNotDisplay(
1084
     APP.store.dispatch(maybeShowNotificationWithDoNotDisplay(
1083
             messageKey: micErrorMsg,
1088
             messageKey: micErrorMsg,
1084
             showToggle: Boolean(micJitsiTrackErrorMsg),
1089
             showToggle: Boolean(micJitsiTrackErrorMsg),
1085
             subtitleKey: 'dialog.micErrorPresent',
1090
             subtitleKey: 'dialog.micErrorPresent',
1086
-            titleKey: name === TrackErrors.PERMISSION_DENIED
1091
+            titleKey: name === JitsiTrackErrors.PERMISSION_DENIED
1087
                 ? 'deviceError.microphonePermission' : 'dialog.error',
1092
                 ? 'deviceError.microphonePermission' : 'dialog.error',
1088
             toggleLabelKey: 'dialog.doNotShowWarningAgain'
1093
             toggleLabelKey: 'dialog.doNotShowWarningAgain'
1089
         }));
1094
         }));
1108
     const cameraJitsiTrackErrorMsg =
1113
     const cameraJitsiTrackErrorMsg =
1109
         JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[name];
1114
         JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[name];
1110
     const cameraErrorMsg = cameraJitsiTrackErrorMsg
1115
     const cameraErrorMsg = cameraJitsiTrackErrorMsg
1111
-        || JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP.camera[TrackErrors.GENERAL];
1116
+        || JITSI_TRACK_ERROR_TO_MESSAGE_KEY_MAP
1117
+            .camera[JitsiTrackErrors.GENERAL];
1112
     const additionalCameraErrorMsg = cameraJitsiTrackErrorMsg ? null : message;
1118
     const additionalCameraErrorMsg = cameraJitsiTrackErrorMsg ? null : message;
1113
 
1119
 
1114
     APP.store.dispatch(maybeShowNotificationWithDoNotDisplay(
1120
     APP.store.dispatch(maybeShowNotificationWithDoNotDisplay(
1118
             messageKey: cameraErrorMsg,
1124
             messageKey: cameraErrorMsg,
1119
             showToggle: Boolean(cameraJitsiTrackErrorMsg),
1125
             showToggle: Boolean(cameraJitsiTrackErrorMsg),
1120
             subtitleKey: 'dialog.cameraErrorPresent',
1126
             subtitleKey: 'dialog.cameraErrorPresent',
1121
-            titleKey: name === TrackErrors.PERMISSION_DENIED
1127
+            titleKey: name === JitsiTrackErrors.PERMISSION_DENIED
1122
                 ? 'deviceError.cameraPermission' : 'dialog.error',
1128
                 ? 'deviceError.cameraPermission' : 'dialog.error',
1123
             toggleLabelKey: 'dialog.doNotShowWarningAgain'
1129
             toggleLabelKey: 'dialog.doNotShowWarningAgain'
1124
         }));
1130
         }));

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

2
 
2
 
3
 import { openConnection } from '../../../connection';
3
 import { openConnection } from '../../../connection';
4
 import { setJWT } from '../../../react/features/base/jwt';
4
 import { setJWT } from '../../../react/features/base/jwt';
5
+import {
6
+    JitsiConnectionErrors
7
+} from '../../../react/features/base/lib-jitsi-meet';
5
 import UIUtil from '../util/UIUtil';
8
 import UIUtil from '../util/UIUtil';
6
 
9
 
7
 import LoginDialog from './LoginDialog';
10
 import LoginDialog from './LoginDialog';
8
 
11
 
9
-const ConnectionErrors = JitsiMeetJS.errors.connection;
10
 const logger = require("jitsi-meet-logger").getLogger(__filename);
12
 const logger = require("jitsi-meet-logger").getLogger(__filename);
11
 
13
 
12
 let externalAuthWindow;
14
 let externalAuthWindow;
247
                     authDialog.close();
249
                     authDialog.close();
248
                     resolve(connection);
250
                     resolve(connection);
249
                 }, function (err) {
251
                 }, function (err) {
250
-                    if (err === ConnectionErrors.PASSWORD_REQUIRED) {
252
+                    if (err === JitsiConnectionErrors.PASSWORD_REQUIRED) {
251
                         authDialog.displayError(err);
253
                         authDialog.displayError(err);
252
                     } else {
254
                     } else {
253
                         authDialog.close();
255
                         authDialog.close();
266
  * @param {string} [roomName] name of the conference room
268
  * @param {string} [roomName] name of the conference room
267
  * @param {function(id, password, roomName)} [connect] function that returns
269
  * @param {function(id, password, roomName)} [connect] function that returns
268
  * a Promise which resolves with JitsiConnection or fails with one of
270
  * a Promise which resolves with JitsiConnection or fails with one of
269
- * ConnectionErrors.
271
+ * JitsiConnectionErrors.
270
  * @returns {Promise<JitsiConnection>}
272
  * @returns {Promise<JitsiConnection>}
271
  */
273
  */
272
 function requestAuth(roomName, connect) {
274
 function requestAuth(roomName, connect) {

+ 6
- 5
modules/UI/authentication/LoginDialog.js Просмотреть файл

1
-/* global $, APP, config, JitsiMeetJS */
1
+/* global $, APP, config */
2
 
2
 
3
 import { toJid } from '../../../react/features/base/connection';
3
 import { toJid } from '../../../react/features/base/connection';
4
-
5
-const ConnectionErrors = JitsiMeetJS.errors.connection;
4
+import {
5
+    JitsiConnectionErrors
6
+} from '../../../react/features/base/lib-jitsi-meet';
6
 
7
 
7
 /**
8
 /**
8
  * Build html for "password required" dialog.
9
  * Build html for "password required" dialog.
14
         : "user@domain.net";
15
         : "user@domain.net";
15
 
16
 
16
     return `
17
     return `
17
-        <input name="username" type="text" 
18
+        <input name="username" type="text"
18
                class="input-control"
19
                class="input-control"
19
                placeholder=${placeholder} autofocus>
20
                placeholder=${placeholder} autofocus>
20
         <input name="password" type="password"
21
         <input name="password" type="password"
121
         let errorMessageElem = finishedState.find('#errorMessage');
122
         let errorMessageElem = finishedState.find('#errorMessage');
122
 
123
 
123
         let messageKey;
124
         let messageKey;
124
-        if (error === ConnectionErrors.PASSWORD_REQUIRED) {
125
+        if (error === JitsiConnectionErrors.PASSWORD_REQUIRED) {
125
             // this is a password required error, as login window was already
126
             // this is a password required error, as login window was already
126
             // open once, this means username or password is wrong
127
             // open once, this means username or password is wrong
127
             messageKey = 'dialog.incorrectPassword';
128
             messageKey = 'dialog.incorrectPassword';

+ 22
- 21
modules/UI/recording/Recording.js Просмотреть файл

20
 import UIUtil from '../util/UIUtil';
20
 import UIUtil from '../util/UIUtil';
21
 import VideoLayout from '../videolayout/VideoLayout';
21
 import VideoLayout from '../videolayout/VideoLayout';
22
 
22
 
23
+import {
24
+    JitsiRecordingStatus
25
+} from '../../../react/features/base/lib-jitsi-meet';
23
 import { setToolboxEnabled } from '../../../react/features/toolbox';
26
 import { setToolboxEnabled } from '../../../react/features/toolbox';
24
 import { setNotificationsEnabled } from '../../../react/features/notifications';
27
 import { setNotificationsEnabled } from '../../../react/features/notifications';
25
 import {
28
 import {
27
     updateRecordingState
30
     updateRecordingState
28
 } from '../../../react/features/recording';
31
 } from '../../../react/features/recording';
29
 
32
 
30
-const Status = JitsiMeetJS.constants.recordingStatus;
31
-
32
 /**
33
 /**
33
  * Translation keys to use for display in the UI when recording the conference
34
  * Translation keys to use for display in the UI when recording the conference
34
  * but not streaming live.
35
  * but not streaming live.
240
 
241
 
241
 /**
242
 /**
242
  * Checks whether if the given status is either PENDING or RETRYING
243
  * Checks whether if the given status is either PENDING or RETRYING
243
- * @param status {Status} Jibri status to be checked
244
+ * @param status {JitsiRecordingStatus} Jibri status to be checked
244
  * @returns {boolean} true if the condition is met or false otherwise.
245
  * @returns {boolean} true if the condition is met or false otherwise.
245
  */
246
  */
246
 function isStartingStatus(status) {
247
 function isStartingStatus(status) {
247
-    return status === Status.PENDING || status === Status.RETRYING;
248
+    return status === JitsiRecordingStatus.PENDING || status === JitsiRecordingStatus.RETRYING;
248
 }
249
 }
249
 
250
 
250
 /**
251
 /**
340
         let labelDisplayConfiguration;
341
         let labelDisplayConfiguration;
341
 
342
 
342
         switch (recordingState) {
343
         switch (recordingState) {
343
-        case Status.ON:
344
-        case Status.RETRYING: {
344
+        case JitsiRecordingStatus.ON:
345
+        case JitsiRecordingStatus.RETRYING: {
345
             labelDisplayConfiguration = {
346
             labelDisplayConfiguration = {
346
                 centered: false,
347
                 centered: false,
347
                 key: this.recordingOnKey,
348
                 key: this.recordingOnKey,
348
-                showSpinner: recordingState === Status.RETRYING
349
+                showSpinner: recordingState === JitsiRecordingStatus.RETRYING
349
             };
350
             };
350
 
351
 
351
             this._setToolbarButtonToggled(true);
352
             this._setToolbarButtonToggled(true);
353
             break;
354
             break;
354
         }
355
         }
355
 
356
 
356
-        case Status.OFF:
357
-        case Status.BUSY:
358
-        case Status.FAILED:
359
-        case Status.UNAVAILABLE: {
357
+        case JitsiRecordingStatus.OFF:
358
+        case JitsiRecordingStatus.BUSY:
359
+        case JitsiRecordingStatus.FAILED:
360
+        case JitsiRecordingStatus.UNAVAILABLE: {
360
             const wasInStartingStatus = isStartingStatus(oldState);
361
             const wasInStartingStatus = isStartingStatus(oldState);
361
 
362
 
362
             // We don't want UI changes if this is an availability change.
363
             // We don't want UI changes if this is an availability change.
363
-            if (oldState !== Status.ON && !wasInStartingStatus) {
364
+            if (oldState !== JitsiRecordingStatus.ON && !wasInStartingStatus) {
364
                 APP.store.dispatch(updateRecordingState({ recordingState }));
365
                 APP.store.dispatch(updateRecordingState({ recordingState }));
365
                 return;
366
                 return;
366
             }
367
             }
381
             break;
382
             break;
382
         }
383
         }
383
 
384
 
384
-        case Status.PENDING: {
385
+        case JitsiRecordingStatus.PENDING: {
385
             labelDisplayConfiguration = {
386
             labelDisplayConfiguration = {
386
                 centered: true,
387
                 centered: true,
387
                 key: this.recordingPendingKey
388
                 key: this.recordingPendingKey
392
             break;
393
             break;
393
         }
394
         }
394
 
395
 
395
-        case Status.ERROR: {
396
+        case JitsiRecordingStatus.ERROR: {
396
             labelDisplayConfiguration = {
397
             labelDisplayConfiguration = {
397
                 centered: true,
398
                 centered: true,
398
                 key: this.recordingErrorKey
399
                 key: this.recordingErrorKey
404
         }
405
         }
405
 
406
 
406
         // Return an empty label display configuration to indicate no label
407
         // Return an empty label display configuration to indicate no label
407
-        // should be displayed. The Status.AVAIABLE case is handled here.
408
+        // should be displayed. The JitsiRecordingStatus.AVAIABLE case is handled here.
408
         default: {
409
         default: {
409
             labelDisplayConfiguration = null;
410
             labelDisplayConfiguration = null;
410
         }
411
         }
438
 
439
 
439
         JitsiMeetJS.analytics.sendEvent('recording.clicked');
440
         JitsiMeetJS.analytics.sendEvent('recording.clicked');
440
         switch (this.currentState) {
441
         switch (this.currentState) {
441
-        case Status.ON:
442
-        case Status.RETRYING:
443
-        case Status.PENDING: {
442
+        case JitsiRecordingStatus.ON:
443
+        case JitsiRecordingStatus.RETRYING:
444
+        case JitsiRecordingStatus.PENDING: {
444
             _showStopRecordingPrompt(this.recordingType).then(
445
             _showStopRecordingPrompt(this.recordingType).then(
445
                 () => {
446
                 () => {
446
                     this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED);
447
                     this.eventEmitter.emit(UIEvents.RECORDING_TOGGLED);
449
                 () => {});
450
                 () => {});
450
             break;
451
             break;
451
         }
452
         }
452
-        case Status.AVAILABLE:
453
-        case Status.OFF: {
453
+        case JitsiRecordingStatus.AVAILABLE:
454
+        case JitsiRecordingStatus.OFF: {
454
             if (this.recordingType === 'jibri')
455
             if (this.recordingType === 'jibri')
455
                 _requestLiveStreamId().then(streamId => {
456
                 _requestLiveStreamId().then(streamId => {
456
                     this.eventEmitter.emit(
457
                     this.eventEmitter.emit(
486
             }
487
             }
487
             break;
488
             break;
488
         }
489
         }
489
-        case Status.BUSY: {
490
+        case JitsiRecordingStatus.BUSY: {
490
             dialog = APP.UI.messageHandler.openMessageDialog(
491
             dialog = APP.UI.messageHandler.openMessageDialog(
491
                 this.recordingTitle,
492
                 this.recordingTitle,
492
                 this.recordingBusy,
493
                 this.recordingBusy,

+ 9
- 7
modules/UI/videolayout/LargeVideoManager.js Просмотреть файл

9
 
9
 
10
 const logger = require("jitsi-meet-logger").getLogger(__filename);
10
 const logger = require("jitsi-meet-logger").getLogger(__filename);
11
 
11
 
12
+import {
13
+    JitsiParticipantConnectionStatus
14
+} from '../../../react/features/base/lib-jitsi-meet';
12
 import {
15
 import {
13
     updateKnownLargeVideoResolution
16
     updateKnownLargeVideoResolution
14
 } from '../../../react/features/large-video';
17
 } from '../../../react/features/large-video';
21
 
24
 
22
 import AudioLevels from "../audio_levels/AudioLevels";
25
 import AudioLevels from "../audio_levels/AudioLevels";
23
 
26
 
24
-const ParticipantConnectionStatus
25
-    = JitsiMeetJS.constants.participantConnectionStatus;
26
 const DESKTOP_CONTAINER_TYPE = 'desktop';
27
 const DESKTOP_CONTAINER_TYPE = 'desktop';
27
 /**
28
 /**
28
  * The time interval in milliseconds to check the video resolution of the video
29
  * The time interval in milliseconds to check the video resolution of the video
211
                 = !isVideoMuted
212
                 = !isVideoMuted
212
                     && (APP.conference.isLocalId(id)
213
                     && (APP.conference.isLocalId(id)
213
                         || connectionStatus
214
                         || connectionStatus
214
-                                === ParticipantConnectionStatus.ACTIVE
215
+                                === JitsiParticipantConnectionStatus.ACTIVE
215
                         || wasUsersImageCached);
216
                         || wasUsersImageCached);
216
 
217
 
217
             let showAvatar
218
             let showAvatar
241
 
242
 
242
             const isConnectionInterrupted
243
             const isConnectionInterrupted
243
                 = APP.conference.getParticipantConnectionStatus(id)
244
                 = APP.conference.getParticipantConnectionStatus(id)
244
-                    === ParticipantConnectionStatus.INTERRUPTED;
245
+                    === JitsiParticipantConnectionStatus.INTERRUPTED;
245
             let messageKey = null;
246
             let messageKey = null;
246
 
247
 
247
             if (isConnectionInterrupted) {
248
             if (isConnectionInterrupted) {
248
                 messageKey = "connection.USER_CONNECTION_INTERRUPTED";
249
                 messageKey = "connection.USER_CONNECTION_INTERRUPTED";
249
             } else if (connectionStatus
250
             } else if (connectionStatus
250
-                    === ParticipantConnectionStatus.INACTIVE) {
251
+                    === JitsiParticipantConnectionStatus.INACTIVE) {
251
                 messageKey = "connection.LOW_BANDWIDTH";
252
                 messageKey = "connection.LOW_BANDWIDTH";
252
             }
253
             }
253
 
254
 
494
                 = APP.conference.getParticipantConnectionStatus(this.id);
495
                 = APP.conference.getParticipantConnectionStatus(this.id);
495
 
496
 
496
             show = !APP.conference.isLocalId(this.id)
497
             show = !APP.conference.isLocalId(this.id)
497
-                && (connStatus === ParticipantConnectionStatus.INTERRUPTED
498
-                    || connStatus === ParticipantConnectionStatus.INACTIVE);
498
+                && (connStatus === JitsiParticipantConnectionStatus.INTERRUPTED
499
+                    || connStatus
500
+                        === JitsiParticipantConnectionStatus.INACTIVE);
499
         }
501
         }
500
 
502
 
501
         if (show) {
503
         if (show) {

+ 4
- 5
modules/UI/videolayout/LocalVideo.js Просмотреть файл

1
-/* global $, config, interfaceConfig, APP, JitsiMeetJS */
1
+/* global $, config, interfaceConfig, APP */
2
 
2
 
3
 /* eslint-disable no-unused-vars */
3
 /* eslint-disable no-unused-vars */
4
 import React, { Component } from 'react';
4
 import React, { Component } from 'react';
5
 import ReactDOM from 'react-dom';
5
 import ReactDOM from 'react-dom';
6
 import { Provider } from 'react-redux';
6
 import { Provider } from 'react-redux';
7
 
7
 
8
+import { JitsiTrackEvents } from '../../../react/features/base/lib-jitsi-meet';
8
 import { VideoTrack } from '../../../react/features/base/media';
9
 import { VideoTrack } from '../../../react/features/base/media';
9
 /* eslint-enable no-unused-vars */
10
 /* eslint-enable no-unused-vars */
10
 
11
 
13
 import UIEvents from "../../../service/UI/UIEvents";
14
 import UIEvents from "../../../service/UI/UIEvents";
14
 import SmallVideo from "./SmallVideo";
15
 import SmallVideo from "./SmallVideo";
15
 
16
 
16
-const TrackEvents = JitsiMeetJS.events.track;
17
-
18
 function LocalVideo(VideoLayout, emitter) {
17
 function LocalVideo(VideoLayout, emitter) {
19
     this.videoSpanId = "localVideoContainer";
18
     this.videoSpanId = "localVideoContainer";
20
 
19
 
159
         if (this.isCurrentlyOnLargeVideo()) {
158
         if (this.isCurrentlyOnLargeVideo()) {
160
             this.VideoLayout.updateLargeVideo(this.id);
159
             this.VideoLayout.updateLargeVideo(this.id);
161
         }
160
         }
162
-        stream.off(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
161
+        stream.off(JitsiTrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
163
     };
162
     };
164
-    stream.on(TrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
163
+    stream.on(JitsiTrackEvents.LOCAL_TRACK_STOPPED, endedHandler);
165
 };
164
 };
166
 
165
 
167
 /**
166
 /**

+ 9
- 9
modules/UI/videolayout/RemoteVideo.js Просмотреть файл

1
-/* global $, APP, interfaceConfig, JitsiMeetJS */
1
+/* global $, APP, interfaceConfig */
2
 
2
 
3
 /* eslint-disable no-unused-vars */
3
 /* eslint-disable no-unused-vars */
4
 import React from 'react';
4
 import React from 'react';
7
 import { I18nextProvider } from 'react-i18next';
7
 import { I18nextProvider } from 'react-i18next';
8
 
8
 
9
 import { i18next } from '../../../react/features/base/i18n';
9
 import { i18next } from '../../../react/features/base/i18n';
10
+import {
11
+    JitsiParticipantConnectionStatus
12
+} from '../../../react/features/base/lib-jitsi-meet';
10
 
13
 
11
 import { PresenceLabel } from '../../../react/features/presence-status';
14
 import { PresenceLabel } from '../../../react/features/presence-status';
12
 import {
15
 import {
21
 import SmallVideo from "./SmallVideo";
24
 import SmallVideo from "./SmallVideo";
22
 import UIUtils from "../util/UIUtil";
25
 import UIUtils from "../util/UIUtil";
23
 
26
 
24
-const ParticipantConnectionStatus
25
-    = JitsiMeetJS.constants.participantConnectionStatus;
26
-
27
 /**
27
 /**
28
  * Creates new instance of the <tt>RemoteVideo</tt>.
28
  * Creates new instance of the <tt>RemoteVideo</tt>.
29
  * @param user {JitsiParticipant} the user for whom remote video instance will
29
  * @param user {JitsiParticipant} the user for whom remote video instance will
379
  */
379
  */
380
 RemoteVideo.prototype.isConnectionActive = function() {
380
 RemoteVideo.prototype.isConnectionActive = function() {
381
     return this.user.getConnectionStatus()
381
     return this.user.getConnectionStatus()
382
-        === ParticipantConnectionStatus.ACTIVE;
382
+        === JitsiParticipantConnectionStatus.ACTIVE;
383
 };
383
 };
384
 
384
 
385
 /**
385
 /**
386
  * The remote video is considered "playable" once the stream has started
386
  * The remote video is considered "playable" once the stream has started
387
  * according to the {@link #hasVideoStarted} result.
387
  * according to the {@link #hasVideoStarted} result.
388
  * It will be allowed to display video also in
388
  * It will be allowed to display video also in
389
- * {@link ParticipantConnectionStatus.INTERRUPTED} if the video was ever played
389
+ * {@link JitsiParticipantConnectionStatus.INTERRUPTED} if the video was ever played
390
  * and was not muted while not in ACTIVE state. This basically means that there
390
  * and was not muted while not in ACTIVE state. This basically means that there
391
  * is stalled video image cached that could be displayed. It's used to show
391
  * is stalled video image cached that could be displayed. It's used to show
392
  * "grey video image" in user's thumbnail when there are connectivity issues.
392
  * "grey video image" in user's thumbnail when there are connectivity issues.
400
 
400
 
401
     return SmallVideo.prototype.isVideoPlayable.call(this)
401
     return SmallVideo.prototype.isVideoPlayable.call(this)
402
         && this.hasVideoStarted()
402
         && this.hasVideoStarted()
403
-        && (connectionState === ParticipantConnectionStatus.ACTIVE
404
-            || (connectionState === ParticipantConnectionStatus.INTERRUPTED
403
+        && (connectionState === JitsiParticipantConnectionStatus.ACTIVE
404
+            || (connectionState === JitsiParticipantConnectionStatus.INTERRUPTED
405
                     && !this.mutedWhileDisconnected));
405
                     && !this.mutedWhileDisconnected));
406
 };
406
 };
407
 
407
 
432
     this.updateConnectionStatus(connectionStatus);
432
     this.updateConnectionStatus(connectionStatus);
433
 
433
 
434
     const isInterrupted
434
     const isInterrupted
435
-        = connectionStatus === ParticipantConnectionStatus.INTERRUPTED;
435
+        = connectionStatus === JitsiParticipantConnectionStatus.INTERRUPTED;
436
     // Toggle thumbnail video problem filter
436
     // Toggle thumbnail video problem filter
437
     this.selectVideoElement().toggleClass(
437
     this.selectVideoElement().toggleClass(
438
         "videoThumbnailProblemFilter", isInterrupted);
438
         "videoThumbnailProblemFilter", isInterrupted);

+ 6
- 6
modules/UI/videolayout/VideoLayout.js Просмотреть файл

1
-/* global APP, $, interfaceConfig, JitsiMeetJS  */
1
+/* global APP, $, interfaceConfig  */
2
 const logger = require("jitsi-meet-logger").getLogger(__filename);
2
 const logger = require("jitsi-meet-logger").getLogger(__filename);
3
 
3
 
4
+import {
5
+    JitsiParticipantConnectionStatus
6
+} from '../../../react/features/base/lib-jitsi-meet';
4
 import {
7
 import {
5
     getPinnedParticipant,
8
     getPinnedParticipant,
6
     pinParticipant
9
     pinParticipant
15
 import {VIDEO_CONTAINER_TYPE} from "./VideoContainer";
18
 import {VIDEO_CONTAINER_TYPE} from "./VideoContainer";
16
 import LocalVideo from "./LocalVideo";
19
 import LocalVideo from "./LocalVideo";
17
 
20
 
18
-const ParticipantConnectionStatus
19
-    = JitsiMeetJS.constants.participantConnectionStatus;
20
-
21
 var remoteVideos = {};
21
 var remoteVideos = {};
22
 var localVideoThumbnail = null;
22
 var localVideoThumbnail = null;
23
 
23
 
593
         // states.
593
         // states.
594
         const status
594
         const status
595
             = isInterrupted
595
             = isInterrupted
596
-                ? ParticipantConnectionStatus.INTERRUPTED
597
-                : ParticipantConnectionStatus.ACTIVE;
596
+                ? JitsiParticipantConnectionStatus.INTERRUPTED
597
+                : JitsiParticipantConnectionStatus.ACTIVE;
598
 
598
 
599
         localVideoThumbnail.updateConnectionStatus(status);
599
         localVideoThumbnail.updateConnectionStatus(status);
600
     },
600
     },

+ 12
- 10
modules/remotecontrol/Controller.js Просмотреть файл

2
 
2
 
3
 import { getLogger } from 'jitsi-meet-logger';
3
 import { getLogger } from 'jitsi-meet-logger';
4
 
4
 
5
+import {
6
+    JitsiConferenceEvents
7
+} from '../../react/features/base/lib-jitsi-meet';
5
 import * as KeyCodes from '../keycode/keycode';
8
 import * as KeyCodes from '../keycode/keycode';
6
 import {
9
 import {
7
     EVENTS,
10
     EVENTS,
16
 
19
 
17
 declare var $: Function;
20
 declare var $: Function;
18
 declare var APP: Object;
21
 declare var APP: Object;
19
-declare var JitsiMeetJS: Object;
20
 
22
 
21
-const ConferenceEvents = JitsiMeetJS.events.conference;
22
 const logger = getLogger(__filename);
23
 const logger = getLogger(__filename);
23
 
24
 
24
 /**
25
 /**
122
             const clearRequest = () => {
123
             const clearRequest = () => {
123
                 this._requestedParticipant = null;
124
                 this._requestedParticipant = null;
124
                 APP.conference.removeConferenceListener(
125
                 APP.conference.removeConferenceListener(
125
-                    ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
126
+                    JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
126
                     permissionsReplyListener);
127
                     permissionsReplyListener);
127
                 APP.conference.removeConferenceListener(
128
                 APP.conference.removeConferenceListener(
128
-                    ConferenceEvents.USER_LEFT,
129
+                    JitsiConferenceEvents.USER_LEFT,
129
                     onUserLeft);
130
                     onUserLeft);
130
             };
131
             };
131
 
132
 
156
             };
157
             };
157
 
158
 
158
             APP.conference.addConferenceListener(
159
             APP.conference.addConferenceListener(
159
-                ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
160
+                JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
160
                 permissionsReplyListener);
161
                 permissionsReplyListener);
161
-            APP.conference.addConferenceListener(ConferenceEvents.USER_LEFT,
162
+            APP.conference.addConferenceListener(
163
+                JitsiConferenceEvents.USER_LEFT,
162
                 onUserLeft);
164
                 onUserLeft);
163
             this._requestedParticipant = userId;
165
             this._requestedParticipant = userId;
164
             this.sendRemoteControlEndpointMessage(userId, {
166
             this.sendRemoteControlEndpointMessage(userId, {
240
         APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
242
         APP.UI.addListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
241
             this._largeVideoChangedListener);
243
             this._largeVideoChangedListener);
242
         APP.conference.addConferenceListener(
244
         APP.conference.addConferenceListener(
243
-            ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
245
+            JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
244
             this._stopListener);
246
             this._stopListener);
245
-        APP.conference.addConferenceListener(ConferenceEvents.USER_LEFT,
247
+        APP.conference.addConferenceListener(JitsiConferenceEvents.USER_LEFT,
246
             this._userLeftListener);
248
             this._userLeftListener);
247
         this.resume();
249
         this.resume();
248
     }
250
     }
325
         APP.UI.removeListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
327
         APP.UI.removeListener(UIEvents.LARGE_VIDEO_ID_CHANGED,
326
             this._largeVideoChangedListener);
328
             this._largeVideoChangedListener);
327
         APP.conference.removeConferenceListener(
329
         APP.conference.removeConferenceListener(
328
-            ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
330
+            JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
329
             this._stopListener);
331
             this._stopListener);
330
-        APP.conference.removeConferenceListener(ConferenceEvents.USER_LEFT,
332
+        APP.conference.removeConferenceListener(JitsiConferenceEvents.USER_LEFT,
331
             this._userLeftListener);
333
             this._userLeftListener);
332
         this.pause();
334
         this.pause();
333
         this._controlledParticipant = null;
335
         this._controlledParticipant = null;

+ 9
- 7
modules/remotecontrol/Receiver.js Просмотреть файл

3
 import { getLogger } from 'jitsi-meet-logger';
3
 import { getLogger } from 'jitsi-meet-logger';
4
 
4
 
5
 import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
5
 import * as JitsiMeetConferenceEvents from '../../ConferenceEvents';
6
+import {
7
+    JitsiConferenceEvents
8
+} from '../../react/features/base/lib-jitsi-meet';
6
 import {
9
 import {
7
     openRemoteControlAuthorizationDialog
10
     openRemoteControlAuthorizationDialog
8
 } from '../../react/features/remote-control';
11
 } from '../../react/features/remote-control';
22
 declare var APP: Object;
25
 declare var APP: Object;
23
 declare var config: Object;
26
 declare var config: Object;
24
 declare var interfaceConfig: Object;
27
 declare var interfaceConfig: Object;
25
-declare var JitsiMeetJS: Object;
26
 
28
 
27
-const ConferenceEvents = JitsiMeetJS.events.conference;
28
 const logger = getLogger(__filename);
29
 const logger = getLogger(__filename);
29
 
30
 
30
 /**
31
 /**
92
             // Announce remote control support.
93
             // Announce remote control support.
93
             APP.connection.addFeature(DISCO_REMOTE_CONTROL_FEATURE, true);
94
             APP.connection.addFeature(DISCO_REMOTE_CONTROL_FEATURE, true);
94
             APP.conference.addConferenceListener(
95
             APP.conference.addConferenceListener(
95
-                ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
96
+                JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
96
                 this._remoteControlEventsListener);
97
                 this._remoteControlEventsListener);
97
             APP.conference.addListener(JitsiMeetConferenceEvents.BEFORE_HANGUP,
98
             APP.conference.addListener(JitsiMeetConferenceEvents.BEFORE_HANGUP,
98
                 this._hangupListener);
99
                 this._hangupListener);
101
             this._stop(true);
102
             this._stop(true);
102
             APP.connection.removeFeature(DISCO_REMOTE_CONTROL_FEATURE);
103
             APP.connection.removeFeature(DISCO_REMOTE_CONTROL_FEATURE);
103
             APP.conference.removeConferenceListener(
104
             APP.conference.removeConferenceListener(
104
-                ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
105
+                JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED,
105
                 this._remoteControlEventsListener);
106
                 this._remoteControlEventsListener);
106
             APP.conference.removeListener(
107
             APP.conference.removeListener(
107
                 JitsiMeetConferenceEvents.BEFORE_HANGUP,
108
                 JitsiMeetConferenceEvents.BEFORE_HANGUP,
110
     }
111
     }
111
 
112
 
112
     /**
113
     /**
113
-     * Removes the listener for ConferenceEvents.ENDPOINT_MESSAGE_RECEIVED
114
+     * Removes the listener for JitsiConferenceEvents.ENDPOINT_MESSAGE_RECEIVED
114
      * events. Sends stop message to the wrapper application. Optionally
115
      * events. Sends stop message to the wrapper application. Optionally
115
      * displays dialog for informing the user that remote control session
116
      * displays dialog for informing the user that remote control session
116
      * ended.
117
      * ended.
125
         }
126
         }
126
         logger.log('Remote control receiver stop.');
127
         logger.log('Remote control receiver stop.');
127
         this._controller = null;
128
         this._controller = null;
128
-        APP.conference.removeConferenceListener(ConferenceEvents.USER_LEFT,
129
+        APP.conference.removeConferenceListener(
130
+            JitsiConferenceEvents.USER_LEFT,
129
             this._userLeftListener);
131
             this._userLeftListener);
130
         transport.sendEvent({
132
         transport.sendEvent({
131
             name: REMOTE_CONTROL_MESSAGE_NAME,
133
             name: REMOTE_CONTROL_MESSAGE_NAME,
216
      * @returns {void}
218
      * @returns {void}
217
      */
219
      */
218
     grant(userId: string) {
220
     grant(userId: string) {
219
-        APP.conference.addConferenceListener(ConferenceEvents.USER_LEFT,
221
+        APP.conference.addConferenceListener(JitsiConferenceEvents.USER_LEFT,
220
             this._userLeftListener);
222
             this._userLeftListener);
221
         this._controller = userId;
223
         this._controller = userId;
222
         logger.log(`Remote control permissions granted to: ${userId}`);
224
         logger.log(`Remote control permissions granted to: ${userId}`);

+ 4
- 0
react/features/base/lib-jitsi-meet/index.js Просмотреть файл

10
 export const JitsiConferenceEvents = JitsiMeetJS.events.conference;
10
 export const JitsiConferenceEvents = JitsiMeetJS.events.conference;
11
 export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
11
 export const JitsiConnectionErrors = JitsiMeetJS.errors.connection;
12
 export const JitsiConnectionEvents = JitsiMeetJS.events.connection;
12
 export const JitsiConnectionEvents = JitsiMeetJS.events.connection;
13
+export const JitsiConnectionQualityEvents
14
+    = JitsiMeetJS.events.connectionQuality;
15
+export const JitsiMediaDevicesEvents = JitsiMeetJS.events.mediaDevices;
13
 export const JitsiParticipantConnectionStatus
16
 export const JitsiParticipantConnectionStatus
14
     = JitsiMeetJS.constants.participantConnectionStatus;
17
     = JitsiMeetJS.constants.participantConnectionStatus;
18
+export const JitsiRecordingStatus = JitsiMeetJS.constants.recordingStatus;
15
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
19
 export const JitsiTrackErrors = JitsiMeetJS.errors.track;
16
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
20
 export const JitsiTrackEvents = JitsiMeetJS.events.track;
17
 
21
 

+ 3
- 5
react/features/connection-indicator/statsEmitter.js Просмотреть файл

2
 
2
 
3
 import _ from 'lodash';
3
 import _ from 'lodash';
4
 
4
 
5
-import JitsiMeetJS from '../base/lib-jitsi-meet';
5
+import { JitsiConnectionQualityEvents } from '../base/lib-jitsi-meet';
6
 
6
 
7
 declare var APP: Object;
7
 declare var APP: Object;
8
 
8
 
28
      * @returns {void}
28
      * @returns {void}
29
      */
29
      */
30
     startListeningForStats(conference: Object) {
30
     startListeningForStats(conference: Object) {
31
-        const { connectionQuality } = JitsiMeetJS.events;
32
-
33
-        conference.on(connectionQuality.LOCAL_STATS_UPDATED,
31
+        conference.on(JitsiConnectionQualityEvents.LOCAL_STATS_UPDATED,
34
             stats => this._onStatsUpdated(conference.myUserId(), stats));
32
             stats => this._onStatsUpdated(conference.myUserId(), stats));
35
 
33
 
36
-        conference.on(connectionQuality.REMOTE_STATS_UPDATED,
34
+        conference.on(JitsiConnectionQualityEvents.REMOTE_STATS_UPDATED,
37
             (id, stats) => this._emitStatsUpdate(id, stats));
35
             (id, stats) => this._emitStatsUpdate(id, stats));
38
     },
36
     },
39
 
37
 

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