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