Przeglądaj źródła

[eslint] lines-around-comment

tags/v0.0.2
Lyubo Marinov 8 lat temu
rodzic
commit
068f290835
56 zmienionych plików z 405 dodań i 0 usunięć
  1. 9
    0
      .eslintrc.js
  2. 19
    0
      JitsiConference.js
  3. 15
    0
      JitsiConferenceErrors.js
  4. 2
    0
      JitsiConferenceEventManager.js
  5. 35
    0
      JitsiConferenceEvents.js
  6. 4
    0
      JitsiConnectionErrors.js
  7. 3
    0
      JitsiConnectionEvents.js
  8. 8
    0
      JitsiMediaDevices.js
  9. 1
    0
      JitsiMediaDevicesEvents.js
  10. 9
    0
      JitsiMeetJS.js
  11. 12
    0
      JitsiTrackErrors.js
  12. 4
    0
      JitsiTrackEvents.js
  13. 7
    0
      doc/example/example.js
  14. 3
    0
      modules/RTC/DataChannels.js
  15. 2
    0
      modules/RTC/JitsiLocalTrack.js
  16. 2
    0
      modules/RTC/JitsiRemoteTrack.js
  17. 5
    0
      modules/RTC/RTC.js
  18. 3
    0
      modules/RTC/RTCBrowserType.js
  19. 2
    0
      modules/RTC/RTCUIHelper.js
  20. 16
    0
      modules/RTC/RTCUtils.js
  21. 5
    0
      modules/RTC/ScreenObtainer.js
  22. 19
    0
      modules/RTC/TraceablePeerConnection.js
  23. 1
    0
      modules/connectivity/ConnectionQuality.js
  24. 4
    0
      modules/connectivity/ParticipantConnectionStatus.js
  25. 1
    0
      modules/statistics/AnalyticsAdapter.js
  26. 2
    0
      modules/statistics/CallStats.js
  27. 4
    0
      modules/statistics/RTPStatsCollector.js
  28. 4
    0
      modules/statistics/statistics.js
  29. 16
    0
      modules/transcription/audioRecorder.js
  30. 21
    0
      modules/transcription/transcriber.js
  31. 6
    0
      modules/transcription/transcriptionServices/SphinxTranscriptionService.js
  32. 2
    0
      modules/util/EventEmitterForwarder.js
  33. 2
    0
      modules/util/GlobalOnErrorHandler.js
  34. 1
    0
      modules/util/Listenable.js
  35. 1
    0
      modules/util/RandomUtil.js
  36. 2
    0
      modules/version/ComponentsVersions.js
  37. 6
    0
      modules/xmpp/ChatRoom.js
  38. 23
    0
      modules/xmpp/JingleSessionPC.js
  39. 4
    0
      modules/xmpp/RtxModifier.js
  40. 8
    0
      modules/xmpp/RtxModifier.spec.js
  41. 13
    0
      modules/xmpp/SDP.js
  42. 3
    0
      modules/xmpp/SDPDiffer.js
  43. 8
    0
      modules/xmpp/SDPUtil.js
  44. 4
    0
      modules/xmpp/SampleSdpStrings.js
  45. 1
    0
      modules/xmpp/SdpTransformUtil.js
  46. 17
    0
      modules/xmpp/moderator.js
  47. 1
    0
      modules/xmpp/strophe.emuc.js
  48. 6
    0
      modules/xmpp/strophe.jingle.js
  49. 1
    0
      modules/xmpp/strophe.ping.js
  50. 2
    0
      modules/xmpp/strophe.util.js
  51. 3
    0
      modules/xmpp/xmpp.js
  52. 9
    0
      service/RTC/RTCEvents.js
  53. 2
    0
      service/RTC/Resolutions.js
  54. 1
    0
      service/RTC/SignalingLayer.js
  55. 1
    0
      service/RTC/VideoType.js
  56. 40
    0
      service/xmpp/XMPPEvents.js

+ 9
- 0
.eslintrc.js Wyświetl plik

169
         'key-spacing': 2,
169
         'key-spacing': 2,
170
         'keyword-spacing': 2,
170
         'keyword-spacing': 2,
171
         'linebreak-style': [ 'error', 'unix' ],
171
         'linebreak-style': [ 'error', 'unix' ],
172
+        'lines-around-comment': [
173
+            'error',
174
+            {
175
+                'allowBlockStart': true,
176
+                'allowObjectStart': true,
177
+                'beforeBlockComment': true,
178
+                'beforeLineComment': true
179
+            }
180
+        ],
172
         'max-lines': 0,
181
         'max-lines': 0,
173
         'max-nested-callbacks': 2,
182
         'max-nested-callbacks': 2,
174
         'max-statements': 0,
183
         'max-statements': 0,

+ 19
- 0
JitsiConference.js Wyświetl plik

50
     this._init(options);
50
     this._init(options);
51
     this.componentsVersions = new ComponentsVersions(this);
51
     this.componentsVersions = new ComponentsVersions(this);
52
     this.participants = {};
52
     this.participants = {};
53
+
53
     /**
54
     /**
54
      * Jingle Session instance
55
      * Jingle Session instance
55
      * @type {JingleSessionPC}
56
      * @type {JingleSessionPC}
70
         video: undefined
71
         video: undefined
71
     };
72
     };
72
     this.isMutedByFocus = false;
73
     this.isMutedByFocus = false;
74
+
73
     // Flag indicates if the 'onCallEnded' method was ever called on this
75
     // Flag indicates if the 'onCallEnded' method was ever called on this
74
     // instance. Used to log extra analytics event for debugging purpose.
76
     // instance. Used to log extra analytics event for debugging purpose.
75
     // We need to know if the potential issue happened before or after
77
     // We need to know if the potential issue happened before or after
106
     if (options.connection) {
108
     if (options.connection) {
107
         this.connection = options.connection;
109
         this.connection = options.connection;
108
         this.xmpp = this.connection.xmpp;
110
         this.xmpp = this.connection.xmpp;
111
+
109
         // Setup XMPP events only if we have new connection object.
112
         // Setup XMPP events only if we have new connection object.
110
         this.eventManager.setupXMPPListeners();
113
         this.eventManager.setupXMPPListeners();
111
     }
114
     }
198
             // ChatRoom instance.
201
             // ChatRoom instance.
199
             this.getParticipants().forEach(
202
             this.getParticipants().forEach(
200
                 participant => this.onMemberLeft(participant.getJid()));
203
                 participant => this.onMemberLeft(participant.getJid()));
204
+
201
             // Close the JingleSession
205
             // Close the JingleSession
202
             if (this.jingleSession) {
206
             if (this.jingleSession) {
203
                 this.jingleSession.close();
207
                 this.jingleSession.close();
427
 JitsiConference.prototype.getTranscriber = function() {
431
 JitsiConference.prototype.getTranscriber = function() {
428
     if (this.transcriber === undefined) {
432
     if (this.transcriber === undefined) {
429
         this.transcriber = new Transcriber();
433
         this.transcriber = new Transcriber();
434
+
430
         // add all existing local audio tracks to the transcriber
435
         // add all existing local audio tracks to the transcriber
431
         const localAudioTracks = this.getLocalTracks(MediaType.AUDIO);
436
         const localAudioTracks = this.getLocalTracks(MediaType.AUDIO);
432
 
437
 
433
         for (const localAudio of localAudioTracks) {
438
         for (const localAudio of localAudioTracks) {
434
             this.transcriber.addTrack(localAudio);
439
             this.transcriber.addTrack(localAudio);
435
         }
440
         }
441
+
436
         // and all remote audio tracks
442
         // and all remote audio tracks
437
         const remoteAudioTracks = this.rtc.getRemoteTracks(MediaType.AUDIO);
443
         const remoteAudioTracks = this.rtc.getRemoteTracks(MediaType.AUDIO);
438
 
444
 
490
     // check if track was muted by focus and now is unmuted by user
496
     // check if track was muted by focus and now is unmuted by user
491
     if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
497
     if (this.isMutedByFocus && track.isAudioTrack() && !track.isMuted()) {
492
         this.isMutedByFocus = false;
498
         this.isMutedByFocus = false;
499
+
493
         // unmute local user on server
500
         // unmute local user on server
494
         this.room.muteParticipant(this.room.myroomjid, false);
501
         this.room.muteParticipant(this.room.myroomjid, false);
495
     }
502
     }
553
             return Promise.reject(
560
             return Promise.reject(
554
                 new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
561
                 new JitsiTrackError(JitsiTrackErrors.TRACK_IS_DISPOSED));
555
         }
562
         }
563
+
556
         // Set up the ssrcHandler for the new track before we add it at the lower levels
564
         // Set up the ssrcHandler for the new track before we add it at the lower levels
557
         newTrack.ssrcHandler = function(conference, ssrcMap) {
565
         newTrack.ssrcHandler = function(conference, ssrcMap) {
558
             const trackSSRCInfo = ssrcMap.get(this.getMSID());
566
             const trackSSRCInfo = ssrcMap.get(this.getMSID());
1068
     // Accept incoming call
1076
     // Accept incoming call
1069
     this.jingleSession = jingleSession;
1077
     this.jingleSession = jingleSession;
1070
     this.room.connectionTimes['session.initiate'] = now;
1078
     this.room.connectionTimes['session.initiate'] = now;
1079
+
1071
     // Log "session.restart"
1080
     // Log "session.restart"
1072
     if (this.wasStopped) {
1081
     if (this.wasStopped) {
1073
         Statistics.sendEventToAll('session.restart');
1082
         Statistics.sendEventToAll('session.restart');
1074
     }
1083
     }
1084
+
1075
     // add info whether call is cross-region
1085
     // add info whether call is cross-region
1076
     let crossRegion = null;
1086
     let crossRegion = null;
1077
 
1087
 
1090
     }
1100
     }
1091
 
1101
 
1092
     this.rtc.initializeDataChannels(jingleSession.peerconnection);
1102
     this.rtc.initializeDataChannels(jingleSession.peerconnection);
1103
+
1093
     // Add local Tracks to the ChatRoom
1104
     // Add local Tracks to the ChatRoom
1094
     this.getLocalTracks().forEach(localTrack => {
1105
     this.getLocalTracks().forEach(localTrack => {
1095
         let ssrcInfo = null;
1106
         let ssrcInfo = null;
1107
+
1096
         /**
1108
         /**
1097
          * We don't do this for Firefox because, on Firefox, we keep the
1109
          * We don't do this for Firefox because, on Firefox, we keep the
1098
          *  stream in the peer connection and just set 'enabled' on the
1110
          *  stream in the peer connection and just set 'enabled' on the
1145
             logger.error(e);
1157
             logger.error(e);
1146
         }
1158
         }
1147
     });
1159
     });
1160
+
1148
     // Generate the 'recvonly' SSRC in case there are no video tracks
1161
     // Generate the 'recvonly' SSRC in case there are no video tracks
1149
     if (!this.getLocalTracks(MediaType.VIDEO).length) {
1162
     if (!this.getLocalTracks(MediaType.VIDEO).length) {
1150
         jingleSession.generateRecvonlySsrc();
1163
         jingleSession.generateRecvonlySsrc();
1178
 = function(JingleSession, reasonCondition, reasonText) {
1191
 = function(JingleSession, reasonCondition, reasonText) {
1179
     logger.info(`Call ended: ${reasonCondition} - ${reasonText}`);
1192
     logger.info(`Call ended: ${reasonCondition} - ${reasonText}`);
1180
     this.wasStopped = true;
1193
     this.wasStopped = true;
1194
+
1181
     // Send session.terminate event
1195
     // Send session.terminate event
1182
     Statistics.sendEventToAll('session.terminate');
1196
     Statistics.sendEventToAll('session.terminate');
1197
+
1183
     // Stop the stats
1198
     // Stop the stats
1184
     if (this.statistics) {
1199
     if (this.statistics) {
1185
         this.statistics.stopRemoteStats();
1200
         this.statistics.stopRemoteStats();
1186
         this.statistics.stopCallStats();
1201
         this.statistics.stopCallStats();
1187
     }
1202
     }
1203
+
1188
     // Current JingleSession is invalid so set it to null on the room
1204
     // Current JingleSession is invalid so set it to null on the room
1189
     this.jingleSession = null;
1205
     this.jingleSession = null;
1206
+
1190
     // Let the RTC service do any cleanups
1207
     // Let the RTC service do any cleanups
1191
     this.rtc.onCallEnded();
1208
     this.rtc.onCallEnded();
1209
+
1192
     // PeerConnection has been closed which means that SSRCs stored in
1210
     // PeerConnection has been closed which means that SSRCs stored in
1193
     // JitsiLocalTrack will not match those assigned by the old PeerConnection
1211
     // JitsiLocalTrack will not match those assigned by the old PeerConnection
1194
     // and SSRC replacement logic will not work as expected.
1212
     // and SSRC replacement logic will not work as expected.
1200
     this.getLocalTracks().forEach(localTrack => {
1218
     this.getLocalTracks().forEach(localTrack => {
1201
         // Reset SSRC as it will no longer be valid
1219
         // Reset SSRC as it will no longer be valid
1202
         localTrack._setSSRC(null);
1220
         localTrack._setSSRC(null);
1221
+
1203
         // Bind the handler to fetch new SSRC, it will un register itself once
1222
         // Bind the handler to fetch new SSRC, it will un register itself once
1204
         // it reads the values
1223
         // it reads the values
1205
         self.rtc.addListener(
1224
         self.rtc.addListener(

+ 15
- 0
JitsiConferenceErrors.js Wyświetl plik

6
  * Indicates that client must be authenticated to create the conference.
6
  * Indicates that client must be authenticated to create the conference.
7
  */
7
  */
8
 export const AUTHENTICATION_REQUIRED = 'conference.authenticationRequired';
8
 export const AUTHENTICATION_REQUIRED = 'conference.authenticationRequired';
9
+
9
 /**
10
 /**
10
  * Indicates that chat error occurred.
11
  * Indicates that chat error occurred.
11
  */
12
  */
12
 export const CHAT_ERROR = 'conference.chatError';
13
 export const CHAT_ERROR = 'conference.chatError';
14
+
13
 /**
15
 /**
14
  * Indicates that conference has been destroyed.
16
  * Indicates that conference has been destroyed.
15
  */
17
  */
16
 export const CONFERENCE_DESTROYED = 'conference.destroyed';
18
 export const CONFERENCE_DESTROYED = 'conference.destroyed';
19
+
17
 /**
20
 /**
18
  * Indicates that max users limit has been reached.
21
  * Indicates that max users limit has been reached.
19
  */
22
  */
20
 export const CONFERENCE_MAX_USERS = 'conference.max_users';
23
 export const CONFERENCE_MAX_USERS = 'conference.max_users';
24
+
21
 /**
25
 /**
22
  * Indicates that a connection error occurred when trying to join a conference.
26
  * Indicates that a connection error occurred when trying to join a conference.
23
  */
27
  */
24
 export const CONNECTION_ERROR = 'conference.connectionError';
28
 export const CONNECTION_ERROR = 'conference.connectionError';
29
+
25
 /**
30
 /**
26
  * Indicates that a connection error is due to not allowed,
31
  * Indicates that a connection error is due to not allowed,
27
  * occurred when trying to join a conference.
32
  * occurred when trying to join a conference.
28
  */
33
  */
29
 export const NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed';
34
 export const NOT_ALLOWED_ERROR = 'conference.connectionError.notAllowed';
35
+
30
 /**
36
 /**
31
  * Indicates that focus error happened.
37
  * Indicates that focus error happened.
32
  */
38
  */
33
 export const FOCUS_DISCONNECTED = 'conference.focusDisconnected';
39
 export const FOCUS_DISCONNECTED = 'conference.focusDisconnected';
40
+
34
 /**
41
 /**
35
  * Indicates that focus left the conference.
42
  * Indicates that focus left the conference.
36
  */
43
  */
37
 export const FOCUS_LEFT = 'conference.focusLeft';
44
 export const FOCUS_LEFT = 'conference.focusLeft';
45
+
38
 /**
46
 /**
39
  * Indicates that graceful shutdown happened.
47
  * Indicates that graceful shutdown happened.
40
  */
48
  */
41
 export const GRACEFUL_SHUTDOWN = 'conference.gracefulShutdown';
49
 export const GRACEFUL_SHUTDOWN = 'conference.gracefulShutdown';
50
+
42
 /**
51
 /**
43
  * Indicates that the versions of the server side components are incompatible
52
  * Indicates that the versions of the server side components are incompatible
44
  * with the client side.
53
  * with the client side.
45
  */
54
  */
46
 export const INCOMPATIBLE_SERVER_VERSIONS
55
 export const INCOMPATIBLE_SERVER_VERSIONS
47
     = 'conference.incompatible_server_versions';
56
     = 'conference.incompatible_server_versions';
57
+
48
 /**
58
 /**
49
  * Indicates that jingle fatal error happened.
59
  * Indicates that jingle fatal error happened.
50
  */
60
  */
51
 export const JINGLE_FATAL_ERROR = 'conference.jingleFatalError';
61
 export const JINGLE_FATAL_ERROR = 'conference.jingleFatalError';
62
+
52
 /**
63
 /**
53
  * Indicates that password cannot be set for this conference.
64
  * Indicates that password cannot be set for this conference.
54
  */
65
  */
55
 export const PASSWORD_NOT_SUPPORTED = 'conference.passwordNotSupported';
66
 export const PASSWORD_NOT_SUPPORTED = 'conference.passwordNotSupported';
67
+
56
 /**
68
 /**
57
  * Indicates that a password is required in order to join the conference.
69
  * Indicates that a password is required in order to join the conference.
58
  */
70
  */
59
 export const PASSWORD_REQUIRED = 'conference.passwordRequired';
71
 export const PASSWORD_REQUIRED = 'conference.passwordRequired';
72
+
60
 /**
73
 /**
61
  * Indicates that reservation system returned error.
74
  * Indicates that reservation system returned error.
62
  */
75
  */
63
 export const RESERVATION_ERROR = 'conference.reservationError';
76
 export const RESERVATION_ERROR = 'conference.reservationError';
77
+
64
 /**
78
 /**
65
  * Indicates that the conference setup failed.
79
  * Indicates that the conference setup failed.
66
  */
80
  */
67
 export const SETUP_FAILED = 'conference.setup_failed';
81
 export const SETUP_FAILED = 'conference.setup_failed';
82
+
68
 /**
83
 /**
69
  * Indicates that there is no available videobridge.
84
  * Indicates that there is no available videobridge.
70
  */
85
  */

+ 2
- 0
JitsiConferenceEventManager.js Wyświetl plik

66
 
66
 
67
     this.chatRoomForwarder.forward(XMPPEvents.MUC_JOINED,
67
     this.chatRoomForwarder.forward(XMPPEvents.MUC_JOINED,
68
         JitsiConferenceEvents.CONFERENCE_JOINED);
68
         JitsiConferenceEvents.CONFERENCE_JOINED);
69
+
69
     // send some analytics events
70
     // send some analytics events
70
     chatRoom.addListener(XMPPEvents.MUC_JOINED,
71
     chatRoom.addListener(XMPPEvents.MUC_JOINED,
71
         () => {
72
         () => {
554
 
555
 
555
         conference.rtc.setAudioLevel(resource, level);
556
         conference.rtc.setAudioLevel(resource, level);
556
     });
557
     });
558
+
557
     // Forward the "before stats disposed" event
559
     // Forward the "before stats disposed" event
558
     conference.statistics.addBeforeDisposedListener(() => {
560
     conference.statistics.addBeforeDisposedListener(() => {
559
         conference.eventEmitter.emit(
561
         conference.eventEmitter.emit(

+ 35
- 0
JitsiConferenceEvents.js Wyświetl plik

6
  * Indicates that authentication status changed.
6
  * Indicates that authentication status changed.
7
  */
7
  */
8
 export const AUTH_STATUS_CHANGED = 'conference.auth_status_changed';
8
 export const AUTH_STATUS_CHANGED = 'conference.auth_status_changed';
9
+
9
 /**
10
 /**
10
  * Indicates that available devices changed.
11
  * Indicates that available devices changed.
11
  */
12
  */
12
 export const AVAILABLE_DEVICES_CHANGED = 'conference.availableDevicesChanged';
13
 export const AVAILABLE_DEVICES_CHANGED = 'conference.availableDevicesChanged';
14
+
13
 /**
15
 /**
14
  * A participant avatar has changed.
16
  * A participant avatar has changed.
15
  */
17
  */
26
  * Indicates that an error occured.
28
  * Indicates that an error occured.
27
  */
29
  */
28
 export const CONFERENCE_ERROR = 'conference.error';
30
 export const CONFERENCE_ERROR = 'conference.error';
31
+
29
 /**
32
 /**
30
  * Indicates that conference failed.
33
  * Indicates that conference failed.
31
  */
34
  */
32
 export const CONFERENCE_FAILED = 'conference.failed';
35
 export const CONFERENCE_FAILED = 'conference.failed';
36
+
33
 /**
37
 /**
34
  * Indicates that conference has been joined. The event does NOT provide any
38
  * Indicates that conference has been joined. The event does NOT provide any
35
  * parameters to its listeners.
39
  * parameters to its listeners.
36
  */
40
  */
37
 export const CONFERENCE_JOINED = 'conference.joined';
41
 export const CONFERENCE_JOINED = 'conference.joined';
42
+
38
 /**
43
 /**
39
  * Indicates that conference has been left.
44
  * Indicates that conference has been left.
40
  */
45
  */
41
 export const CONFERENCE_LEFT = 'conference.left';
46
 export const CONFERENCE_LEFT = 'conference.left';
47
+
42
 /**
48
 /**
43
  * Indicates that the connection to the conference has been interrupted for some
49
  * Indicates that the connection to the conference has been interrupted for some
44
  * reason.
50
  * reason.
45
  */
51
  */
46
 export const CONNECTION_INTERRUPTED = 'conference.connectionInterrupted';
52
 export const CONNECTION_INTERRUPTED = 'conference.connectionInterrupted';
53
+
47
 /**
54
 /**
48
  * Indicates that the connection to the conference has been restored.
55
  * Indicates that the connection to the conference has been restored.
49
  */
56
  */
50
 export const CONNECTION_RESTORED = 'conference.connectionRestored';
57
 export const CONNECTION_RESTORED = 'conference.connectionRestored';
58
+
51
 /**
59
 /**
52
  * New local connection statistics are received.
60
  * New local connection statistics are received.
53
  * @deprecated Use ConnectionQualityEvents.LOCAL_STATS_UPDATED instead.
61
  * @deprecated Use ConnectionQualityEvents.LOCAL_STATS_UPDATED instead.
54
  */
62
  */
55
 export const CONNECTION_STATS = 'conference.connectionStats';
63
 export const CONNECTION_STATS = 'conference.connectionStats';
64
+
56
 /**
65
 /**
57
  * A user has changed it display name
66
  * A user has changed it display name
58
  */
67
  */
59
 export const DISPLAY_NAME_CHANGED = 'conference.displayNameChanged';
68
 export const DISPLAY_NAME_CHANGED = 'conference.displayNameChanged';
69
+
60
 /**
70
 /**
61
  * The dominant speaker was changed.
71
  * The dominant speaker was changed.
62
  */
72
  */
63
 export const DOMINANT_SPEAKER_CHANGED = 'conference.dominantSpeaker';
73
 export const DOMINANT_SPEAKER_CHANGED = 'conference.dominantSpeaker';
74
+
64
 /**
75
 /**
65
  * Indicates that DTMF support changed.
76
  * Indicates that DTMF support changed.
66
  */
77
  */
67
 export const DTMF_SUPPORT_CHANGED = 'conference.dtmfSupportChanged';
78
 export const DTMF_SUPPORT_CHANGED = 'conference.dtmfSupportChanged';
79
+
68
 /**
80
 /**
69
  * Indicates that a message from another participant is received on data
81
  * Indicates that a message from another participant is received on data
70
  * channel.
82
  * channel.
71
  */
83
  */
72
 export const ENDPOINT_MESSAGE_RECEIVED = 'conference.endpoint_message_received';
84
 export const ENDPOINT_MESSAGE_RECEIVED = 'conference.endpoint_message_received';
85
+
73
 /**
86
 /**
74
  * You are included / excluded in somebody's last N set
87
  * You are included / excluded in somebody's last N set
75
  */
88
  */
76
 export const IN_LAST_N_CHANGED = 'conference.inLastNChanged';
89
 export const IN_LAST_N_CHANGED = 'conference.inLastNChanged';
90
+
77
 /**
91
 /**
78
  * You are kicked from the conference.
92
  * You are kicked from the conference.
79
  */
93
  */
80
 export const KICKED = 'conferenece.kicked';
94
 export const KICKED = 'conferenece.kicked';
95
+
81
 /**
96
 /**
82
  * The Last N set is changed.
97
  * The Last N set is changed.
83
  */
98
  */
84
 export const LAST_N_ENDPOINTS_CHANGED = 'conference.lastNEndpointsChanged';
99
 export const LAST_N_ENDPOINTS_CHANGED = 'conference.lastNEndpointsChanged';
100
+
85
 /**
101
 /**
86
  * Indicates that the room has been locked or unlocked.
102
  * Indicates that the room has been locked or unlocked.
87
  */
103
  */
88
 export const LOCK_STATE_CHANGED = 'conference.lock_state_changed';
104
 export const LOCK_STATE_CHANGED = 'conference.lock_state_changed';
105
+
89
 /**
106
 /**
90
  * New text message was received.
107
  * New text message was received.
91
  */
108
  */
92
 export const MESSAGE_RECEIVED = 'conference.messageReceived';
109
 export const MESSAGE_RECEIVED = 'conference.messageReceived';
110
+
93
 /**
111
 /**
94
  * Event fired when JVB sends notification about interrupted/restored user's
112
  * Event fired when JVB sends notification about interrupted/restored user's
95
  * ICE connection status. First argument is the ID of the participant and
113
  * ICE connection status. First argument is the ID of the participant and
100
  */
118
  */
101
 export const PARTICIPANT_CONN_STATUS_CHANGED
119
 export const PARTICIPANT_CONN_STATUS_CHANGED
102
     = 'conference.participant_conn_status_changed';
120
     = 'conference.participant_conn_status_changed';
121
+
103
 /**
122
 /**
104
  * Indicates that the features of the participant has been changed.
123
  * Indicates that the features of the participant has been changed.
105
  */
124
  */
106
 export const PARTCIPANT_FEATURES_CHANGED
125
 export const PARTCIPANT_FEATURES_CHANGED
107
     = 'conference.partcipant_features_changed';
126
     = 'conference.partcipant_features_changed';
127
+
108
 /**
128
 /**
109
  * Indicates that a the value of a specific property of a specific participant
129
  * Indicates that a the value of a specific property of a specific participant
110
  * has changed.
130
  * has changed.
111
  */
131
  */
112
 export const PARTICIPANT_PROPERTY_CHANGED
132
 export const PARTICIPANT_PROPERTY_CHANGED
113
     = 'conference.participant_property_changed';
133
     = 'conference.participant_property_changed';
134
+
114
 /**
135
 /**
115
  * Indicates that phone number changed.
136
  * Indicates that phone number changed.
116
  */
137
  */
117
 export const PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged';
138
 export const PHONE_NUMBER_CHANGED = 'conference.phoneNumberChanged';
139
+
118
 /**
140
 /**
119
  * Indicates that recording state changed.
141
  * Indicates that recording state changed.
120
  */
142
  */
121
 export const RECORDER_STATE_CHANGED = 'conference.recorderStateChanged';
143
 export const RECORDER_STATE_CHANGED = 'conference.recorderStateChanged';
144
+
122
 /**
145
 /**
123
  * Indicates that start muted settings changed.
146
  * Indicates that start muted settings changed.
124
  */
147
  */
125
 export const START_MUTED_POLICY_CHANGED
148
 export const START_MUTED_POLICY_CHANGED
126
     = 'conference.start_muted_policy_changed';
149
     = 'conference.start_muted_policy_changed';
150
+
127
 /**
151
 /**
128
  * Indicates that the local user has started muted.
152
  * Indicates that the local user has started muted.
129
  */
153
  */
130
 export const STARTED_MUTED = 'conference.started_muted';
154
 export const STARTED_MUTED = 'conference.started_muted';
155
+
131
 /**
156
 /**
132
  * Indicates that subject of the conference has changed.
157
  * Indicates that subject of the conference has changed.
133
  */
158
  */
134
 export const SUBJECT_CHANGED = 'conference.subjectChanged';
159
 export const SUBJECT_CHANGED = 'conference.subjectChanged';
160
+
135
 /**
161
 /**
136
  * Indicates that DTMF support changed.
162
  * Indicates that DTMF support changed.
137
  */
163
  */
138
 export const SUSPEND_DETECTED = 'conference.suspendDetected';
164
 export const SUSPEND_DETECTED = 'conference.suspendDetected';
165
+
139
 /**
166
 /**
140
  * Event indicates that local user is talking while he muted himself
167
  * Event indicates that local user is talking while he muted himself
141
  */
168
  */
142
 export const TALK_WHILE_MUTED = 'conference.talk_while_muted';
169
 export const TALK_WHILE_MUTED = 'conference.talk_while_muted';
170
+
143
 /**
171
 /**
144
  * A new media track was added to the conference. The event provides the
172
  * A new media track was added to the conference. The event provides the
145
  * following parameters to its listeners:
173
  * following parameters to its listeners:
147
  * @param {JitsiTrack} track the added JitsiTrack
175
  * @param {JitsiTrack} track the added JitsiTrack
148
  */
176
  */
149
 export const TRACK_ADDED = 'conference.trackAdded';
177
 export const TRACK_ADDED = 'conference.trackAdded';
178
+
150
 /**
179
 /**
151
  * Audio levels of a media track ( attached to the conference) was changed.
180
  * Audio levels of a media track ( attached to the conference) was changed.
152
  */
181
  */
153
 export const TRACK_AUDIO_LEVEL_CHANGED = 'conference.audioLevelsChanged';
182
 export const TRACK_AUDIO_LEVEL_CHANGED = 'conference.audioLevelsChanged';
183
+
154
 /**
184
 /**
155
  * A media track ( attached to the conference) mute status was changed.
185
  * A media track ( attached to the conference) mute status was changed.
156
  */
186
  */
157
 export const TRACK_MUTE_CHANGED = 'conference.trackMuteChanged';
187
 export const TRACK_MUTE_CHANGED = 'conference.trackMuteChanged';
188
+
158
 /**
189
 /**
159
  * The media track was removed from the conference. The event provides the
190
  * The media track was removed from the conference. The event provides the
160
  * following parameters to its listeners:
191
  * following parameters to its listeners:
162
  * @param {JitsiTrack} track the removed JitsiTrack
193
  * @param {JitsiTrack} track the removed JitsiTrack
163
  */
194
  */
164
 export const TRACK_REMOVED = 'conference.trackRemoved';
195
 export const TRACK_REMOVED = 'conference.trackRemoved';
196
+
165
 /**
197
 /**
166
  * A new user joinned the conference.
198
  * A new user joinned the conference.
167
  */
199
  */
168
 export const USER_JOINED = 'conference.userJoined';
200
 export const USER_JOINED = 'conference.userJoined';
201
+
169
 /**
202
 /**
170
  * A user has left the conference.
203
  * A user has left the conference.
171
  */
204
  */
172
 export const USER_LEFT = 'conference.userLeft';
205
 export const USER_LEFT = 'conference.userLeft';
206
+
173
 /**
207
 /**
174
  * User role changed.
208
  * User role changed.
175
  */
209
  */
176
 export const USER_ROLE_CHANGED = 'conference.roleChanged';
210
 export const USER_ROLE_CHANGED = 'conference.roleChanged';
211
+
177
 /**
212
 /**
178
  * User status changed.
213
  * User status changed.
179
  */
214
  */

+ 4
- 0
JitsiConnectionErrors.js Wyświetl plik

14
  * case as long as the service is configured correctly (there is no bug).
14
  * case as long as the service is configured correctly (there is no bug).
15
  */
15
  */
16
 export const CONNECTION_DROPPED_ERROR = 'connection.droppedError';
16
 export const CONNECTION_DROPPED_ERROR = 'connection.droppedError';
17
+
17
 /**
18
 /**
18
  * Indicates that a connection error occurred when trying to join a conference.
19
  * Indicates that a connection error occurred when trying to join a conference.
19
  */
20
  */
20
 export const CONNECTION_ERROR = 'connection.connectionError';
21
 export const CONNECTION_ERROR = 'connection.connectionError';
22
+
21
 /**
23
 /**
22
  * Not specified errors.
24
  * Not specified errors.
23
  */
25
  */
24
 export const OTHER_ERROR = 'connection.otherError';
26
 export const OTHER_ERROR = 'connection.otherError';
27
+
25
 /**
28
 /**
26
  * Indicates that a password is required in order to join the conference.
29
  * Indicates that a password is required in order to join the conference.
27
  */
30
  */
28
 export const PASSWORD_REQUIRED = 'connection.passwordRequired';
31
 export const PASSWORD_REQUIRED = 'connection.passwordRequired';
32
+
29
 /**
33
 /**
30
  * Indicates that the connection was dropped, because of too many 5xx HTTP
34
  * Indicates that the connection was dropped, because of too many 5xx HTTP
31
  * errors on BOSH requests.
35
  * errors on BOSH requests.

+ 3
- 0
JitsiConnectionEvents.js Wyświetl plik

10
  * last (known) error message
10
  * last (known) error message
11
  */
11
  */
12
 export const CONNECTION_DISCONNECTED = 'connection.connectionDisconnected';
12
 export const CONNECTION_DISCONNECTED = 'connection.connectionDisconnected';
13
+
13
 /**
14
 /**
14
  * Indicates that the connection has been established. The event provides
15
  * Indicates that the connection has been established. The event provides
15
  * the following parameters to its listeners:
16
  * the following parameters to its listeners:
18
  * the context of the established connection)
19
  * the context of the established connection)
19
  */
20
  */
20
 export const CONNECTION_ESTABLISHED = 'connection.connectionEstablished';
21
 export const CONNECTION_ESTABLISHED = 'connection.connectionEstablished';
22
+
21
 /**
23
 /**
22
  * Indicates that the connection has been failed for some reason. The event
24
  * Indicates that the connection has been failed for some reason. The event
23
  * provides the following parameters to its listeners:
25
  * provides the following parameters to its listeners:
25
  * @param err {string} the error (message) associated with the failure
27
  * @param err {string} the error (message) associated with the failure
26
  */
28
  */
27
 export const CONNECTION_FAILED = 'connection.connectionFailed';
29
 export const CONNECTION_FAILED = 'connection.connectionFailed';
30
+
28
 /**
31
 /**
29
  * Indicates that the performed action cannot be executed because the
32
  * Indicates that the performed action cannot be executed because the
30
  * connection is not in the correct state(connected, disconnected, etc.)
33
  * connection is not in the correct state(connected, disconnected, etc.)

+ 8
- 0
JitsiMediaDevices.js Wyświetl plik

46
     enumerateDevices(callback) {
46
     enumerateDevices(callback) {
47
         RTC.enumerateDevices(callback);
47
         RTC.enumerateDevices(callback);
48
     },
48
     },
49
+
49
     /**
50
     /**
50
      * Checks if its possible to enumerate available cameras/micropones.
51
      * Checks if its possible to enumerate available cameras/micropones.
51
      * @returns {Promise<boolean>} a Promise which will be resolved only once
52
      * @returns {Promise<boolean>} a Promise which will be resolved only once
55
     isDeviceListAvailable() {
56
     isDeviceListAvailable() {
56
         return RTC.isDeviceListAvailable();
57
         return RTC.isDeviceListAvailable();
57
     },
58
     },
59
+
58
     /**
60
     /**
59
      * Returns true if changing the input (camera / microphone) or output
61
      * Returns true if changing the input (camera / microphone) or output
60
      * (audio) device is supported and false if not.
62
      * (audio) device is supported and false if not.
65
     isDeviceChangeAvailable(deviceType) {
67
     isDeviceChangeAvailable(deviceType) {
66
         return RTC.isDeviceChangeAvailable(deviceType);
68
         return RTC.isDeviceChangeAvailable(deviceType);
67
     },
69
     },
70
+
68
     /**
71
     /**
69
      * Returns true if user granted permission to media devices.
72
      * Returns true if user granted permission to media devices.
70
      * @param {'audio'|'video'} [type] - type of devices to check,
73
      * @param {'audio'|'video'} [type] - type of devices to check,
83
             return permissions.video === true && permissions.audio === true;
86
             return permissions.video === true && permissions.audio === true;
84
         }
87
         }
85
     },
88
     },
89
+
86
     /**
90
     /**
87
      * Returns currently used audio output device id, 'default' stands
91
      * Returns currently used audio output device id, 'default' stands
88
      * for default device
92
      * for default device
91
     getAudioOutputDevice() {
95
     getAudioOutputDevice() {
92
         return RTC.getAudioOutputDevice();
96
         return RTC.getAudioOutputDevice();
93
     },
97
     },
98
+
94
     /**
99
     /**
95
      * Sets current audio output device.
100
      * Sets current audio output device.
96
      * @param {string} deviceId - id of 'audiooutput' device from
101
      * @param {string} deviceId - id of 'audiooutput' device from
112
 
117
 
113
         return RTC.setAudioOutputDevice(deviceId);
118
         return RTC.setAudioOutputDevice(deviceId);
114
     },
119
     },
120
+
115
     /**
121
     /**
116
      * Adds an event handler.
122
      * Adds an event handler.
117
      * @param {string} event - event name
123
      * @param {string} event - event name
120
     addEventListener(event, handler) {
126
     addEventListener(event, handler) {
121
         eventEmitter.addListener(event, handler);
127
         eventEmitter.addListener(event, handler);
122
     },
128
     },
129
+
123
     /**
130
     /**
124
      * Removes event handler.
131
      * Removes event handler.
125
      * @param {string} event - event name
132
      * @param {string} event - event name
128
     removeEventListener(event, handler) {
135
     removeEventListener(event, handler) {
129
         eventEmitter.removeListener(event, handler);
136
         eventEmitter.removeListener(event, handler);
130
     },
137
     },
138
+
131
     /**
139
     /**
132
      * Emits an event.
140
      * Emits an event.
133
      * @param {string} event - event name
141
      * @param {string} event - event name

+ 1
- 0
JitsiMediaDevicesEvents.js Wyświetl plik

11
  *  @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
11
  *  @see https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo
12
  */
12
  */
13
 export const DEVICE_LIST_CHANGED = 'mediaDevices.devicechange';
13
 export const DEVICE_LIST_CHANGED = 'mediaDevices.devicechange';
14
+
14
 /**
15
 /**
15
  * Indicates that the environment is currently showing permission prompt to
16
  * Indicates that the environment is currently showing permission prompt to
16
  * access camera and/or microphone. The event provides the following
17
  * access camera and/or microphone. The event provides the following

+ 9
- 0
JitsiMeetJS.js Wyświetl plik

140
 
140
 
141
         return RTC.init(options || {});
141
         return RTC.init(options || {});
142
     },
142
     },
143
+
143
     /**
144
     /**
144
      * Returns whether the desktop sharing is enabled or not.
145
      * Returns whether the desktop sharing is enabled or not.
145
      * @returns {boolean}
146
      * @returns {boolean}
150
     setLogLevel(level) {
151
     setLogLevel(level) {
151
         Logger.setLogLevel(level);
152
         Logger.setLogLevel(level);
152
     },
153
     },
154
+
153
     /**
155
     /**
154
      * Sets the log level to the <tt>Logger</tt> instance with given id.
156
      * Sets the log level to the <tt>Logger</tt> instance with given id.
155
      * @param {Logger.levels} level the logging level to be set
157
      * @param {Logger.levels} level the logging level to be set
160
     setLogLevelById(level, id) {
162
     setLogLevelById(level, id) {
161
         Logger.setLogLevelById(level, id);
163
         Logger.setLogLevelById(level, id);
162
     },
164
     },
165
+
163
     /**
166
     /**
164
      * Registers new global logger transport to the library logging framework.
167
      * Registers new global logger transport to the library logging framework.
165
      * @param globalTransport
168
      * @param globalTransport
168
     addGlobalLogTransport(globalTransport) {
171
     addGlobalLogTransport(globalTransport) {
169
         Logger.addGlobalTransport(globalTransport);
172
         Logger.addGlobalTransport(globalTransport);
170
     },
173
     },
174
+
171
     /**
175
     /**
172
      * Removes global logging transport from the library logging framework.
176
      * Removes global logging transport from the library logging framework.
173
      * @param globalTransport
177
      * @param globalTransport
176
     removeGlobalLogTransport(globalTransport) {
180
     removeGlobalLogTransport(globalTransport) {
177
         Logger.removeGlobalTransport(globalTransport);
181
         Logger.removeGlobalTransport(globalTransport);
178
     },
182
     },
183
+
179
     /**
184
     /**
180
      * Creates the media tracks and returns them trough the callback.
185
      * Creates the media tracks and returns them trough the callback.
181
      * @param options Object with properties / settings specifying the tracks which should be created.
186
      * @param options Object with properties / settings specifying the tracks which should be created.
339
                 return Promise.reject(error);
344
                 return Promise.reject(error);
340
             });
345
             });
341
     },
346
     },
347
+
342
     /**
348
     /**
343
      * Checks if its possible to enumerate available cameras/micropones.
349
      * Checks if its possible to enumerate available cameras/micropones.
344
      * @returns {Promise<boolean>} a Promise which will be resolved only once
350
      * @returns {Promise<boolean>} a Promise which will be resolved only once
352
 
358
 
353
         return this.mediaDevices.isDeviceListAvailable();
359
         return this.mediaDevices.isDeviceListAvailable();
354
     },
360
     },
361
+
355
     /**
362
     /**
356
      * Returns true if changing the input (camera / microphone) or output
363
      * Returns true if changing the input (camera / microphone) or output
357
      * (audio) device is supported and false if not.
364
      * (audio) device is supported and false if not.
366
 
373
 
367
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
374
         return this.mediaDevices.isDeviceChangeAvailable(deviceType);
368
     },
375
     },
376
+
369
     /**
377
     /**
370
      * Executes callback with list of media devices connected.
378
      * Executes callback with list of media devices connected.
371
      * @param {function} callback
379
      * @param {function} callback
376
             + 'JitsiMeetJS.mediaDevices.enumerateDevices instead');
384
             + 'JitsiMeetJS.mediaDevices.enumerateDevices instead');
377
         this.mediaDevices.enumerateDevices(callback);
385
         this.mediaDevices.enumerateDevices(callback);
378
     },
386
     },
387
+
379
     /**
388
     /**
380
      * @returns function that can be used to be attached to window.onerror and
389
      * @returns function that can be used to be attached to window.onerror and
381
      * if options.enableWindowOnErrorHandler is enabled returns
390
      * if options.enableWindowOnErrorHandler is enabled returns

+ 12
- 0
JitsiTrackErrors.js Wyświetl plik

7
  */
7
  */
8
 export const CHROME_EXTENSION_GENERIC_ERROR
8
 export const CHROME_EXTENSION_GENERIC_ERROR
9
     = 'gum.chrome_extension_generic_error';
9
     = 'gum.chrome_extension_generic_error';
10
+
10
 /**
11
 /**
11
  * An error which indicates that the jidesha extension for Chrome is
12
  * An error which indicates that the jidesha extension for Chrome is
12
  * failed to install.
13
  * failed to install.
13
  */
14
  */
14
 export const CHROME_EXTENSION_INSTALLATION_ERROR
15
 export const CHROME_EXTENSION_INSTALLATION_ERROR
15
     = 'gum.chrome_extension_installation_error';
16
     = 'gum.chrome_extension_installation_error';
17
+
16
 /**
18
 /**
17
  * An error which indicates that user canceled screen sharing window
19
  * An error which indicates that user canceled screen sharing window
18
  * selection dialog in jidesha extension for Chrome.
20
  * selection dialog in jidesha extension for Chrome.
19
  */
21
  */
20
 export const CHROME_EXTENSION_USER_CANCELED
22
 export const CHROME_EXTENSION_USER_CANCELED
21
     = 'gum.chrome_extension_user_canceled';
23
     = 'gum.chrome_extension_user_canceled';
24
+
22
 /**
25
 /**
23
  * An error which indicates that some of requested constraints in
26
  * An error which indicates that some of requested constraints in
24
  * getUserMedia call were not satisfied.
27
  * getUserMedia call were not satisfied.
25
  */
28
  */
26
 export const CONSTRAINT_FAILED = 'gum.constraint_failed';
29
 export const CONSTRAINT_FAILED = 'gum.constraint_failed';
30
+
27
 /**
31
 /**
28
  * An error which indicates that the jidesha extension for Firefox is
32
  * An error which indicates that the jidesha extension for Firefox is
29
  * needed to proceed with screen sharing, and that it is not installed.
33
  * needed to proceed with screen sharing, and that it is not installed.
30
  */
34
  */
31
 export const FIREFOX_EXTENSION_NEEDED = 'gum.firefox_extension_needed';
35
 export const FIREFOX_EXTENSION_NEEDED = 'gum.firefox_extension_needed';
36
+
32
 /**
37
 /**
33
  * Generic getUserMedia error.
38
  * Generic getUserMedia error.
34
  */
39
  */
35
 export const GENERAL = 'gum.general';
40
 export const GENERAL = 'gum.general';
41
+
36
 /**
42
 /**
37
  * An error which indicates that requested device was not found.
43
  * An error which indicates that requested device was not found.
38
  */
44
  */
39
 export const NOT_FOUND = 'gum.not_found';
45
 export const NOT_FOUND = 'gum.not_found';
46
+
40
 /**
47
 /**
41
  * An error which indicates that user denied permission to share requested
48
  * An error which indicates that user denied permission to share requested
42
  * device.
49
  * device.
43
  */
50
  */
44
 export const PERMISSION_DENIED = 'gum.permission_denied';
51
 export const PERMISSION_DENIED = 'gum.permission_denied';
52
+
45
 /**
53
 /**
46
  * An error which indicates that track has been already disposed and cannot
54
  * An error which indicates that track has been already disposed and cannot
47
  * be longer used.
55
  * be longer used.
48
  */
56
  */
49
 export const TRACK_IS_DISPOSED = 'track.track_is_disposed';
57
 export const TRACK_IS_DISPOSED = 'track.track_is_disposed';
58
+
50
 /**
59
 /**
51
  * An error which indicates that track is currently in progress of muting or
60
  * An error which indicates that track is currently in progress of muting or
52
  * unmuting itself.
61
  * unmuting itself.
53
  */
62
  */
54
 export const TRACK_MUTE_UNMUTE_IN_PROGRESS = 'track.mute_unmute_inprogress';
63
 export const TRACK_MUTE_UNMUTE_IN_PROGRESS = 'track.mute_unmute_inprogress';
64
+
55
 /**
65
 /**
56
  * An error which indicates that track has no MediaStream associated.
66
  * An error which indicates that track has no MediaStream associated.
57
  */
67
  */
58
 export const TRACK_NO_STREAM_FOUND = 'track.no_stream_found';
68
 export const TRACK_NO_STREAM_FOUND = 'track.no_stream_found';
69
+
59
 /**
70
 /**
60
  * An error which indicates that requested video resolution is not supported
71
  * An error which indicates that requested video resolution is not supported
61
  * by a webcam.
72
  * by a webcam.
62
  */
73
  */
63
 export const UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution';
74
 export const UNSUPPORTED_RESOLUTION = 'gum.unsupported_resolution';
75
+
64
 /**
76
 /**
65
  * Indicates that the track is no receiving any data without reason(the
77
  * Indicates that the track is no receiving any data without reason(the
66
  * stream was stopped, etc)
78
  * stream was stopped, etc)

+ 4
- 0
JitsiTrackEvents.js Wyświetl plik

2
  * The media track was removed to the conference.
2
  * The media track was removed to the conference.
3
  */
3
  */
4
 export const LOCAL_TRACK_STOPPED = 'track.stopped';
4
 export const LOCAL_TRACK_STOPPED = 'track.stopped';
5
+
5
 /**
6
 /**
6
  * Audio levels of a this track was changed.
7
  * Audio levels of a this track was changed.
7
  */
8
  */
11
  * The audio output of the track was changed.
12
  * The audio output of the track was changed.
12
  */
13
  */
13
 export const TRACK_AUDIO_OUTPUT_CHANGED = 'track.audioOutputChanged';
14
 export const TRACK_AUDIO_OUTPUT_CHANGED = 'track.audioOutputChanged';
15
+
14
 /**
16
 /**
15
  * A media track mute status was changed.
17
  * A media track mute status was changed.
16
  */
18
  */
17
 export const TRACK_MUTE_CHANGED = 'track.trackMuteChanged';
19
 export const TRACK_MUTE_CHANGED = 'track.trackMuteChanged';
20
+
18
 /**
21
 /**
19
  * The video type("camera" or "desktop") of the track was changed.
22
  * The video type("camera" or "desktop") of the track was changed.
20
  */
23
  */
21
 export const TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged';
24
 export const TRACK_VIDEOTYPE_CHANGED = 'track.videoTypeChanged';
25
+
22
 /**
26
 /**
23
  * Indicates that the track is no receiving any data without reason(the
27
  * Indicates that the track is no receiving any data without reason(the
24
  * stream was stopped, etc)
28
  * stream was stopped, etc)

+ 7
- 0
doc/example/example.js Wyświetl plik

220
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
220
 // JitsiMeetJS.setLogLevel(JitsiMeetJS.logLevels.ERROR);
221
 const initOptions = {
221
 const initOptions = {
222
     disableAudioLevels: true,
222
     disableAudioLevels: true,
223
+
223
     // The ID of the jidesha extension for Chrome.
224
     // The ID of the jidesha extension for Chrome.
224
     desktopSharingChromeExtId: 'mbocklcggfhnbahlnepmldehdhpjfcjp',
225
     desktopSharingChromeExtId: 'mbocklcggfhnbahlnepmldehdhpjfcjp',
226
+
225
     // Whether desktop sharing should be disabled on Chrome.
227
     // Whether desktop sharing should be disabled on Chrome.
226
     desktopSharingChromeDisabled: false,
228
     desktopSharingChromeDisabled: false,
229
+
227
     // The media sources to use when using screen sharing with the Chrome
230
     // The media sources to use when using screen sharing with the Chrome
228
     // extension.
231
     // extension.
229
     desktopSharingChromeSources: [ 'screen', 'window' ],
232
     desktopSharingChromeSources: [ 'screen', 'window' ],
233
+
230
     // Required version of Chrome extension
234
     // Required version of Chrome extension
231
     desktopSharingChromeMinExtVersion: '0.1',
235
     desktopSharingChromeMinExtVersion: '0.1',
232
 
236
 
233
     // The ID of the jidesha extension for Firefox. If null, we assume that no
237
     // The ID of the jidesha extension for Firefox. If null, we assume that no
234
     // extension is required.
238
     // extension is required.
235
     desktopSharingFirefoxExtId: null,
239
     desktopSharingFirefoxExtId: null,
240
+
236
     // Whether desktop sharing should be disabled on Firefox.
241
     // Whether desktop sharing should be disabled on Firefox.
237
     desktopSharingFirefoxDisabled: true,
242
     desktopSharingFirefoxDisabled: true,
243
+
238
     // The maximum version of Firefox which requires a jidesha extension.
244
     // The maximum version of Firefox which requires a jidesha extension.
239
     // Example: if set to 41, we will require the extension for Firefox versions
245
     // Example: if set to 41, we will require the extension for Firefox versions
240
     // up to and including 41. On Firefox 42 and higher, we will run without the
246
     // up to and including 41. On Firefox 42 and higher, we will run without the
241
     // extension.
247
     // extension.
242
     // If set to -1, an extension will be required for all versions of Firefox.
248
     // If set to -1, an extension will be required for all versions of Firefox.
243
     desktopSharingFirefoxMaxVersionExtRequired: -1,
249
     desktopSharingFirefoxMaxVersionExtRequired: -1,
250
+
244
     // The URL to the Firefox extension for desktop sharing.
251
     // The URL to the Firefox extension for desktop sharing.
245
     desktopSharingFirefoxExtensionURL: null
252
     desktopSharingFirefoxExtensionURL: null
246
 };
253
 };

+ 3
- 0
modules/RTC/DataChannels.js Wyświetl plik

71
 
71
 
72
     dataChannel.onmessage = function(event) {
72
     dataChannel.onmessage = function(event) {
73
         const data = event.data;
73
         const data = event.data;
74
+
74
         // JSON
75
         // JSON
75
         let obj;
76
         let obj;
76
 
77
 
125
             } else if (colibriClass === 'LastNEndpointsChangeEvent') {
126
             } else if (colibriClass === 'LastNEndpointsChangeEvent') {
126
                 // The new/latest list of last-n endpoint IDs.
127
                 // The new/latest list of last-n endpoint IDs.
127
                 const lastNEndpoints = obj.lastNEndpoints;
128
                 const lastNEndpoints = obj.lastNEndpoints;
129
+
128
                 // The list of endpoint IDs which are entering the list of
130
                 // The list of endpoint IDs which are entering the list of
129
                 // last-n at this time i.e. were not in the old list of last-n
131
                 // last-n at this time i.e. were not in the old list of last-n
130
                 // endpoint IDs.
132
                 // endpoint IDs.
150
                     endpoint, isActive);
152
                     endpoint, isActive);
151
             } else {
153
             } else {
152
                 logger.debug('Data channel JSON-formatted message: ', obj);
154
                 logger.debug('Data channel JSON-formatted message: ', obj);
155
+
153
                 // The received message appears to be appropriately formatted
156
                 // The received message appears to be appropriately formatted
154
                 // (i.e. is a JSON object which assigns a value to the mandatory
157
                 // (i.e. is a JSON object which assigns a value to the mandatory
155
                 // property colibriClass) so don't just swallow it, expose it to
158
                 // property colibriClass) so don't just swallow it, expose it to

+ 2
- 0
modules/RTC/JitsiLocalTrack.js Wyświetl plik

333
                 if (streamInfo) {
333
                 if (streamInfo) {
334
                     self._setStream(streamInfo.stream);
334
                     self._setStream(streamInfo.stream);
335
                     self.track = streamInfo.track;
335
                     self.track = streamInfo.track;
336
+
336
                     // This is not good when video type changes after
337
                     // This is not good when video type changes after
337
                     // unmute, but let's not crash here
338
                     // unmute, but let's not crash here
338
                     if (self.videoType !== streamInfo.videoType) {
339
                     if (self.videoType !== streamInfo.videoType) {
552
  */
553
  */
553
 JitsiLocalTrack.prototype._setByteSent = function(bytesSent) {
554
 JitsiLocalTrack.prototype._setByteSent = function(bytesSent) {
554
     this._bytesSent = bytesSent;
555
     this._bytesSent = bytesSent;
556
+
555
     // FIXME it's a shame that PeerConnection and ICE status does not belong
557
     // FIXME it's a shame that PeerConnection and ICE status does not belong
556
     // to the RTC module and it has to be accessed through
558
     // to the RTC module and it has to be accessed through
557
     // the conference(and through the XMPP chat room ???) instead
559
     // the conference(and through the XMPP chat room ???) instead

+ 2
- 0
modules/RTC/JitsiRemoteTrack.js Wyświetl plik

42
     this.rtc = rtc;
42
     this.rtc = rtc;
43
     this.ownerEndpointId = ownerEndpointId;
43
     this.ownerEndpointId = ownerEndpointId;
44
     this.muted = muted;
44
     this.muted = muted;
45
+
45
     // we want to mark whether the track has been ever muted
46
     // we want to mark whether the track has been ever muted
46
     // to detect ttfm events for startmuted conferences, as it can significantly
47
     // to detect ttfm events for startmuted conferences, as it can significantly
47
     // increase ttfm values
48
     // increase ttfm values
48
     this.hasBeenMuted = muted;
49
     this.hasBeenMuted = muted;
50
+
49
     // Bind 'onmute' and 'onunmute' event handlers
51
     // Bind 'onmute' and 'onunmute' event handlers
50
     if (this.rtc && this.track) {
52
     if (this.rtc && this.track) {
51
         this._bindMuteHandlers();
53
         this._bindMuteHandlers();

+ 5
- 0
modules/RTC/RTC.js Wyświetl plik

45
     constructor(conference, options = {}) {
45
     constructor(conference, options = {}) {
46
         super();
46
         super();
47
         this.conference = conference;
47
         this.conference = conference;
48
+
48
         /**
49
         /**
49
          * A map of active <tt>TraceablePeerConnection</tt>.
50
          * A map of active <tt>TraceablePeerConnection</tt>.
50
          * @type {Map.<number, TraceablePeerConnection>}
51
          * @type {Map.<number, TraceablePeerConnection>}
51
          */
52
          */
52
         this.peerConnections = new Map();
53
         this.peerConnections = new Map();
54
+
53
         /**
55
         /**
54
          * The counter used to generated id numbers assigned to peer connections
56
          * The counter used to generated id numbers assigned to peer connections
55
          * @type {number}
57
          * @type {number}
57
         this.peerConnectionIdCounter = 1;
59
         this.peerConnectionIdCounter = 1;
58
 
60
 
59
         this.localTracks = [];
61
         this.localTracks = [];
62
+
60
         // FIXME: We should support multiple streams per jid.
63
         // FIXME: We should support multiple streams per jid.
61
         this.remoteTracks = {};
64
         this.remoteTracks = {};
62
         this.options = options;
65
         this.options = options;
66
+
63
         // A flag whether we had received that the data channel had opened
67
         // A flag whether we had received that the data channel had opened
64
         // we can get this flag out of sync if for some reason data channel got
68
         // we can get this flag out of sync if for some reason data channel got
65
         // closed from server, a desired behaviour so we can see errors when this
69
         // closed from server, a desired behaviour so we can see errors when this
120
             this._dataChannelOpenListener = () => {
124
             this._dataChannelOpenListener = () => {
121
                 // mark that dataChannel is opened
125
                 // mark that dataChannel is opened
122
                 this.dataChannelsOpen = true;
126
                 this.dataChannelsOpen = true;
127
+
123
                 // when the data channel becomes available, tell the bridge
128
                 // when the data channel becomes available, tell the bridge
124
                 // about video selections so that it can do adaptive simulcast,
129
                 // about video selections so that it can do adaptive simulcast,
125
                 // we want the notification to trigger even if userJid
130
                 // we want the notification to trigger even if userJid

+ 3
- 0
modules/RTC/RTCBrowserType.js Wyświetl plik

198
     if (navigator.webkitGetUserMedia) {
198
     if (navigator.webkitGetUserMedia) {
199
         currentBrowser = RTCBrowserType.RTC_BROWSER_CHROME;
199
         currentBrowser = RTCBrowserType.RTC_BROWSER_CHROME;
200
         const userAgent = navigator.userAgent.toLowerCase();
200
         const userAgent = navigator.userAgent.toLowerCase();
201
+
201
         // We can assume that user agent is chrome, because it's
202
         // We can assume that user agent is chrome, because it's
202
         // enforced when 'ext' streaming method is set
203
         // enforced when 'ext' streaming method is set
203
         const ver = parseInt(userAgent.match(/chrome\/(\d+)\./)[1], 10);
204
         const ver = parseInt(userAgent.match(/chrome\/(\d+)\./)[1], 10);
323
     const match
324
     const match
324
         = navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i);
325
         = navigator.userAgent.match(/\b(react[ \t_-]*native)(?:\/(\S+))?/i);
325
     let version;
326
     let version;
327
+
326
     // If we're remote debugging a React Native app, it may be treated as
328
     // If we're remote debugging a React Native app, it may be treated as
327
     // Chrome. Check navigator.product as well and always return some version
329
     // Chrome. Check navigator.product as well and always return some version
328
     // even if we can't get the real one.
330
     // even if we can't get the real one.
358
         detectIE,
360
         detectIE,
359
         detectSafari
361
         detectSafari
360
     ];
362
     ];
363
+
361
     // Try all browser detectors
364
     // Try all browser detectors
362
 
365
 
363
     for (let i = 0; i < detectors.length; i++) {
366
     for (let i = 0; i < detectors.length; i++) {

+ 2
- 0
modules/RTC/RTCUIHelper.js Wyświetl plik

42
 
42
 
43
         return undefined;
43
         return undefined;
44
     },
44
     },
45
+
45
     /**
46
     /**
46
      * Sets 'volume' property of given HTML element displaying RTC audio or
47
      * Sets 'volume' property of given HTML element displaying RTC audio or
47
      * video stream.
48
      * video stream.
53
             streamElement.volume = volume;
54
             streamElement.volume = volume;
54
         }
55
         }
55
     },
56
     },
57
+
56
     /**
58
     /**
57
      * Sets 'autoplay' property of given HTML element displaying RTC audio or
59
      * Sets 'autoplay' property of given HTML element displaying RTC audio or
58
      * video stream.
60
      * video stream.

+ 16
- 0
modules/RTC/RTCUtils.js Wyświetl plik

49
 let audioOutputDeviceId = 'default'; // default device
49
 let audioOutputDeviceId = 'default'; // default device
50
 // whether user has explicitly set a device to use
50
 // whether user has explicitly set a device to use
51
 let audioOutputChanged = false;
51
 let audioOutputChanged = false;
52
+
52
 // Disables Acoustic Echo Cancellation
53
 // Disables Acoustic Echo Cancellation
53
 let disableAEC = false;
54
 let disableAEC = false;
55
+
54
 // Disables Noise Suppression
56
 // Disables Noise Suppression
55
 let disableNS = false;
57
 let disableNS = false;
56
 
58
 
61
 let currentlyAvailableMediaDevices;
63
 let currentlyAvailableMediaDevices;
62
 
64
 
63
 let rawEnumerateDevicesWithCallback;
65
 let rawEnumerateDevicesWithCallback;
66
+
64
 /**
67
 /**
65
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
68
  * "rawEnumerateDevicesWithCallback" will be initialized only after WebRTC is
66
  * ready. Otherwise it is too early to assume that the devices listing is not
69
  * ready. Otherwise it is too early to assume that the devices listing is not
75
                 callback,
78
                 callback,
76
                 () => callback([]));
79
                 () => callback([]));
77
         }
80
         }
81
+
78
         // Safari:
82
         // Safari:
79
         // "ReferenceError: Can't find variable: MediaStreamTrack"
83
         // "ReferenceError: Can't find variable: MediaStreamTrack"
80
         // when Temasys plugin is not installed yet, have to delay this call
84
         // when Temasys plugin is not installed yet, have to delay this call
164
                 // New style of setting device id.
168
                 // New style of setting device id.
165
                 constraints.video.deviceId = options.cameraDeviceId;
169
                 constraints.video.deviceId = options.cameraDeviceId;
166
             }
170
             }
171
+
167
             // Old style.
172
             // Old style.
168
             constraints.video.optional.push({
173
             constraints.video.optional.push({
169
                 sourceId: options.cameraDeviceId
174
                 sourceId: options.cameraDeviceId
223
                     // New style of setting device id.
228
                     // New style of setting device id.
224
                     constraints.audio.deviceId = options.micDeviceId;
229
                     constraints.audio.deviceId = options.micDeviceId;
225
                 }
230
                 }
231
+
226
                 // Old style.
232
                 // Old style.
227
                 constraints.audio.optional.push({
233
                 constraints.audio.optional.push({
228
                     sourceId: options.micDeviceId
234
                     sourceId: options.micDeviceId
229
                 });
235
                 });
230
             }
236
             }
237
+
231
             // if it is good enough for hangouts...
238
             // if it is good enough for hangouts...
232
             constraints.audio.optional.push(
239
             constraints.audio.optional.push(
233
                 { googEchoCancellation: !disableAEC },
240
                 { googEchoCancellation: !disableAEC },
533
     return {
540
     return {
534
         facing: source.facing || null,
541
         facing: source.facing || null,
535
         label: source.label,
542
         label: source.label,
543
+
536
         // theoretically deprecated MediaStreamTrack.getSources should
544
         // theoretically deprecated MediaStreamTrack.getSources should
537
         // not return 'audiooutput' devices but let's handle it in any
545
         // not return 'audiooutput' devices but let's handle it in any
538
         // case
546
         // case
620
             audioStream = streams.audio;
628
             audioStream = streams.audio;
621
             videoStream = streams.video;
629
             videoStream = streams.video;
622
         }
630
         }
631
+
623
         // Again, different choices on different types of browser.
632
         // Again, different choices on different types of browser.
624
         desktopStream = streams.desktopStream || streams.desktop;
633
         desktopStream = streams.desktopStream || streams.desktop;
625
     }
634
     }
668
                 && rtcUtils.isDeviceChangeAvailable('output')
677
                 && rtcUtils.isDeviceChangeAvailable('output')
669
                 && stream.getAudioTracks
678
                 && stream.getAudioTracks
670
                 && stream.getAudioTracks().length
679
                 && stream.getAudioTracks().length
680
+
671
                 // we skip setting audio output if there was no explicit change
681
                 // we skip setting audio output if there was no explicit change
672
                 && audioOutputChanged) {
682
                 && audioOutputChanged) {
673
             element.setSinkId(rtcUtils.getAudioOutputDevice())
683
             element.setSinkId(rtcUtils.getAudioOutputDevice())
729
 
739
 
730
     if (stream) {
740
     if (stream) {
731
         src = stream.jitsiObjectURL;
741
         src = stream.jitsiObjectURL;
742
+
732
         // Save the created URL for stream so we can reuse it and not keep
743
         // Save the created URL for stream so we can reuse it and not keep
733
         // creating URLs.
744
         // creating URLs.
734
         if (!src) {
745
         if (!src) {
838
                     // for the id of MediaStream. Let's just say that a number
849
                     // for the id of MediaStream. Let's just say that a number
839
                     // contains no special characters.
850
                     // contains no special characters.
840
                     const id = stream.id;
851
                     const id = stream.id;
852
+
841
                     // XXX The return statement is affected by automatic
853
                     // XXX The return statement is affected by automatic
842
                     // semicolon insertion (ASI). No line terminator is allowed
854
                     // semicolon insertion (ASI). No line terminator is allowed
843
                     // between the return keyword and the expression.
855
                     // between the return keyword and the expression.
1026
                 reject(new Error('Desktop sharing is not supported!'));
1038
                 reject(new Error('Desktop sharing is not supported!'));
1027
             }
1039
             }
1028
             if (RTCBrowserType.isFirefox()
1040
             if (RTCBrowserType.isFirefox()
1041
+
1029
                     // XXX The react-native-webrtc implementation that we
1042
                     // XXX The react-native-webrtc implementation that we
1030
                     // utilize on React Native at the time of this writing does
1043
                     // utilize on React Native at the time of this writing does
1031
                     // not support the MediaStream constructors defined by
1044
                     // not support the MediaStream constructors defined by
1048
                         screenObtainer,
1061
                         screenObtainer,
1049
                         dsOptions);
1062
                         dsOptions);
1050
                 }
1063
                 }
1064
+
1051
                 // With FF/IE we can't split the stream into audio and video because FF
1065
                 // With FF/IE we can't split the stream into audio and video because FF
1052
                 // doesn't support media stream constructors. So, we need to get the
1066
                 // doesn't support media stream constructors. So, we need to get the
1053
                 // audio stream separately from the video stream using two distinct GUM
1067
                 // audio stream separately from the video stream using two distinct GUM
1199
             };
1213
             };
1200
 
1214
 
1201
             eventEmitter.addListener(RTCEvents.RTC_READY, listener);
1215
             eventEmitter.addListener(RTCEvents.RTC_READY, listener);
1216
+
1202
                 // We have no failed event, so... it either resolves or nothing
1217
                 // We have no failed event, so... it either resolves or nothing
1203
                 // happens
1218
                 // happens
1204
         });
1219
         });
1233
                 || RTCBrowserType.isNWJS()
1248
                 || RTCBrowserType.isNWJS()
1234
                 || RTCBrowserType.isElectron();
1249
                 || RTCBrowserType.isElectron();
1235
     }
1250
     }
1251
+
1236
     /**
1252
     /**
1237
      * A method to handle stopping of the stream.
1253
      * A method to handle stopping of the stream.
1238
      * One point to handle the differences in various implementations.
1254
      * One point to handle the differences in various implementations.

+ 5
- 0
modules/RTC/ScreenObtainer.js Wyświetl plik

85
                     onSuccess,
85
                     onSuccess,
86
                     (error, constraints) => {
86
                     (error, constraints) => {
87
                         let jitsiError;
87
                         let jitsiError;
88
+
88
                         // FIXME:
89
                         // FIXME:
89
                         // This is very very durty fix for recognising that the
90
                         // This is very very durty fix for recognising that the
90
                         // user have clicked the cancel button from the Desktop
91
                         // user have clicked the cancel button from the Desktop
255
                 alert(
256
                 alert(
256
                     'Jitsi Desktop Streamer requires update. '
257
                     'Jitsi Desktop Streamer requires update. '
257
                     + 'Changes will take effect after next Chrome restart.');
258
                     + 'Changes will take effect after next Chrome restart.');
259
+
258
                 /* eslint-enable no-alert */
260
                 /* eslint-enable no-alert */
259
             }
261
             }
260
 
262
 
264
                     arg => {
266
                     arg => {
265
                         logger.log('Extension installed successfully', arg);
267
                         logger.log('Extension installed successfully', arg);
266
                         chromeExtInstalled = true;
268
                         chromeExtInstalled = true;
269
+
267
                         // We need to give a moment to the endpoint to become
270
                         // We need to give a moment to the endpoint to become
268
                         // available.
271
                         // available.
269
                         waitForExtensionAfterInstall(this.options, 200, 10)
272
                         waitForExtensionAfterInstall(this.options, 200, 10)
417
 
420
 
418
                 return;
421
                 return;
419
             }
422
             }
423
+
420
             // Check installed extension version
424
             // Check installed extension version
421
             const extVersion = response.version;
425
             const extVersion = response.version;
422
 
426
 
476
 function initChromeExtension(options) {
480
 function initChromeExtension(options) {
477
     // Initialize Chrome extension inline installs
481
     // Initialize Chrome extension inline installs
478
     initInlineInstalls(options);
482
     initInlineInstalls(options);
483
+
479
     // Check if extension is installed
484
     // Check if extension is installed
480
     checkChromeExtInstalled((installed, updateRequired) => {
485
     checkChromeExtInstalled((installed, updateRequired) => {
481
         chromeExtInstalled = installed;
486
         chromeExtInstalled = installed;

+ 19
- 0
modules/RTC/TraceablePeerConnection.js Wyświetl plik

7
 import RTCBrowserType from './RTCBrowserType.js';
7
 import RTCBrowserType from './RTCBrowserType.js';
8
 import RTCEvents from '../../service/RTC/RTCEvents';
8
 import RTCEvents from '../../service/RTC/RTCEvents';
9
 import RtxModifier from '../xmpp/RtxModifier.js';
9
 import RtxModifier from '../xmpp/RtxModifier.js';
10
+
10
 // FIXME SDP tools should end up in some kind of util module
11
 // FIXME SDP tools should end up in some kind of util module
11
 import SDP from '../xmpp/SDP';
12
 import SDP from '../xmpp/SDP';
12
 import SdpConsistency from '../xmpp/SdpConsistency.js';
13
 import SdpConsistency from '../xmpp/SdpConsistency.js';
41
 function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
42
 function TraceablePeerConnection(rtc, id, signalingLayer, ice_config,
42
                                  constraints, options) {
43
                                  constraints, options) {
43
     const self = this;
44
     const self = this;
45
+
44
     /**
46
     /**
45
      * The parent instance of RTC service which created this
47
      * The parent instance of RTC service which created this
46
      * <tt>TracablePeerConnection</tt>.
48
      * <tt>TracablePeerConnection</tt>.
48
      */
50
      */
49
 
51
 
50
     this.rtc = rtc;
52
     this.rtc = rtc;
53
+
51
     /**
54
     /**
52
      * The peer connection identifier assigned by the RTC module.
55
      * The peer connection identifier assigned by the RTC module.
53
      * @type {number}
56
      * @type {number}
54
      */
57
      */
55
     this.id = id;
58
     this.id = id;
59
+
56
     /**
60
     /**
57
      * The signaling layer which operates this peer connection.
61
      * The signaling layer which operates this peer connection.
58
      * @type {SignalingLayer}
62
      * @type {SignalingLayer}
72
     this.updateLog = [];
76
     this.updateLog = [];
73
     this.stats = {};
77
     this.stats = {};
74
     this.statsinterval = null;
78
     this.statsinterval = null;
79
+
75
     /**
80
     /**
76
      * @type {number}
81
      * @type {number}
77
      */
82
      */
84
     this.simulcast = new Simulcast({ numOfLayers: SIMULCAST_LAYERS,
89
     this.simulcast = new Simulcast({ numOfLayers: SIMULCAST_LAYERS,
85
         explodeRemoteSimulcast: false });
90
         explodeRemoteSimulcast: false });
86
     this.sdpConsistency = new SdpConsistency();
91
     this.sdpConsistency = new SdpConsistency();
92
+
87
     /**
93
     /**
88
      * TracablePeerConnection uses RTC's eventEmitter
94
      * TracablePeerConnection uses RTC's eventEmitter
89
      * @type {EventEmitter}
95
      * @type {EventEmitter}
169
             self.ondatachannel(event);
175
             self.ondatachannel(event);
170
         }
176
         }
171
     };
177
     };
178
+
172
     // XXX: do all non-firefox browsers which we support also support this?
179
     // XXX: do all non-firefox browsers which we support also support this?
173
     if (!RTCBrowserType.isFirefox() && this.maxstats) {
180
     if (!RTCBrowserType.isFirefox() && this.maxstats) {
174
         this.statsinterval = window.setInterval(() => {
181
         this.statsinterval = window.setInterval(() => {
225
 
232
 
226
         return;
233
         return;
227
     }
234
     }
235
+
228
     // Bind 'addtrack'/'removetrack' event handlers
236
     // Bind 'addtrack'/'removetrack' event handlers
229
     if (RTCBrowserType.isChrome() || RTCBrowserType.isNWJS()
237
     if (RTCBrowserType.isChrome() || RTCBrowserType.isNWJS()
230
         || RTCBrowserType.isElectron()) {
238
         || RTCBrowserType.isElectron()) {
235
             this._remoteTrackRemoved(event.target, event.track);
243
             this._remoteTrackRemoved(event.target, event.track);
236
         };
244
         };
237
     }
245
     }
246
+
238
     // Call remoteTrackAdded for each track in the stream
247
     // Call remoteTrackAdded for each track in the stream
239
     const streamAudioTracks = stream.getAudioTracks();
248
     const streamAudioTracks = stream.getAudioTracks();
240
 
249
 
360
 
369
 
361
         return;
370
         return;
362
     }
371
     }
372
+
363
     // Call remoteTrackRemoved for each track in the stream
373
     // Call remoteTrackRemoved for each track in the stream
364
     const streamVideoTracks = stream.getVideoTracks();
374
     const streamVideoTracks = stream.getVideoTracks();
365
 
375
 
441
      * @type {Map<string,TrackSSRCInfo>}
451
      * @type {Map<string,TrackSSRCInfo>}
442
      */
452
      */
443
     const ssrcMap = new Map();
453
     const ssrcMap = new Map();
454
+
444
     /**
455
     /**
445
      * Groups mapped by primary SSRC number
456
      * Groups mapped by primary SSRC number
446
      * @type {Map<number,Array<SSRCGroupInfo>>}
457
      * @type {Map<number,Array<SSRCGroupInfo>>}
474
                         = group.ssrcs.split(' ')
485
                         = group.ssrcs.split(' ')
475
                                      .map(ssrcStr => parseInt(ssrcStr));
486
                                      .map(ssrcStr => parseInt(ssrcStr));
476
                     const primarySSRC = groupSSRCs[0];
487
                     const primarySSRC = groupSSRCs[0];
488
+
477
                     // Note that group.semantics is already present
489
                     // Note that group.semantics is already present
478
 
490
 
479
                     group.ssrcs = groupSSRCs;
491
                     group.ssrcs = groupSSRCs;
669
 
681
 
670
 TraceablePeerConnection.prototype.removeStream = function(stream) {
682
 TraceablePeerConnection.prototype.removeStream = function(stream) {
671
     this.trace('removeStream', stream.id);
683
     this.trace('removeStream', stream.id);
684
+
672
     // FF doesn't support this yet.
685
     // FF doesn't support this yet.
673
     if (this.peerconnection.removeStream) {
686
     if (this.peerconnection.removeStream) {
674
         this.peerconnection.removeStream(stream);
687
         this.peerconnection.removeStream(stream);
684
 TraceablePeerConnection.prototype.setLocalDescription
697
 TraceablePeerConnection.prototype.setLocalDescription
685
         = function(description, successCallback, failureCallback) {
698
         = function(description, successCallback, failureCallback) {
686
             this.trace('setLocalDescription::preTransform', dumpSDP(description));
699
             this.trace('setLocalDescription::preTransform', dumpSDP(description));
700
+
687
     // if we're running on FF, transform to Plan A first.
701
     // if we're running on FF, transform to Plan A first.
688
             if (RTCBrowserType.usesUnifiedPlan()) {
702
             if (RTCBrowserType.usesUnifiedPlan()) {
689
                 description = this.interop.toUnifiedPlan(description);
703
                 description = this.interop.toUnifiedPlan(description);
711
 TraceablePeerConnection.prototype.setRemoteDescription
725
 TraceablePeerConnection.prototype.setRemoteDescription
712
         = function(description, successCallback, failureCallback) {
726
         = function(description, successCallback, failureCallback) {
713
             this.trace('setRemoteDescription::preTransform', dumpSDP(description));
727
             this.trace('setRemoteDescription::preTransform', dumpSDP(description));
728
+
714
     // TODO the focus should squeze or explode the remote simulcast
729
     // TODO the focus should squeze or explode the remote simulcast
715
             description = this.simulcast.mungeRemoteDescription(description);
730
             description = this.simulcast.mungeRemoteDescription(description);
716
             this.trace(
731
             this.trace(
753
             failureCallback(err);
768
             failureCallback(err);
754
         }
769
         }
755
     );
770
     );
771
+
756
     /*
772
     /*
757
      if (this.statsinterval === null && this.maxstats > 0) {
773
      if (this.statsinterval === null && this.maxstats > 0) {
758
      // start gathering stats
774
      // start gathering stats
862
             try {
878
             try {
863
                 this.trace(
879
                 this.trace(
864
                     'createAnswerOnSuccess::preTransform', dumpSDP(answer));
880
                     'createAnswerOnSuccess::preTransform', dumpSDP(answer));
881
+
865
                 // if we're running on FF, transform to Plan A first.
882
                 // if we're running on FF, transform to Plan A first.
866
                 if (RTCBrowserType.usesUnifiedPlan()) {
883
                 if (RTCBrowserType.usesUnifiedPlan()) {
867
                     answer = this.interop.toPlanB(answer);
884
                     answer = this.interop.toPlanB(answer);
933
         };
950
         };
934
 
951
 
935
 TraceablePeerConnection.prototype.addIceCandidate
952
 TraceablePeerConnection.prototype.addIceCandidate
953
+
936
         // eslint-disable-next-line no-unused-vars
954
         // eslint-disable-next-line no-unused-vars
937
         = function(candidate, successCallback, failureCallback) {
955
         = function(candidate, successCallback, failureCallback) {
938
     // var self = this;
956
     // var self = this;
939
             this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
957
             this.trace('addIceCandidate', JSON.stringify(candidate, null, ' '));
940
             this.peerconnection.addIceCandidate(candidate);
958
             this.peerconnection.addIceCandidate(candidate);
959
+
941
     /* maybe later
960
     /* maybe later
942
      this.peerconnection.addIceCandidate(candidate,
961
      this.peerconnection.addIceCandidate(candidate,
943
      function () {
962
      function () {

+ 1
- 0
modules/connectivity/ConnectionQuality.js Wyświetl plik

284
 
284
 
285
         let quality = 100;
285
         let quality = 100;
286
         let packetLoss;
286
         let packetLoss;
287
+
287
         // TODO: take into account packet loss for received streams
288
         // TODO: take into account packet loss for received streams
288
 
289
 
289
         if (this._localStats.packetLoss) {
290
         if (this._localStats.packetLoss) {

+ 4
- 0
modules/connectivity/ParticipantConnectionStatus.js Wyświetl plik

34
     constructor(rtc, conference, rtcMuteTimeout) {
34
     constructor(rtc, conference, rtcMuteTimeout) {
35
         this.rtc = rtc;
35
         this.rtc = rtc;
36
         this.conference = conference;
36
         this.conference = conference;
37
+
37
         /**
38
         /**
38
          * A map of the "endpoint ID"(which corresponds to the resource part
39
          * A map of the "endpoint ID"(which corresponds to the resource part
39
          * of MUC JID(nickname)) to the timeout callback IDs scheduled using
40
          * of MUC JID(nickname)) to the timeout callback IDs scheduled using
41
          * @type {Object.<string, number>}
42
          * @type {Object.<string, number>}
42
          */
43
          */
43
         this.trackTimers = {};
44
         this.trackTimers = {};
45
+
44
         /**
46
         /**
45
          * This map holds the endpoint connection status received from the JVB
47
          * This map holds the endpoint connection status received from the JVB
46
          * (as it might be different than the one stored in JitsiParticipant).
48
          * (as it might be different than the one stored in JitsiParticipant).
48
          * @type {Object.<string, boolean>}
50
          * @type {Object.<string, boolean>}
49
          */
51
          */
50
         this.connStatusFromJvb = { };
52
         this.connStatusFromJvb = { };
53
+
51
         /**
54
         /**
52
          * How long we're going to wait after the RTC video track muted event
55
          * How long we're going to wait after the RTC video track muted event
53
          * for the corresponding signalling mute event, before the connection
56
          * for the corresponding signalling mute event, before the connection
59
         this.rtcMuteTimeout
62
         this.rtcMuteTimeout
60
             = typeof rtcMuteTimeout === 'number'
63
             = typeof rtcMuteTimeout === 'number'
61
                 ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
64
                 ? rtcMuteTimeout : DEFAULT_RTC_MUTE_TIMEOUT;
65
+
62
         /**
66
         /**
63
          * This map holds a timestamp indicating  when participant's video track
67
          * This map holds a timestamp indicating  when participant's video track
64
          * was RTC muted (it is assumed that each participant can have only 1
68
          * was RTC muted (it is assumed that each participant can have only 1

+ 1
- 0
modules/statistics/AnalyticsAdapter.js Wyświetl plik

12
 class CacheAnalytics extends AnalyticsAbstract {
12
 class CacheAnalytics extends AnalyticsAbstract {
13
     constructor() {
13
     constructor() {
14
         super();
14
         super();
15
+
15
         // some events may happen before init or implementation script download
16
         // some events may happen before init or implementation script download
16
         // in this case we accumulate them in this array and send them on init
17
         // in this case we accumulate them in this array and send them on init
17
         this.eventCache = [];
18
         this.eventCache = [];

+ 2
- 0
modules/statistics/CallStats.js Wyświetl plik

165
         this.callStatsSecret = options.callStatsSecret;
165
         this.callStatsSecret = options.callStatsSecret;
166
 
166
 
167
         CallStats.initializeInProgress = true;
167
         CallStats.initializeInProgress = true;
168
+
168
         // userID is generated or given by the origin server
169
         // userID is generated or given by the origin server
169
         callStats.initialize(this.callStatsID,
170
         callStats.initialize(this.callStatsID,
170
             this.callStatsSecret,
171
             this.callStatsSecret,
435
         });
436
         });
436
         CallStats._checkInitialize();
437
         CallStats._checkInitialize();
437
     }
438
     }
439
+
438
     // else just ignore it
440
     // else just ignore it
439
 };
441
 };
440
 
442
 

+ 4
- 0
modules/statistics/RTPStatsCollector.js Wyświetl plik

187
     if (!keys) {
187
     if (!keys) {
188
         throw `The browser type '${this._browserType}' isn't supported!`;
188
         throw `The browser type '${this._browserType}' isn't supported!`;
189
     }
189
     }
190
+
190
     /**
191
     /**
191
      * The function which is to be used to retrieve the value associated in a
192
      * The function which is to be used to retrieve the value associated in a
192
      * report returned by RTCPeerConnection#getStats with a LibJitsiMeet
193
      * report returned by RTCPeerConnection#getStats with a LibJitsiMeet
210
 
211
 
211
     this.statsIntervalId = null;
212
     this.statsIntervalId = null;
212
     this.statsIntervalMilis = statsInterval;
213
     this.statsIntervalMilis = statsInterval;
214
+
213
     // Map of ssrcs to SsrcStats
215
     // Map of ssrcs to SsrcStats
214
     this.ssrc2stats = {};
216
     this.ssrc2stats = {};
215
 }
217
 }
438
             if (!ip || !type || !localip || active != 'true') {
440
             if (!ip || !type || !localip || active != 'true') {
439
                 continue;
441
                 continue;
440
             }
442
             }
443
+
441
             // Save the address unless it has been saved already.
444
             // Save the address unless it has been saved already.
442
             const conferenceStatsTransport = this.conferenceStats.transport;
445
             const conferenceStatsTransport = this.conferenceStats.transport;
443
 
446
 
588
     Object.keys(this.ssrc2stats).forEach(
591
     Object.keys(this.ssrc2stats).forEach(
589
         function(ssrc) {
592
         function(ssrc) {
590
             const ssrcStats = this.ssrc2stats[ssrc];
593
             const ssrcStats = this.ssrc2stats[ssrc];
594
+
591
             // process packet loss stats
595
             // process packet loss stats
592
             const loss = ssrcStats.loss;
596
             const loss = ssrcStats.loss;
593
             const type = loss.isDownloadStream ? 'download' : 'upload';
597
             const type = loss.isDownloadStream ? 'download' : 'upload';

+ 4
- 0
modules/statistics/statistics.js Wyświetl plik

32
                 /* prepend */ true);
32
                 /* prepend */ true);
33
         isCallstatsLoaded = true;
33
         isCallstatsLoaded = true;
34
     }
34
     }
35
+
35
     // FIXME At the time of this writing, we hope that the callstats.io API will
36
     // FIXME At the time of this writing, we hope that the callstats.io API will
36
     // have loaded by the time we needed it (i.e. CallStats.init is invoked).
37
     // have loaded by the time we needed it (i.e. CallStats.init is invoked).
37
 }
38
 }
87
     this.options = options || {};
88
     this.options = options || {};
88
     this.callStatsIntegrationEnabled
89
     this.callStatsIntegrationEnabled
89
         = this.options.callStatsID && this.options.callStatsSecret
90
         = this.options.callStatsID && this.options.callStatsSecret
91
+
90
             // Even though AppID and AppSecret may be specified, the integration
92
             // Even though AppID and AppSecret may be specified, the integration
91
             // of callstats.io may be disabled because of globally-disallowed
93
             // of callstats.io may be disabled because of globally-disallowed
92
             // requests to any third parties.
94
             // requests to any third parties.
95
         loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
97
         loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
96
     }
98
     }
97
     this.callStats = null;
99
     this.callStats = null;
100
+
98
     // Flag indicates whether or not the CallStats have been started for this
101
     // Flag indicates whether or not the CallStats have been started for this
99
     // Statistics instance
102
     // Statistics instance
100
     this.callStatsStarted = false;
103
     this.callStatsStarted = false;
238
         if (index > -1) {
241
         if (index > -1) {
239
             Statistics.callsStatsInstances.splice(index, 1);
242
             Statistics.callsStatsInstances.splice(index, 1);
240
         }
243
         }
244
+
241
         // The next line is commented because we need to be able to send
245
         // The next line is commented because we need to be able to send
242
         // feedback even after the conference has been destroyed.
246
         // feedback even after the conference has been destroyed.
243
         // this.callstats = null;
247
         // this.callstats = null;

+ 16
- 0
modules/transcription/audioRecorder.js Wyświetl plik

16
 const TrackRecorder = function(track) {
16
 const TrackRecorder = function(track) {
17
     // The JitsiTrack holding the stream
17
     // The JitsiTrack holding the stream
18
     this.track = track;
18
     this.track = track;
19
+
19
     // The MediaRecorder recording the stream
20
     // The MediaRecorder recording the stream
20
     this.recorder = null;
21
     this.recorder = null;
22
+
21
     // The array of data chunks recorded from the stream
23
     // The array of data chunks recorded from the stream
22
     // acts as a buffer until the data is stored on disk
24
     // acts as a buffer until the data is stored on disk
23
     this.data = null;
25
     this.data = null;
26
+
24
     // the name of the person of the JitsiTrack. This can be undefined and/or
27
     // the name of the person of the JitsiTrack. This can be undefined and/or
25
     // not unique
28
     // not unique
26
     this.name = null;
29
     this.name = null;
30
+
27
     // the time of the start of the recording
31
     // the time of the start of the recording
28
     this.startTime = null;
32
     this.startTime = null;
29
 };
33
 };
62
  */
66
  */
63
 function instantiateTrackRecorder(track) {
67
 function instantiateTrackRecorder(track) {
64
     const trackRecorder = new TrackRecorder(track);
68
     const trackRecorder = new TrackRecorder(track);
69
+
65
     // Create a new stream which only holds the audio track
70
     // Create a new stream which only holds the audio track
66
     const originalStream = trackRecorder.track.getOriginalStream();
71
     const originalStream = trackRecorder.track.getOriginalStream();
67
     const stream = createEmptyStream();
72
     const stream = createEmptyStream();
68
 
73
 
69
     originalStream.getAudioTracks().forEach(track => stream.addTrack(track));
74
     originalStream.getAudioTracks().forEach(track => stream.addTrack(track));
75
+
70
     // Create the MediaRecorder
76
     // Create the MediaRecorder
71
     trackRecorder.recorder = new MediaRecorder(stream,
77
     trackRecorder.recorder = new MediaRecorder(stream,
72
         { mimeType: audioRecorder.fileType });
78
         { mimeType: audioRecorder.fileType });
79
+
73
     // array for holding the recorder data. Resets it when
80
     // array for holding the recorder data. Resets it when
74
     // audio already has been recorder once
81
     // audio already has been recorder once
75
     trackRecorder.data = [];
82
     trackRecorder.data = [];
83
+
76
     // function handling a dataEvent, e.g the stream gets new data
84
     // function handling a dataEvent, e.g the stream gets new data
77
     trackRecorder.recorder.ondataavailable = function(dataEvent) {
85
     trackRecorder.recorder.ondataavailable = function(dataEvent) {
78
         if (dataEvent.data.size > 0) {
86
         if (dataEvent.data.size > 0) {
133
     if (track.isAudioTrack()) {
141
     if (track.isAudioTrack()) {
134
         // create the track recorder
142
         // create the track recorder
135
         const trackRecorder = instantiateTrackRecorder(track);
143
         const trackRecorder = instantiateTrackRecorder(track);
144
+
136
         // push it to the local array of all recorders
145
         // push it to the local array of all recorders
137
 
146
 
138
         this.recorders.push(trackRecorder);
147
         this.recorders.push(trackRecorder);
148
+
139
         // update the name of the trackRecorders
149
         // update the name of the trackRecorders
140
         this.updateNames();
150
         this.updateNames();
151
+
141
         // If we're already recording, immediately start recording this new
152
         // If we're already recording, immediately start recording this new
142
         // track.
153
         // track.
143
         if (this.isRecording) {
154
         if (this.isRecording) {
211
     if (this.isRecording) {
222
     if (this.isRecording) {
212
         throw new Error('audiorecorder is already recording');
223
         throw new Error('audiorecorder is already recording');
213
     }
224
     }
225
+
214
     // set boolean isRecording flag to true so if new participants join the
226
     // set boolean isRecording flag to true so if new participants join the
215
     // conference, that track can instantly start recording as well
227
     // conference, that track can instantly start recording as well
216
     this.isRecording = true;
228
     this.isRecording = true;
229
+
217
     // start all the mediaRecorders
230
     // start all the mediaRecorders
218
     this.recorders.forEach(trackRecorder => startRecorder(trackRecorder));
231
     this.recorders.forEach(trackRecorder => startRecorder(trackRecorder));
232
+
219
     // log that recording has started
233
     // log that recording has started
220
     console.log(
234
     console.log(
221
         `Started the recording of the audio. There are currently ${
235
         `Started the recording of the audio. There are currently ${
228
 audioRecorder.prototype.stop = function() {
242
 audioRecorder.prototype.stop = function() {
229
     // set the boolean flag to false
243
     // set the boolean flag to false
230
     this.isRecording = false;
244
     this.isRecording = false;
245
+
231
     // stop all recorders
246
     // stop all recorders
232
     this.recorders.forEach(trackRecorder => stopRecorder(trackRecorder));
247
     this.recorders.forEach(trackRecorder => stopRecorder(trackRecorder));
233
     console.log('stopped recording');
248
     console.log('stopped recording');
263
         throw new Error(
278
         throw new Error(
264
             'cannot get blobs because the AudioRecorder is still recording!');
279
             'cannot get blobs because the AudioRecorder is still recording!');
265
     }
280
     }
281
+
266
     // make sure the names are up to date before sending them off
282
     // make sure the names are up to date before sending them off
267
     this.updateNames();
283
     this.updateNames();
268
 
284
 

+ 21
- 0
modules/transcription/transcriber.js Wyświetl plik

20
 const transcriber = function() {
20
 const transcriber = function() {
21
     // the object which can record all audio in the conference
21
     // the object which can record all audio in the conference
22
     this.audioRecorder = new AudioRecorder();
22
     this.audioRecorder = new AudioRecorder();
23
+
23
     // this object can send the recorder audio to a speech-to-text service
24
     // this object can send the recorder audio to a speech-to-text service
24
     this.transcriptionService = new SphinxService();
25
     this.transcriptionService = new SphinxService();
26
+
25
     // holds a counter to keep track if merging can start
27
     // holds a counter to keep track if merging can start
26
     this.counter = null;
28
     this.counter = null;
29
+
27
     // holds the date when transcription started which makes it possible
30
     // holds the date when transcription started which makes it possible
28
     // to calculate the offset between recordings
31
     // to calculate the offset between recordings
29
     this.startTime = null;
32
     this.startTime = null;
33
+
30
     // will hold the transcription once it is completed
34
     // will hold the transcription once it is completed
31
     this.transcription = null;
35
     this.transcription = null;
36
+
32
     // this will be a method which will be called once the transcription is done
37
     // this will be a method which will be called once the transcription is done
33
     // with the transcription as parameter
38
     // with the transcription as parameter
34
     this.callback = null;
39
     this.callback = null;
40
+
35
     // stores all the retrieved speech-to-text results to merge together
41
     // stores all the retrieved speech-to-text results to merge together
36
     // this value will store an Array<Word> object
42
     // this value will store an Array<Word> object
37
     this.results = [];
43
     this.results = [];
44
+
38
     // Stores the current state of the transcription process
45
     // Stores the current state of the transcription process
39
     this.state = BEFORE_STATE;
46
     this.state = BEFORE_STATE;
47
+
40
     // Used in the updateTranscription method to add a new line when the
48
     // Used in the updateTranscription method to add a new line when the
41
     // sentence becomes to long
49
     // sentence becomes to long
42
     this.lineLength = 0;
50
     this.lineLength = 0;
72
                  RECORDING_STATE}" state. It's currently in the "${
80
                  RECORDING_STATE}" state. It's currently in the "${
73
                  this.state}" state`);
81
                  this.state}" state`);
74
     }
82
     }
83
+
75
     // stop the recording
84
     // stop the recording
76
     console.log('stopping recording and sending audio files');
85
     console.log('stopping recording and sending audio files');
77
     this.audioRecorder.stop();
86
     this.audioRecorder.stop();
87
+
78
     // and send all recorded audio the the transcription service
88
     // and send all recorded audio the the transcription service
79
     const t = this;
89
     const t = this;
80
 
90
 
84
         t.transcriptionService.send(recordingResult, callBack);
94
         t.transcriptionService.send(recordingResult, callBack);
85
         t.counter++;
95
         t.counter++;
86
     });
96
     });
97
+
87
     // set the state to "transcribing" so that maybeMerge() functions correctly
98
     // set the state to "transcribing" so that maybeMerge() functions correctly
88
     this.state = TRANSCRIBING_STATE;
99
     this.state = TRANSCRIBING_STATE;
100
+
89
     // and store the callback for later
101
     // and store the callback for later
90
     this.callback = callback;
102
     this.callback = callback;
91
 };
103
 };
104
     console.log(
116
     console.log(
105
         'retrieved an answer from the transcription service. The answer has an'
117
         'retrieved an answer from the transcription service. The answer has an'
106
             + ` array of length: ${answer.wordArray.length}`);
118
             + ` array of length: ${answer.wordArray.length}`);
119
+
107
     // first add the offset between the start of the transcription and
120
     // first add the offset between the start of the transcription and
108
     // the start of the recording to all start and end times
121
     // the start of the recording to all start and end times
109
     if (answer.wordArray.length > 0) {
122
     if (answer.wordArray.length > 0) {
110
         let offset = answer.startTime.getUTCMilliseconds()
123
         let offset = answer.startTime.getUTCMilliseconds()
111
             - this.startTime.getUTCMilliseconds();
124
             - this.startTime.getUTCMilliseconds();
125
+
112
         // transcriber time will always be earlier
126
         // transcriber time will always be earlier
113
 
127
 
114
         if (offset < 0) {
128
         if (offset < 0) {
124
         });
138
         });
125
         array += ']';
139
         array += ']';
126
         console.log(array);
140
         console.log(array);
141
+
127
         // give a name value to the Array object so that the merging can access
142
         // give a name value to the Array object so that the merging can access
128
         // the name value without having to use the whole recordingResult object
143
         // the name value without having to use the whole recordingResult object
129
         // in the algorithm
144
         // in the algorithm
130
         answer.wordArray.name = answer.name;
145
         answer.wordArray.name = answer.name;
131
     }
146
     }
147
+
132
     // then store the array and decrease the counter
148
     // then store the array and decrease the counter
133
     this.results.push(answer.wordArray);
149
     this.results.push(answer.wordArray);
134
     this.counter--;
150
     this.counter--;
135
     console.log(`current counter: ${this.counter}`);
151
     console.log(`current counter: ${this.counter}`);
152
+
136
     // and check if all results have been received.
153
     // and check if all results have been received.
137
     this.maybeMerge();
154
     this.maybeMerge();
138
 };
155
 };
158
         `starting merge process!\n The length of the array: ${
175
         `starting merge process!\n The length of the array: ${
159
              this.results.length}`);
176
              this.results.length}`);
160
     this.transcription = '';
177
     this.transcription = '';
178
+
161
     // the merging algorithm will look over all Word objects who are at pos 0 in
179
     // the merging algorithm will look over all Word objects who are at pos 0 in
162
     // every array. It will then select the one closest in time to the
180
     // every array. It will then select the one closest in time to the
163
     // previously placed word, while removing the selected word from its array
181
     // previously placed word, while removing the selected word from its array
164
     // note: words can be skipped the skipped word's begin and end time somehow
182
     // note: words can be skipped the skipped word's begin and end time somehow
165
     // end up between the closest word start and end time
183
     // end up between the closest word start and end time
166
     const arrays = this.results;
184
     const arrays = this.results;
185
+
167
     // arrays of Word objects
186
     // arrays of Word objects
168
     const potentialWords = []; // array of the first Word objects
187
     const potentialWords = []; // array of the first Word objects
169
     // check if any arrays are already empty and remove them
188
     // check if any arrays are already empty and remove them
186
                 lowestWordArray = wordArray;
205
                 lowestWordArray = wordArray;
187
             }
206
             }
188
         });
207
         });
208
+
189
         // put the word in the transcription
209
         // put the word in the transcription
190
         wordToAdd = lowestWordArray.shift();
210
         wordToAdd = lowestWordArray.shift();
191
         this.updateTranscription(wordToAdd, lowestWordArray.name);
211
         this.updateTranscription(wordToAdd, lowestWordArray.name);
198
                     foundSmaller = true;
218
                     foundSmaller = true;
199
                 }
219
                 }
200
             });
220
             });
221
+
201
             // add next word if no smaller time has been found
222
             // add next word if no smaller time has been found
202
             if (!foundSmaller) {
223
             if (!foundSmaller) {
203
                 wordToAdd = lowestWordArray.shift();
224
                 wordToAdd = lowestWordArray.shift();

+ 6
- 0
modules/transcription/transcriptionServices/SphinxTranscriptionService.js Wyświetl plik

43
                 `unable to accept response from sphinx server. status: ${
43
                 `unable to accept response from sphinx server. status: ${
44
                     request.status}`);
44
                     request.status}`);
45
         }
45
         }
46
+
46
         // if not ready no point to throw an error
47
         // if not ready no point to throw an error
47
     };
48
     };
48
     request.open('POST', this.url);
49
     request.open('POST', this.url);
60
  */
61
  */
61
 SphinxService.prototype.formatResponse = function(response) {
62
 SphinxService.prototype.formatResponse = function(response) {
62
     const result = JSON.parse(response).objects;
63
     const result = JSON.parse(response).objects;
64
+
63
     // make sure to delete the session id object, which is always
65
     // make sure to delete the session id object, which is always
64
     // the first value in the JSON array
66
     // the first value in the JSON array
65
 
67
 
81
  */
83
  */
82
 SphinxService.prototype.verify = function(response) {
84
 SphinxService.prototype.verify = function(response) {
83
     console.log(`response from server:${response.toString()}`);
85
     console.log(`response from server:${response.toString()}`);
86
+
84
     // test if server responded with a string object
87
     // test if server responded with a string object
85
     if (typeof response !== 'string') {
88
     if (typeof response !== 'string') {
86
         return false;
89
         return false;
87
     }
90
     }
91
+
88
     // test if the string can be parsed into valid JSON
92
     // test if the string can be parsed into valid JSON
89
     let json;
93
     let json;
90
 
94
 
95
 
99
 
96
         return false;
100
         return false;
97
     }
101
     }
102
+
98
     // check if the JSON has a "objects" value
103
     // check if the JSON has a "objects" value
99
     if (json.objects === undefined) {
104
     if (json.objects === undefined) {
100
         return false;
105
         return false;
101
     }
106
     }
107
+
102
     // get the "objects" value and check for a session ID
108
     // get the "objects" value and check for a session ID
103
     const array = json.objects;
109
     const array = json.objects;
104
 
110
 

+ 2
- 0
modules/util/EventEmitterForwarder.js Wyświetl plik

24
  */
24
  */
25
 EventEmitterForwarder.prototype.forward = function(...args) {
25
 EventEmitterForwarder.prototype.forward = function(...args) {
26
     const srcEvent = args[0];
26
     const srcEvent = args[0];
27
+
27
     // This will be the "this" value for emit function.
28
     // This will be the "this" value for emit function.
28
 
29
 
29
     args[0] = this.dest;
30
     args[0] = this.dest;
31
+
30
     // Using bind.apply to pass the arguments as Array-like object ("arguments")
32
     // Using bind.apply to pass the arguments as Array-like object ("arguments")
31
     this.src.addListener(
33
     this.src.addListener(
32
         srcEvent,
34
         srcEvent,

+ 2
- 0
modules/util/GlobalOnErrorHandler.js Wyświetl plik

51
     addHandler(handler) {
51
     addHandler(handler) {
52
         handlers.push(handler);
52
         handlers.push(handler);
53
     },
53
     },
54
+
54
     /**
55
     /**
55
      * Calls the global error handler if there is one.
56
      * Calls the global error handler if there is one.
56
      * @param error the error to pass to the error handler
57
      * @param error the error to pass to the error handler
63
         }
64
         }
64
         errHandler(null, null, null, null, error);
65
         errHandler(null, null, null, null, error);
65
     },
66
     },
67
+
66
     /**
68
     /**
67
      * Calls the global rejection handler if there is one.
69
      * Calls the global rejection handler if there is one.
68
      * @param error the error to pass to the rejection handler.
70
      * @param error the error to pass to the rejection handler.

+ 1
- 0
modules/util/Listenable.js Wyświetl plik

13
      */
13
      */
14
     constructor(eventEmitter = new EventEmitter()) {
14
     constructor(eventEmitter = new EventEmitter()) {
15
         this.eventEmitter = eventEmitter;
15
         this.eventEmitter = eventEmitter;
16
+
16
         // aliases for addListener/removeListener
17
         // aliases for addListener/removeListener
17
         this.addEventListener = this.on = this.addListener;
18
         this.addEventListener = this.on = this.addListener;
18
         this.removeEventListener = this.off = this.removeListener;
19
         this.removeEventListener = this.off = this.removeListener;

+ 1
- 0
modules/util/RandomUtil.js Wyświetl plik

55
     randomHexDigit() {
55
     randomHexDigit() {
56
         return randomElement(HEX_DIGITS);
56
         return randomElement(HEX_DIGITS);
57
     },
57
     },
58
+
58
     /**
59
     /**
59
      * Returns a random string of hex digits with length 'len'.
60
      * Returns a random string of hex digits with length 'len'.
60
      * @param len the length.
61
      * @param len the length.

+ 2
- 0
modules/version/ComponentsVersions.js Wyświetl plik

6
  * @type {string}
6
  * @type {string}
7
  */
7
  */
8
 ComponentsVersions.FOCUS_COMPONENT = 'focus';
8
 ComponentsVersions.FOCUS_COMPONENT = 'focus';
9
+
9
 /**
10
 /**
10
  * The constant for the name of the videobridge component.
11
  * The constant for the name of the videobridge component.
11
  * @type {string}
12
  * @type {string}
12
  */
13
  */
13
 ComponentsVersions.VIDEOBRIDGE_COMPONENT = 'videobridge';
14
 ComponentsVersions.VIDEOBRIDGE_COMPONENT = 'videobridge';
15
+
14
 /**
16
 /**
15
  * The constant for the name of the XMPP server component.
17
  * The constant for the name of the XMPP server component.
16
  * @type {string}
18
  * @type {string}

+ 6
- 0
modules/xmpp/ChatRoom.js Wyświetl plik

49
                 packet.up();
49
                 packet.up();
50
             }
50
             }
51
         }
51
         }
52
+
52
         // packet.up();
53
         // packet.up();
53
     }
54
     }
54
 };
55
 };
114
             'value': navigator.userAgent,
115
             'value': navigator.userAgent,
115
             'attributes': { xmlns: 'http://jitsi.org/jitmeet/user-agent' }
116
             'attributes': { xmlns: 'http://jitsi.org/jitmeet/user-agent' }
116
         });
117
         });
118
+
117
         // We need to broadcast 'videomuted' status from the beginning, cause Jicofo
119
         // We need to broadcast 'videomuted' status from the beginning, cause Jicofo
118
         // makes decisions based on that. Initialize it with 'false' here.
120
         // makes decisions based on that. Initialize it with 'false' here.
119
         this.addVideoInfoToPresence(false);
121
         this.addVideoInfoToPresence(false);
273
 
275
 
274
     onPresence(pres) {
276
     onPresence(pres) {
275
         const from = pres.getAttribute('from');
277
         const from = pres.getAttribute('from');
278
+
276
         // Parse roles.
279
         // Parse roles.
277
         const member = {};
280
         const member = {};
278
 
281
 
302
         parser.packet2JSON(pres, nodes);
305
         parser.packet2JSON(pres, nodes);
303
         this.lastPresences[from] = nodes;
306
         this.lastPresences[from] = nodes;
304
         let jibri = null;
307
         let jibri = null;
308
+
305
         // process nodes to extract data needed for MUC_JOINED and
309
         // process nodes to extract data needed for MUC_JOINED and
306
         // MUC_MEMBER_JOINED events
310
         // MUC_MEMBER_JOINED events
307
 
311
 
692
                         type: 'submit' });
696
                         type: 'submit' });
693
                     formsubmit.c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up();
697
                     formsubmit.c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up();
694
                     formsubmit.c('field', { 'var': 'muc#roomconfig_roomsecret' }).c('value').t(key).up().up();
698
                     formsubmit.c('field', { 'var': 'muc#roomconfig_roomsecret' }).c('value').t(key).up().up();
699
+
695
                     // Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
700
                     // Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
696
                     formsubmit.c('field', { 'var': 'muc#roomconfig_whois' }).c('value').t('anyone').up().up();
701
                     formsubmit.c('field', { 'var': 'muc#roomconfig_whois' }).c('value').t('anyone').up().up();
702
+
697
                     // FIXME: is muc#roomconfig_passwordprotectedroom required?
703
                     // FIXME: is muc#roomconfig_passwordprotectedroom required?
698
                     this.connection.sendIQ(formsubmit, onSuccess, onError);
704
                     this.connection.sendIQ(formsubmit, onSuccess, onError);
699
                 } else {
705
                 } else {

+ 23
- 0
modules/xmpp/JingleSessionPC.js Wyświetl plik

56
         this.closed = false;
56
         this.closed = false;
57
 
57
 
58
         this.modifyingLocalStreams = false;
58
         this.modifyingLocalStreams = false;
59
+
59
         /**
60
         /**
60
          * Used to keep state about muted/unmuted video streams
61
          * Used to keep state about muted/unmuted video streams
61
          *  so we can prevent errant source-add/source-removes
62
          *  so we can prevent errant source-add/source-removes
85
 
86
 
86
         this.webrtcIceUdpDisable = Boolean(options.webrtcIceUdpDisable);
87
         this.webrtcIceUdpDisable = Boolean(options.webrtcIceUdpDisable);
87
         this.webrtcIceTcpDisable = Boolean(options.webrtcIceTcpDisable);
88
         this.webrtcIceTcpDisable = Boolean(options.webrtcIceTcpDisable);
89
+
88
         /**
90
         /**
89
          * Flag used to enforce ICE failure through the URL parameter for
91
          * Flag used to enforce ICE failure through the URL parameter for
90
          * the automatic testing purpose.
92
          * the automatic testing purpose.
98
 
100
 
99
     doInitialize() {
101
     doInitialize() {
100
         this.lasticecandidate = false;
102
         this.lasticecandidate = false;
103
+
101
         // True if reconnect is in progress
104
         // True if reconnect is in progress
102
         this.isreconnect = false;
105
         this.isreconnect = false;
106
+
103
         // Set to true if the connection was ever stable
107
         // Set to true if the connection was ever stable
104
         this.wasstable = false;
108
         this.wasstable = false;
109
+
105
         // Create new peer connection instance
110
         // Create new peer connection instance
106
         this.peerconnection
111
         this.peerconnection
107
             = this.rtc.createPeerConnection(
112
             = this.rtc.createPeerConnection(
108
                 this,
113
                 this,
109
                 this.connection.jingle.ice_config,
114
                 this.connection.jingle.ice_config,
115
+
110
                 /* Options */
116
                 /* Options */
111
                 {
117
                 {
112
                     disableSimulcast: this.room.options.disableSimulcast,
118
                     disableSimulcast: this.room.options.disableSimulcast,
123
                 // the check complete.
129
                 // the check complete.
124
                 return;
130
                 return;
125
             }
131
             }
132
+
126
             // XXX this is broken, candidate is not parsed.
133
             // XXX this is broken, candidate is not parsed.
127
             const candidate = ev.candidate;
134
             const candidate = ev.candidate;
128
 
135
 
145
             }
152
             }
146
             this.sendIceCandidate(candidate);
153
             this.sendIceCandidate(candidate);
147
         };
154
         };
155
+
148
         // Note there is a change in the spec about closed:
156
         // Note there is a change in the spec about closed:
149
         // This value moved into the RTCPeerConnectionState enum in
157
         // This value moved into the RTCPeerConnectionState enum in
150
         // the May 13, 2016 draft of the specification, as it reflects the state
158
         // the May 13, 2016 draft of the specification, as it reflects the state
165
                 this.room.eventEmitter.emit(XMPPEvents.SUSPEND_DETECTED);
173
                 this.room.eventEmitter.emit(XMPPEvents.SUSPEND_DETECTED);
166
             }
174
             }
167
         };
175
         };
176
+
168
         /**
177
         /**
169
          * The oniceconnectionstatechange event handler contains the code to
178
          * The oniceconnectionstatechange event handler contains the code to
170
          * execute when the iceconnectionstatechange event, of type Event,
179
          * execute when the iceconnectionstatechange event, of type Event,
206
                     break;
215
                     break;
207
                 }
216
                 }
208
                 this.isreconnect = true;
217
                 this.isreconnect = true;
218
+
209
                     // Informs interested parties that the connection has been
219
                     // Informs interested parties that the connection has been
210
                     // interrupted.
220
                     // interrupted.
211
                 if (this.wasstable) {
221
                 if (this.wasstable) {
260
             }
270
             }
261
         } else {
271
         } else {
262
             logger.log('sendIceCandidate: last candidate.');
272
             logger.log('sendIceCandidate: last candidate.');
273
+
263
             // FIXME: remember to re-think in ICE-restart
274
             // FIXME: remember to re-think in ICE-restart
264
             this.lasticecandidate = true;
275
             this.lasticecandidate = true;
265
         }
276
         }
294
                 for (let i = 0; i < cands.length; i++) {
305
                 for (let i = 0; i < cands.length; i++) {
295
                     const candidate
306
                     const candidate
296
                         = SDPUtil.candidateToJingle(cands[i].candidate);
307
                         = SDPUtil.candidateToJingle(cands[i].candidate);
308
+
297
                     // Mangle ICE candidate if 'failICE' test option is enabled
309
                     // Mangle ICE candidate if 'failICE' test option is enabled
298
 
310
 
299
                     if (this.failICE) {
311
                     if (this.failICE) {
301
                     }
313
                     }
302
                     cand.c('candidate', candidate).up();
314
                     cand.c('candidate', candidate).up();
303
                 }
315
                 }
316
+
304
                 // add fingerprint
317
                 // add fingerprint
305
                 const fingerprint_line
318
                 const fingerprint_line
306
                     = SDPUtil.find_line(
319
                     = SDPUtil.find_line(
323
                 cand.up(); // content
336
                 cand.up(); // content
324
             }
337
             }
325
         }
338
         }
339
+
326
         // might merge last-candidate notification into this, but it is called
340
         // might merge last-candidate notification into this, but it is called
327
         // a lot later. See webrtc issue #2340
341
         // a lot later. See webrtc issue #2340
328
         // logger.log('was this the last candidate', this.lasticecandidate);
342
         // logger.log('was this the last candidate', this.lasticecandidate);
507
             success,
521
             success,
508
             this.newJingleErrorHandler(accept, error => {
522
             this.newJingleErrorHandler(accept, error => {
509
                 failure(error);
523
                 failure(error);
524
+
510
                 // 'session-accept' is a critical timeout and we'll
525
                 // 'session-accept' is a critical timeout and we'll
511
                 // have to restart
526
                 // have to restart
512
                 this.room.eventEmitter.emit(XMPPEvents.SESSION_ACCEPT_TIMEOUT);
527
                 this.room.eventEmitter.emit(XMPPEvents.SESSION_ACCEPT_TIMEOUT);
513
             }),
528
             }),
514
             IQ_TIMEOUT);
529
             IQ_TIMEOUT);
530
+
515
         // XXX Videobridge needs WebRTC's answer (ICE ufrag and pwd, DTLS
531
         // XXX Videobridge needs WebRTC's answer (ICE ufrag and pwd, DTLS
516
         // fingerprint and setup) ASAP in order to start the connection
532
         // fingerprint and setup) ASAP in order to start the connection
517
         // establishment.
533
         // establishment.
688
                                 }\r\n`;
704
                                 }\r\n`;
689
                     }
705
                     }
690
                 });
706
                 });
707
+
691
             // handles both >source and >description>source
708
             // handles both >source and >description>source
692
             const tmp
709
             const tmp
693
                 = $(content).find(
710
                 = $(content).find(
993
             const workFunction = finishedCallback => {
1010
             const workFunction = finishedCallback => {
994
                 const oldSdp
1011
                 const oldSdp
995
                     = new SDP(this.peerconnection.localDescription.sdp);
1012
                     = new SDP(this.peerconnection.localDescription.sdp);
1013
+
996
                 // NOTE the code below assumes that no more than 1 video track
1014
                 // NOTE the code below assumes that no more than 1 video track
997
                 // can be added to the peer connection.
1015
                 // can be added to the peer connection.
998
                 // Transition from no video to video (possibly screen sharing)
1016
                 // Transition from no video to video (possibly screen sharing)
1004
                     // 1. source-remove for the recvonly
1022
                     // 1. source-remove for the recvonly
1005
                     // 2. source-add for the new video stream
1023
                     // 2. source-add for the new video stream
1006
                     this.peerconnection.clearRecvonlySsrc();
1024
                     this.peerconnection.clearRecvonlySsrc();
1025
+
1007
                 // Transition from video to no video
1026
                 // Transition from video to no video
1008
                 } else if (oldTrack && oldTrack.isVideoTrack() && !newTrack) {
1027
                 } else if (oldTrack && oldTrack.isVideoTrack() && !newTrack) {
1009
                     // Clearing current primary SSRC and generating the recvonly
1028
                     // Clearing current primary SSRC and generating the recvonly
1090
                     }
1109
                     }
1091
                 });
1110
                 });
1092
             const ssrcs = [];
1111
             const ssrcs = [];
1112
+
1093
             // handles both >source and >description>source versions
1113
             // handles both >source and >description>source versions
1094
             const tmp
1114
             const tmp
1095
                 = $(content).find(
1115
                 = $(content).find(
1168
                 .then(() => {
1188
                 .then(() => {
1169
                     const newSdp
1189
                     const newSdp
1170
                         = new SDP(this.peerconnection.localDescription.sdp);
1190
                         = new SDP(this.peerconnection.localDescription.sdp);
1191
+
1171
                     // FIXME objects should not be logged
1192
                     // FIXME objects should not be logged
1172
 
1193
 
1173
                     logger.log('SDPs', oldSdp, newSdp);
1194
                     logger.log('SDPs', oldSdp, newSdp);
1203
             return;
1224
             return;
1204
         }
1225
         }
1205
         let sender = null;
1226
         let sender = null;
1227
+
1206
         // On Firefox we don't replace MediaStreams as this messes up the
1228
         // On Firefox we don't replace MediaStreams as this messes up the
1207
         // m-lines (which can't be removed in Plan Unified) and brings a lot
1229
         // m-lines (which can't be removed in Plan Unified) and brings a lot
1208
         // of complications. Instead, we use the RTPSender and remove just
1230
         // of complications. Instead, we use the RTPSender and remove just
1470
      */
1492
      */
1471
     close() {
1493
     close() {
1472
         this.closed = true;
1494
         this.closed = true;
1495
+
1473
         // do not try to close if already closed.
1496
         // do not try to close if already closed.
1474
         this.peerconnection
1497
         this.peerconnection
1475
             && ((this.peerconnection.signalingState
1498
             && ((this.peerconnection.signalingState

+ 4
- 0
modules/xmpp/RtxModifier.js Wyświetl plik

63
         ssrcs: `${primarySsrc} ${rtxSsrc}`
63
         ssrcs: `${primarySsrc} ${rtxSsrc}`
64
     });
64
     });
65
 }
65
 }
66
+
66
 /**
67
 /**
67
  * End helper functions
68
  * End helper functions
68
  */
69
  */
148
             } else {
149
             } else {
149
                 logger.debug(
150
                 logger.debug(
150
                     `No previously associated rtx ssrc for video ssrc ${ssrc}`);
151
                     `No previously associated rtx ssrc for video ssrc ${ssrc}`);
152
+
151
                 // If there's one in the sdp already for it, we'll just set
153
                 // If there's one in the sdp already for it, we'll just set
152
                 //  that as the corresponding one
154
                 //  that as the corresponding one
153
                 const previousAssociatedRtxStream = videoMLine.getRtxSSRC(ssrc);
155
                 const previousAssociatedRtxStream = videoMLine.getRtxSSRC(ssrc);
213
             return sdpStr;
215
             return sdpStr;
214
         }
216
         }
215
         const fidGroups = videoMLine.findGroups('FID');
217
         const fidGroups = videoMLine.findGroups('FID');
218
+
216
         // Remove the fid groups from the mline
219
         // Remove the fid groups from the mline
217
 
220
 
218
         videoMLine.removeGroupsBySemantics('FID');
221
         videoMLine.removeGroupsBySemantics('FID');
222
+
219
         // Get the rtx ssrcs and remove them from the mline
223
         // Get the rtx ssrcs and remove them from the mline
220
         for (const fidGroup of fidGroups) {
224
         for (const fidGroup of fidGroups) {
221
             const rtxSsrc = parseSecondarySSRC(fidGroup);
225
             const rtxSsrc = parseSecondarySSRC(fidGroup);

+ 8
- 0
modules/xmpp/RtxModifier.spec.js Wyświetl plik

97
                 const newPrimaryVideoSsrc = getPrimaryVideoSsrc(newSdp);
97
                 const newPrimaryVideoSsrc = getPrimaryVideoSsrc(newSdp);
98
 
98
 
99
                 expect(newPrimaryVideoSsrc).toEqual(this.primaryVideoSsrc);
99
                 expect(newPrimaryVideoSsrc).toEqual(this.primaryVideoSsrc);
100
+
100
           // Should now have an rtx ssrc as well
101
           // Should now have an rtx ssrc as well
101
                 expect(numVideoSsrcs(newSdp)).toEqual(2);
102
                 expect(numVideoSsrcs(newSdp)).toEqual(2);
103
+
102
           // Should now have an FID group
104
           // Should now have an FID group
103
                 const fidGroups = getVideoGroups(newSdp, 'FID');
105
                 const fidGroups = getVideoGroups(newSdp, 'FID');
104
 
106
 
184
                 const newPrimaryVideoSsrcs = getPrimaryVideoSsrcs(newSdp);
186
                 const newPrimaryVideoSsrcs = getPrimaryVideoSsrcs(newSdp);
185
 
187
 
186
                 expect(newPrimaryVideoSsrcs).toEqual(this.primaryVideoSsrcs);
188
                 expect(newPrimaryVideoSsrcs).toEqual(this.primaryVideoSsrcs);
189
+
187
           // Should now have rtx ssrcs as well
190
           // Should now have rtx ssrcs as well
188
                 expect(numVideoSsrcs(newSdp)).toEqual(this.primaryVideoSsrcs.length * 2);
191
                 expect(numVideoSsrcs(newSdp)).toEqual(this.primaryVideoSsrcs.length * 2);
192
+
189
           // Should now have FID groups
193
           // Should now have FID groups
190
                 const fidGroups = getVideoGroups(newSdp, 'FID');
194
                 const fidGroups = getVideoGroups(newSdp, 'FID');
191
 
195
 
206
 
210
 
207
                 const rtxMapping = new Map();
211
                 const rtxMapping = new Map();
208
                 let fidGroups = getVideoGroups(newSdp, 'FID');
212
                 let fidGroups = getVideoGroups(newSdp, 'FID');
213
+
209
           // Save the first mapping that is made
214
           // Save the first mapping that is made
210
 
215
 
211
                 fidGroups.forEach(fidGroup => {
216
                 fidGroups.forEach(fidGroup => {
215
 
220
 
216
                     rtxMapping.set(fidGroupPrimarySsrc, fidGroupRtxSsrc);
221
                     rtxMapping.set(fidGroupPrimarySsrc, fidGroupRtxSsrc);
217
                 });
222
                 });
223
+
218
           // Now pass the original sdp through again and make sure we get the same mapping
224
           // Now pass the original sdp through again and make sure we get the same mapping
219
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
225
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
220
                 newSdp = transform.parse(newSdpStr);
226
                 newSdp = transform.parse(newSdpStr);
239
 
245
 
240
                 const rtxMapping = new Map();
246
                 const rtxMapping = new Map();
241
                 let fidGroups = getVideoGroups(newSdp, 'FID');
247
                 let fidGroups = getVideoGroups(newSdp, 'FID');
248
+
242
           // Save the first mapping that is made
249
           // Save the first mapping that is made
243
 
250
 
244
                 fidGroups.forEach(fidGroup => {
251
                 fidGroups.forEach(fidGroup => {
250
                 });
257
                 });
251
 
258
 
252
                 this.rtxModifier.clearSsrcCache();
259
                 this.rtxModifier.clearSsrcCache();
260
+
253
           // Now pass the original sdp through again and make sure we get the same mapping
261
           // Now pass the original sdp through again and make sure we get the same mapping
254
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
262
                 newSdpStr = this.rtxModifier.modifyRtxSsrcs(this.transform.write(this.multipleVideoSdp));
255
                 newSdp = transform.parse(newSdpStr);
263
                 newSdp = transform.parse(newSdpStr);

+ 13
- 0
modules/xmpp/SDP.js Wyświetl plik

62
         media_ssrcs[mediaindex] = media;
62
         media_ssrcs[mediaindex] = media;
63
         tmp.forEach(line => {
63
         tmp.forEach(line => {
64
             const linessrc = line.substring(7).split(' ')[0];
64
             const linessrc = line.substring(7).split(' ')[0];
65
+
65
             // allocate new ChannelSsrc
66
             // allocate new ChannelSsrc
66
 
67
 
67
             if (!media.ssrcs[linessrc]) {
68
             if (!media.ssrcs[linessrc]) {
89
 
90
 
90
     return media_ssrcs;
91
     return media_ssrcs;
91
 };
92
 };
93
+
92
 /**
94
 /**
93
  * Returns <tt>true</tt> if this SDP contains given SSRC.
95
  * Returns <tt>true</tt> if this SDP contains given SSRC.
94
  * @param ssrc the ssrc to check.
96
  * @param ssrc the ssrc to check.
151
 
153
 
152
     return lines;
154
     return lines;
153
 };
155
 };
156
+
154
 // remove lines matching prefix from a media section specified by mediaindex
157
 // remove lines matching prefix from a media section specified by mediaindex
155
 // TODO: non-numeric mediaindex could match mid
158
 // TODO: non-numeric mediaindex could match mid
156
 SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
159
 SDP.prototype.removeMediaLines = function(mediaindex, prefix) {
169
 // add content's to a jingle element
172
 // add content's to a jingle element
170
 SDP.prototype.toJingle = function(elem, thecreator) {
173
 SDP.prototype.toJingle = function(elem, thecreator) {
171
     let i, j, k, lines, mline, rtpmap, ssrc, tmp;
174
     let i, j, k, lines, mline, rtpmap, ssrc, tmp;
175
+
172
     // new bundle plan
176
     // new bundle plan
173
 
177
 
174
     lines = SDPUtil.find_lines(this.session, 'a=group:');
178
     lines = SDPUtil.find_lines(this.session, 'a=group:');
221
             for (j = 0; j < mline.fmt.length; j++) {
225
             for (j = 0; j < mline.fmt.length; j++) {
222
                 rtpmap = SDPUtil.find_line(this.media[i], `a=rtpmap:${mline.fmt[j]}`);
226
                 rtpmap = SDPUtil.find_line(this.media[i], `a=rtpmap:${mline.fmt[j]}`);
223
                 elem.c('payload-type', SDPUtil.parse_rtpmap(rtpmap));
227
                 elem.c('payload-type', SDPUtil.parse_rtpmap(rtpmap));
228
+
224
                 // put any 'a=fmtp:' + mline.fmt[j] lines into <param name=foo value=bar/>
229
                 // put any 'a=fmtp:' + mline.fmt[j] lines into <param name=foo value=bar/>
225
                 const afmtpline = SDPUtil.find_line(this.media[i], `a=fmtp:${mline.fmt[j]}`);
230
                 const afmtpline = SDPUtil.find_line(this.media[i], `a=fmtp:${mline.fmt[j]}`);
226
 
231
 
247
                 // new style mapping
252
                 // new style mapping
248
                 elem.c('source', { ssrc,
253
                 elem.c('source', { ssrc,
249
                     xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
254
                     xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
255
+
250
                 // FIXME: group by ssrc and support multiple different ssrcs
256
                 // FIXME: group by ssrc and support multiple different ssrcs
251
                 const ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
257
                 const ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
252
 
258
 
290
                         value: Math.random().toString(36).substring(7)
296
                         value: Math.random().toString(36).substring(7)
291
                     });
297
                     });
292
                     elem.up();
298
                     elem.up();
299
+
293
                     // FIXME what case does this code handle ? remove ???
300
                     // FIXME what case does this code handle ? remove ???
294
                     let msid = null;
301
                     let msid = null;
302
+
295
                     // FIXME what is this ? global APP.RTC in SDP ?
303
                     // FIXME what is this ? global APP.RTC in SDP ?
296
                     const localTrack = APP.RTC.getLocalTracks(mline.media);
304
                     const localTrack = APP.RTC.getLocalTracks(mline.media);
297
 
305
 
366
                             break;
374
                             break;
367
                         }
375
                         }
368
                     }
376
                     }
377
+
369
                     // TODO: handle params
378
                     // TODO: handle params
370
                     elem.up();
379
                     elem.up();
371
                 }
380
                 }
414
             number: sctpAttrs[0], /* SCTP port */
423
             number: sctpAttrs[0], /* SCTP port */
415
             protocol: sctpAttrs[1] /* protocol */
424
             protocol: sctpAttrs[1] /* protocol */
416
         });
425
         });
426
+
417
         // Optional stream count attribute
427
         // Optional stream count attribute
418
         if (sctpAttrs.length > 2) {
428
         if (sctpAttrs.length > 2) {
419
             elem.attrs({ streams: sctpAttrs[2] });
429
             elem.attrs({ streams: sctpAttrs[2] });
420
         }
430
         }
421
         elem.up();
431
         elem.up();
422
     }
432
     }
433
+
423
     // XEP-0320
434
     // XEP-0320
424
     const fingerprints
435
     const fingerprints
425
         = SDPUtil.find_lines(this.media[mediaindex], 'a=fingerprint:', this.session);
436
         = SDPUtil.find_lines(this.media[mediaindex], 'a=fingerprint:', this.session);
440
     if (tmp) {
451
     if (tmp) {
441
         tmp.xmlns = 'urn:xmpp:jingle:transports:ice-udp:1';
452
         tmp.xmlns = 'urn:xmpp:jingle:transports:ice-udp:1';
442
         elem.attrs(tmp);
453
         elem.attrs(tmp);
454
+
443
         // XEP-0176
455
         // XEP-0176
444
         if (SDPUtil.find_line(this.media[mediaindex], 'a=candidate:', this.session)) { // add any a=candidate lines
456
         if (SDPUtil.find_line(this.media[mediaindex], 'a=candidate:', this.session)) { // add any a=candidate lines
445
             const lines = SDPUtil.find_lines(this.media[mediaindex], 'a=candidate:', this.session);
457
             const lines = SDPUtil.find_lines(this.media[mediaindex], 'a=candidate:', this.session);
673
                     .join('; ');
685
                     .join('; ');
674
             media += '\r\n';
686
             media += '\r\n';
675
         }
687
         }
688
+
676
         // xep-0293
689
         // xep-0293
677
         media += self.rtcpFbFromJingle($(this), this.getAttribute('id'));
690
         media += self.rtcpFbFromJingle($(this), this.getAttribute('id'));
678
     });
691
     });

+ 3
- 0
modules/xmpp/SDPDiffer.js Wyświetl plik

54
 
54
 
55
             return;
55
             return;
56
         }
56
         }
57
+
57
         // Look for new ssrcs across the channel
58
         // Look for new ssrcs across the channel
58
         Object.keys(othersMedia.ssrcs).forEach(ssrc => {
59
         Object.keys(othersMedia.ssrcs).forEach(ssrc => {
59
             if (Object.keys(myMedia.ssrcs).indexOf(ssrc) === -1) {
60
             if (Object.keys(myMedia.ssrcs).indexOf(ssrc) === -1) {
126
         modify.c('description',
127
         modify.c('description',
127
             { xmlns: 'urn:xmpp:jingle:apps:rtp:1',
128
             { xmlns: 'urn:xmpp:jingle:apps:rtp:1',
128
                 media: media.mid });
129
                 media: media.mid });
130
+
129
         // FIXME: not completely sure this operates on blocks and / or handles
131
         // FIXME: not completely sure this operates on blocks and / or handles
130
         // different ssrcs correctly
132
         // different ssrcs correctly
131
         // generate sources from lines
133
         // generate sources from lines
134
 
136
 
135
             modify.c('source', { xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
137
             modify.c('source', { xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
136
             modify.attrs({ ssrc: mediaSsrc.ssrc });
138
             modify.attrs({ ssrc: mediaSsrc.ssrc });
139
+
137
             // iterate over ssrc lines
140
             // iterate over ssrc lines
138
             mediaSsrc.lines.forEach(line => {
141
             mediaSsrc.lines.forEach(line => {
139
                 const idx = line.indexOf(' ');
142
                 const idx = line.indexOf(' ');

+ 8
- 0
modules/xmpp/SDPUtil.js Wyświetl plik

69
 
69
 
70
         return data;
70
         return data;
71
     },
71
     },
72
+
72
     /**
73
     /**
73
      * Parses SDP line "a=sctpmap:..." and extracts SCTP port from it.
74
      * Parses SDP line "a=sctpmap:..." and extracts SCTP port from it.
74
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
75
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
78
         const parts = line.substring(10).split(' ');
79
         const parts = line.substring(10).split(' ');
79
         const sctpPort = parts[0];
80
         const sctpPort = parts[0];
80
         const protocol = parts[1];
81
         const protocol = parts[1];
82
+
81
         // Stream count is optional
83
         // Stream count is optional
82
         const streamCount = parts.length > 2 ? parts[2] : null;
84
         const streamCount = parts.length > 2 ? parts[2] : null;
83
 
85
 
152
         candidate.priority = elems[3];
154
         candidate.priority = elems[3];
153
         candidate.ip = elems[4];
155
         candidate.ip = elems[4];
154
         candidate.port = elems[5];
156
         candidate.port = elems[5];
157
+
155
         // elems[6] => "typ"
158
         // elems[6] => "typ"
156
         candidate.type = elems[7];
159
         candidate.type = elems[7];
157
         candidate.generation = 0; // default value, may be overwritten below
160
         candidate.generation = 0; // default value, may be overwritten below
267
         if (!sessionpart) {
270
         if (!sessionpart) {
268
             return false;
271
             return false;
269
         }
272
         }
273
+
270
         // search session part
274
         // search session part
271
         lines = sessionpart.split('\r\n');
275
         lines = sessionpart.split('\r\n');
272
         for (let j = 0; j < lines.length; j++) {
276
         for (let j = 0; j < lines.length; j++) {
289
         if (needles.length || !sessionpart) {
293
         if (needles.length || !sessionpart) {
290
             return needles;
294
             return needles;
291
         }
295
         }
296
+
292
         // search session part
297
         // search session part
293
         lines = sessionpart.split('\r\n');
298
         lines = sessionpart.split('\r\n');
294
         for (let j = 0; j < lines.length; j++) {
299
         for (let j = 0; j < lines.length; j++) {
328
         candidate.priority = elems[3];
333
         candidate.priority = elems[3];
329
         candidate.ip = elems[4];
334
         candidate.ip = elems[4];
330
         candidate.port = elems[5];
335
         candidate.port = elems[5];
336
+
331
         // elems[6] => "typ"
337
         // elems[6] => "typ"
332
         candidate.type = elems[7];
338
         candidate.type = elems[7];
333
 
339
 
367
         line += ' ';
373
         line += ' ';
368
 
374
 
369
         let protocol = cand.getAttribute('protocol');
375
         let protocol = cand.getAttribute('protocol');
376
+
370
         // use tcp candidates for FF
377
         // use tcp candidates for FF
371
 
378
 
372
         if (RTCBrowserType.isFirefox() && protocol.toLowerCase() == 'ssltcp') {
379
         if (RTCBrowserType.isFirefox() && protocol.toLowerCase() == 'ssltcp') {
509
     getMedia(sdp, type) {
516
     getMedia(sdp, type) {
510
         return sdp.media.find(m => m.type === type);
517
         return sdp.media.find(m => m.type === type);
511
     },
518
     },
519
+
512
     /**
520
     /**
513
      * Sets the given codecName as the preferred codec by
521
      * Sets the given codecName as the preferred codec by
514
      *  moving it to the beginning of the payload types
522
      *  moving it to the beginning of the payload types

+ 4
- 0
modules/xmpp/SampleSdpStrings.js Wyświetl plik

184
 
184
 
185
 // A full sdp string representing a client doing simulcast
185
 // A full sdp string representing a client doing simulcast
186
 const simulcastSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastVideoMLineSdp + baseDataMLineSdp;
186
 const simulcastSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastVideoMLineSdp + baseDataMLineSdp;
187
+
187
 // A full sdp string representing a client doing simulcast and rtx
188
 // A full sdp string representing a client doing simulcast and rtx
188
 const simulcastRtxSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastRtxVideoMLineSdp + baseDataMLineSdp;
189
 const simulcastRtxSdpStr = baseSessionSdp + baseAudioMLineSdp + simulcastRtxVideoMLineSdp + baseDataMLineSdp;
190
+
189
 // A full sdp string representing a client doing a single video stream
191
 // A full sdp string representing a client doing a single video stream
190
 const plainVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + plainVideoMLineSdp + baseDataMLineSdp;
192
 const plainVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + plainVideoMLineSdp + baseDataMLineSdp;
193
+
191
 // A full sdp string representing a client doing a single video stream with rtx
194
 // A full sdp string representing a client doing a single video stream with rtx
192
 const rtxVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + rtxVideoMLineSdp + baseDataMLineSdp;
195
 const rtxVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + rtxVideoMLineSdp + baseDataMLineSdp;
196
+
193
 // A full sdp string representing a client doing a single video stream with multiple codec options
197
 // A full sdp string representing a client doing a single video stream with multiple codec options
194
 const multiCodecVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + multiCodecVideoMLine + baseDataMLineSdp;
198
 const multiCodecVideoSdpStr = baseSessionSdp + baseAudioMLineSdp + multiCodecVideoMLine + baseDataMLineSdp;
195
 
199
 

+ 1
- 0
modules/xmpp/SdpTransformUtil.js Wyświetl plik

267
             // Not using _ssrcs on purpose here
267
             // Not using _ssrcs on purpose here
268
             return this.mLine.ssrcs[0].id;
268
             return this.mLine.ssrcs[0].id;
269
         }
269
         }
270
+
270
             // Look for a SIM or FID group
271
             // Look for a SIM or FID group
271
         if (this.mLine.ssrcGroups) {
272
         if (this.mLine.ssrcGroups) {
272
             const simGroup = this.findGroup('SIM');
273
             const simGroup = this.findGroup('SIM');

+ 17
- 0
modules/xmpp/moderator.js Wyświetl plik

19
 
19
 
20
             return;
20
             return;
21
         }
21
         }
22
+
22
         // Calculate next timeout
23
         // Calculate next timeout
23
         const timeout = Math.pow(2, count - 1);
24
         const timeout = Math.pow(2, count - 1);
24
 
25
 
33
     this.xmppService = xmpp;
34
     this.xmppService = xmpp;
34
     this.getNextTimeout = createExpBackoffTimer(1000);
35
     this.getNextTimeout = createExpBackoffTimer(1000);
35
     this.getNextErrorTimeout = createExpBackoffTimer(1000);
36
     this.getNextErrorTimeout = createExpBackoffTimer(1000);
37
+
36
     // External authentication stuff
38
     // External authentication stuff
37
     this.externalAuthEnabled = false;
39
     this.externalAuthEnabled = false;
38
     this.options = options;
40
     this.options = options;
46
     this.eventEmitter = emitter;
48
     this.eventEmitter = emitter;
47
 
49
 
48
     this.connection = this.xmppService.connection;
50
     this.connection = this.xmppService.connection;
51
+
49
     // FIXME:
52
     // FIXME:
50
     // Message listener that talks to POPUP window
53
     // Message listener that talks to POPUP window
51
     function listener(event) {
54
     function listener(event) {
58
                 return;
61
                 return;
59
             }
62
             }
60
             Settings.setSessionId(event.data.sessionId);
63
             Settings.setSessionId(event.data.sessionId);
64
+
61
             // After popup is closed we will authenticate
65
             // After popup is closed we will authenticate
62
         }
66
         }
63
     }
67
     }
68
+
64
     // Register
69
     // Register
65
     if (window.addEventListener) {
70
     if (window.addEventListener) {
66
         window.addEventListener('message', listener, false);
71
         window.addEventListener('message', listener, false);
102
 Moderator.prototype.getFocusComponent = function() {
107
 Moderator.prototype.getFocusComponent = function() {
103
     // Get focus component address
108
     // Get focus component address
104
     let focusComponent = this.options.connection.hosts.focus;
109
     let focusComponent = this.options.connection.hosts.focus;
110
+
105
     // If not specified use default:  'focus.domain'
111
     // If not specified use default:  'focus.domain'
106
 
112
 
107
     if (!focusComponent) {
113
     if (!focusComponent) {
138
                 value: this.options.connection.enforcedBridge
144
                 value: this.options.connection.enforcedBridge
139
             }).up();
145
             }).up();
140
     }
146
     }
147
+
141
     // Tell the focus we have Jigasi configured
148
     // Tell the focus we have Jigasi configured
142
     if (this.options.connection.hosts !== undefined
149
     if (this.options.connection.hosts !== undefined
143
         && this.options.connection.hosts.call_control !== undefined) {
150
         && this.options.connection.hosts.call_control !== undefined) {
287
 Moderator.prototype.allocateConferenceFocus = function(callback) {
294
 Moderator.prototype.allocateConferenceFocus = function(callback) {
288
     // Try to use focus user JID from the config
295
     // Try to use focus user JID from the config
289
     this.setFocusUserJid(this.options.connection.focusUserJid);
296
     this.setFocusUserJid(this.options.connection.focusUserJid);
297
+
290
     // Send create conference IQ
298
     // Send create conference IQ
291
     this.connection.sendIQ(
299
     this.connection.sendIQ(
292
         this.createConferenceIq(),
300
         this.createConferenceIq(),
293
         result => this._allocateConferenceFocusSuccess(result, callback),
301
         result => this._allocateConferenceFocusSuccess(result, callback),
294
         error => this._allocateConferenceFocusError(error, callback));
302
         error => this._allocateConferenceFocusError(error, callback));
303
+
295
     // XXX We're pressed for time here because we're beginning a complex and/or
304
     // XXX We're pressed for time here because we're beginning a complex and/or
296
     // lengthy conference-establishment process which supposedly involves
305
     // lengthy conference-establishment process which supposedly involves
297
     // multiple RTTs. We don't have the time to wait for Strophe to decide to
306
     // multiple RTTs. We don't have the time to wait for Strophe to decide to
322
 
331
 
323
         return;
332
         return;
324
     }
333
     }
334
+
325
     // Check for error returned by the reservation system
335
     // Check for error returned by the reservation system
326
     const reservationErr = $(error).find('>error>reservation-error');
336
     const reservationErr = $(error).find('>error>reservation-error');
327
 
337
 
339
 
349
 
340
         return;
350
         return;
341
     }
351
     }
352
+
342
     // Not authorized to create new room
353
     // Not authorized to create new room
343
     if ($(error).find('>error>not-authorized').length) {
354
     if ($(error).find('>error>not-authorized').length) {
344
         logger.warn('Unauthorized to start the conference', error);
355
         logger.warn('Unauthorized to start the conference', error);
358
 
369
 
359
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
370
     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
360
     logger.error(errmsg, error);
371
     logger.error(errmsg, error);
372
+
361
     // Show message
373
     // Show message
362
     const focusComponent = this.getFocusComponent();
374
     const focusComponent = this.getFocusComponent();
363
     const retrySec = waitMs / 1000;
375
     const retrySec = waitMs / 1000;
376
+
364
     // FIXME: message is duplicated ? Do not show in case of session invalid
377
     // FIXME: message is duplicated ? Do not show in case of session invalid
365
     // which means just a retry
378
     // which means just a retry
366
 
379
 
368
         this.eventEmitter.emit(
381
         this.eventEmitter.emit(
369
                 XMPPEvents.FOCUS_DISCONNECTED, focusComponent, retrySec);
382
                 XMPPEvents.FOCUS_DISCONNECTED, focusComponent, retrySec);
370
     }
383
     }
384
+
371
     // Reset response timeout
385
     // Reset response timeout
372
     this.getNextTimeout(true);
386
     this.getNextTimeout(true);
373
     window.setTimeout(() => this.allocateConferenceFocus(callback), waitMs);
387
     window.setTimeout(() => this.allocateConferenceFocus(callback), waitMs);
390
 
404
 
391
     // Reset the error timeout (because we haven't failed here).
405
     // Reset the error timeout (because we haven't failed here).
392
     this.getNextErrorTimeout(true);
406
     this.getNextErrorTimeout(true);
407
+
393
     // eslint-disable-next-line newline-per-chained-call
408
     // eslint-disable-next-line newline-per-chained-call
394
     if ($(result).find('conference').attr('ready') === 'true') {
409
     if ($(result).find('conference').attr('ready') === 'true') {
395
         // Reset the non-error timeout (because we've succeeded here).
410
         // Reset the non-error timeout (because we've succeeded here).
396
         this.getNextTimeout(true);
411
         this.getNextTimeout(true);
412
+
397
         // Exec callback
413
         // Exec callback
398
         callback();
414
         callback();
399
     } else {
415
     } else {
448
         str = `POPUP ${str}`;
464
         str = `POPUP ${str}`;
449
     }
465
     }
450
     iq.c('login-url', attrs);
466
     iq.c('login-url', attrs);
467
+
451
     /**
468
     /**
452
      * Implements a failure callback which reports an error message and an error
469
      * Implements a failure callback which reports an error message and an error
453
      * through (1) GlobalOnErrorHandler, (2) logger, and (3) failureCb.
470
      * through (1) GlobalOnErrorHandler, (2) logger, and (3) failureCb.

+ 1
- 0
modules/xmpp/strophe.emuc.js Wyświetl plik

20
 
20
 
21
     init(connection) {
21
     init(connection) {
22
         super.init(connection);
22
         super.init(connection);
23
+
23
         // add handlers (just once)
24
         // add handlers (just once)
24
         this.connection.addHandler(this.onPresence.bind(this), null,
25
         this.connection.addHandler(this.onPresence.bind(this), null,
25
             'presence', null, null, null, null);
26
             'presence', null, null, null, null);

+ 6
- 0
modules/xmpp/strophe.jingle.js Wyświetl plik

25
                 'OfferToReceiveAudio': true,
25
                 'OfferToReceiveAudio': true,
26
                 'OfferToReceiveVideo': true
26
                 'OfferToReceiveVideo': true
27
             }
27
             }
28
+
28
             // MozDontOfferDataChannel: true when this is firefox
29
             // MozDontOfferDataChannel: true when this is firefox
29
         };
30
         };
30
     }
31
     }
39
         const sid = $(iq).find('jingle').attr('sid');
40
         const sid = $(iq).find('jingle').attr('sid');
40
         const action = $(iq).find('jingle').attr('action');
41
         const action = $(iq).find('jingle').attr('action');
41
         const fromJid = iq.getAttribute('from');
42
         const fromJid = iq.getAttribute('from');
43
+
42
         // send ack first
44
         // send ack first
43
         const ack = $iq({ type: 'result',
45
         const ack = $iq({ type: 'result',
44
             to: fromJid,
46
             to: fromJid,
60
 
62
 
61
                 return true;
63
                 return true;
62
             }
64
             }
65
+
63
             // local jid is not checked
66
             // local jid is not checked
64
             if (fromJid != sess.peerjid) {
67
             if (fromJid != sess.peerjid) {
65
                 logger.warn(
68
                 logger.warn(
84
             return true;
87
             return true;
85
         }
88
         }
86
         const now = window.performance.now();
89
         const now = window.performance.now();
90
+
87
         // see http://xmpp.org/extensions/xep-0166.html#concepts-session
91
         // see http://xmpp.org/extensions/xep-0166.html#concepts-session
88
 
92
 
89
         switch (action) {
93
         switch (action) {
216
                     case 'turns': {
220
                     case 'turns': {
217
                         dict.url = `${type}:`;
221
                         dict.url = `${type}:`;
218
                         const username = el.attr('username');
222
                         const username = el.attr('username');
223
+
219
                             // https://code.google.com/p/webrtc/issues/detail?id=1508
224
                             // https://code.google.com/p/webrtc/issues/detail?id=1508
220
 
225
 
221
                         if (username) {
226
                         if (username) {
255
                 logger.warn('getting turn credentials failed', err);
260
                 logger.warn('getting turn credentials failed', err);
256
                 logger.warn('is mod_turncredentials or similar installed?');
261
                 logger.warn('is mod_turncredentials or similar installed?');
257
             });
262
             });
263
+
258
         // implement push?
264
         // implement push?
259
     }
265
     }
260
 
266
 

+ 1
- 0
modules/xmpp/strophe.ping.js Wyświetl plik

108
                 if (this.failedPings >= PING_THRESHOLD) {
108
                 if (this.failedPings >= PING_THRESHOLD) {
109
                     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
109
                     GlobalOnErrorHandler.callErrorHandler(new Error(errmsg));
110
                     logger.error(errmsg, error);
110
                     logger.error(errmsg, error);
111
+
111
                     // FIXME it doesn't help to disconnect when 3rd PING
112
                     // FIXME it doesn't help to disconnect when 3rd PING
112
                     // times out, it only stops Strophe from retrying.
113
                     // times out, it only stops Strophe from retrying.
113
                     // Not really sure what's the right thing to do in that
114
                     // Not really sure what's the right thing to do in that

+ 2
- 0
modules/xmpp/strophe.util.js Wyświetl plik

55
                 && msg.indexOf('timed out (secondary), restarting') !== -1) {
55
                 && msg.indexOf('timed out (secondary), restarting') !== -1) {
56
             level = Strophe.LogLevel.WARN;
56
             level = Strophe.LogLevel.WARN;
57
         }
57
         }
58
+
58
         /* eslint-disable no-case-declarations */
59
         /* eslint-disable no-case-declarations */
59
         switch (level) {
60
         switch (level) {
60
         case Strophe.LogLevel.DEBUG:
61
         case Strophe.LogLevel.DEBUG:
83
             logger.error(msg);
84
             logger.error(msg);
84
             break;
85
             break;
85
         }
86
         }
87
+
86
         /* eslint-enable no-case-declarations */
88
         /* eslint-enable no-case-declarations */
87
     };
89
     };
88
 
90
 

+ 3
- 0
modules/xmpp/xmpp.js Wyświetl plik

176
                 // more than 4 times. The connection is dropped without
176
                 // more than 4 times. The connection is dropped without
177
                 // supplying a reason(error message/event) through the API.
177
                 // supplying a reason(error message/event) through the API.
178
                 logger.error('XMPP connection dropped!');
178
                 logger.error('XMPP connection dropped!');
179
+
179
                 // XXX if the last request error is within 5xx range it means it
180
                 // XXX if the last request error is within 5xx range it means it
180
                 // was a server failure
181
                 // was a server failure
181
                 const lastErrorStatus = Strophe.getLastErrorStatus();
182
                 const lastErrorStatus = Strophe.getLastErrorStatus();
260
             let configDomain
261
             let configDomain
261
                 = this.options.hosts.anonymousdomain
262
                 = this.options.hosts.anonymousdomain
262
                     || this.options.hosts.domain;
263
                     || this.options.hosts.domain;
264
+
263
             // Force authenticated domain if room is appended with '?login=true'
265
             // Force authenticated domain if room is appended with '?login=true'
264
             // or if we're joining with the token
266
             // or if we're joining with the token
265
 
267
 
288
             // node of the anonymous JID is very long - here we trim it a bit
290
             // node of the anonymous JID is very long - here we trim it a bit
289
             mucNickname = mucNickname.substr(0, 8);
291
             mucNickname = mucNickname.substr(0, 8);
290
         }
292
         }
293
+
291
         // Constant JIDs need some random part to be appended in order to be
294
         // Constant JIDs need some random part to be appended in order to be
292
         // able to join the MUC more than once.
295
         // able to join the MUC more than once.
293
         if (this.authenticatedUser || cfgNickname !== null) {
296
         if (this.authenticatedUser || cfgNickname !== null) {

+ 9
- 0
service/RTC/RTCEvents.js Wyświetl plik

3
      * Indicates error while create answer call.
3
      * Indicates error while create answer call.
4
      */
4
      */
5
     CREATE_ANSWER_FAILED: 'rtc.create_answer_failed',
5
     CREATE_ANSWER_FAILED: 'rtc.create_answer_failed',
6
+
6
     /**
7
     /**
7
      * Indicates error while create offer call.
8
      * Indicates error while create offer call.
8
      * FIXME not used (yet), but hook up with create offer failure once added
9
      * FIXME not used (yet), but hook up with create offer failure once added
9
      */
10
      */
10
     CREATE_OFFER_FAILED: 'rtc.create_offer_failed',
11
     CREATE_OFFER_FAILED: 'rtc.create_offer_failed',
11
     RTC_READY: 'rtc.ready',
12
     RTC_READY: 'rtc.ready',
13
+
12
     /**
14
     /**
13
      * FIXME: rename to something closer to "local streams SDP changed"
15
      * FIXME: rename to something closer to "local streams SDP changed"
14
      * Indicates that the local sendrecv streams in local SDP are changed.
16
      * Indicates that the local sendrecv streams in local SDP are changed.
21
     LASTN_ENDPOINT_CHANGED: 'rtc.lastn_endpoint_changed',
23
     LASTN_ENDPOINT_CHANGED: 'rtc.lastn_endpoint_changed',
22
     AVAILABLE_DEVICES_CHANGED: 'rtc.available_devices_changed',
24
     AVAILABLE_DEVICES_CHANGED: 'rtc.available_devices_changed',
23
     TRACK_ATTACHED: 'rtc.track_attached',
25
     TRACK_ATTACHED: 'rtc.track_attached',
26
+
24
     /**
27
     /**
25
      * Event fired when we remote track is added to the conference.
28
      * Event fired when we remote track is added to the conference.
26
      * The following structure is passed as an argument:
29
      * The following structure is passed as an argument:
33
       *         'null' if unknown
36
       *         'null' if unknown
34
      **/
37
      **/
35
     REMOTE_TRACK_ADDED: 'rtc.remote_track_added',
38
     REMOTE_TRACK_ADDED: 'rtc.remote_track_added',
39
+
36
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
40
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
37
     // (currently implemented for local tracks only)
41
     // (currently implemented for local tracks only)
38
     REMOTE_TRACK_MUTE: 'rtc.remote_track_mute',
42
     REMOTE_TRACK_MUTE: 'rtc.remote_track_mute',
43
+
39
     /**
44
     /**
40
      * Indicates that the remote track has been removed from the conference.
45
      * Indicates that the remote track has been removed from the conference.
41
      * 1st event argument is the ID of the parent WebRTC stream to which
46
      * 1st event argument is the ID of the parent WebRTC stream to which
43
      * 2nd event argument is the ID of the removed track.
48
      * 2nd event argument is the ID of the removed track.
44
      */
49
      */
45
     REMOTE_TRACK_REMOVED: 'rtc.remote_track_removed',
50
     REMOTE_TRACK_REMOVED: 'rtc.remote_track_removed',
51
+
46
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
52
     // FIXME get rid of this event in favour of NO_DATA_FROM_SOURCE event
47
     // (currently implemented for local tracks only)
53
     // (currently implemented for local tracks only)
48
     REMOTE_TRACK_UNMUTE: 'rtc.remote_track_unmute',
54
     REMOTE_TRACK_UNMUTE: 'rtc.remote_track_unmute',
55
+
49
     /**
56
     /**
50
      * Indicates error while set local description.
57
      * Indicates error while set local description.
51
      */
58
      */
52
     SET_LOCAL_DESCRIPTION_FAILED: 'rtc.set_local_description_failed',
59
     SET_LOCAL_DESCRIPTION_FAILED: 'rtc.set_local_description_failed',
60
+
53
     /**
61
     /**
54
      * Indicates error while set remote description.
62
      * Indicates error while set remote description.
55
      */
63
      */
57
     AUDIO_OUTPUT_DEVICE_CHANGED: 'rtc.audio_output_device_changed',
65
     AUDIO_OUTPUT_DEVICE_CHANGED: 'rtc.audio_output_device_changed',
58
     DEVICE_LIST_CHANGED: 'rtc.device_list_changed',
66
     DEVICE_LIST_CHANGED: 'rtc.device_list_changed',
59
     DEVICE_LIST_AVAILABLE: 'rtc.device_list_available',
67
     DEVICE_LIST_AVAILABLE: 'rtc.device_list_available',
68
+
60
     /**
69
     /**
61
      * Indicates that a message from another participant is received on
70
      * Indicates that a message from another participant is received on
62
      * data channel.
71
      * data channel.

+ 2
- 0
service/RTC/Resolutions.js Wyświetl plik

24
         height: 720,
24
         height: 720,
25
         order: 5
25
         order: 5
26
     },
26
     },
27
+
27
     // 16:9 resolution first.
28
     // 16:9 resolution first.
28
     '360': {
29
     '360': {
29
         width: 640,
30
         width: 640,
40
         height: 480,
41
         height: 480,
41
         order: 3
42
         order: 3
42
     },
43
     },
44
+
43
     // 16:9 resolution first.
45
     // 16:9 resolution first.
44
     '180': {
46
     '180': {
45
         width: 320,
47
         width: 320,

+ 1
- 0
service/RTC/SignalingLayer.js Wyświetl plik

23
     getSSRCOwner(ssrc) { // eslint-disable-line no-unused-vars
23
     getSSRCOwner(ssrc) { // eslint-disable-line no-unused-vars
24
         throw new Error('not implemented');
24
         throw new Error('not implemented');
25
     }
25
     }
26
+
26
     /**
27
     /**
27
      * Obtains the info about given media advertised in the MUC presence of
28
      * Obtains the info about given media advertised in the MUC presence of
28
      * the participant identified by the given MUC JID.
29
      * the participant identified by the given MUC JID.

+ 1
- 0
service/RTC/VideoType.js Wyświetl plik

8
      * The camera video type.
8
      * The camera video type.
9
      */
9
      */
10
     CAMERA: 'camera',
10
     CAMERA: 'camera',
11
+
11
     /**
12
     /**
12
      * The desktop video type.
13
      * The desktop video type.
13
      */
14
      */

+ 40
- 0
service/xmpp/XMPPEvents.js Wyświetl plik

3
      * Indicates error while adding ice candidate.
3
      * Indicates error while adding ice candidate.
4
      */
4
      */
5
     ADD_ICE_CANDIDATE_FAILED: 'xmpp.add_ice_candidate_failed',
5
     ADD_ICE_CANDIDATE_FAILED: 'xmpp.add_ice_candidate_failed',
6
+
6
     // Designates an event indicating that the focus has asked us to mute our
7
     // Designates an event indicating that the focus has asked us to mute our
7
     // audio.
8
     // audio.
8
     AUDIO_MUTED_BY_FOCUS: 'xmpp.audio_muted_by_focus',
9
     AUDIO_MUTED_BY_FOCUS: 'xmpp.audio_muted_by_focus',
9
     AUTHENTICATION_REQUIRED: 'xmpp.authentication_required',
10
     AUTHENTICATION_REQUIRED: 'xmpp.authentication_required',
10
     BRIDGE_DOWN: 'xmpp.bridge_down',
11
     BRIDGE_DOWN: 'xmpp.bridge_down',
12
+
11
     // Designates an event indicating that an offer (e.g. Jingle
13
     // Designates an event indicating that an offer (e.g. Jingle
12
     // session-initiate) was received.
14
     // session-initiate) was received.
13
     CALL_INCOMING: 'xmpp.callincoming.jingle',
15
     CALL_INCOMING: 'xmpp.callincoming.jingle',
16
+
14
     // Triggered when Jicofo kills our media session, this can happen while
17
     // Triggered when Jicofo kills our media session, this can happen while
15
     // we're still in the MUC, when it decides to terminate the media session.
18
     // we're still in the MUC, when it decides to terminate the media session.
16
     // For example when the session is idle for too long, because we're the only
19
     // For example when the session is idle for too long, because we're the only
18
     CALL_ENDED: 'xmpp.callended.jingle',
21
     CALL_ENDED: 'xmpp.callended.jingle',
19
     CHAT_ERROR_RECEIVED: 'xmpp.chat_error_received',
22
     CHAT_ERROR_RECEIVED: 'xmpp.chat_error_received',
20
     CONFERENCE_SETUP_FAILED: 'xmpp.conference_setup_failed',
23
     CONFERENCE_SETUP_FAILED: 'xmpp.conference_setup_failed',
24
+
21
     // Designates an event indicating that the connection to the XMPP server
25
     // Designates an event indicating that the connection to the XMPP server
22
     // failed.
26
     // failed.
23
     CONNECTION_FAILED: 'xmpp.connection.failed',
27
     CONNECTION_FAILED: 'xmpp.connection.failed',
28
+
24
     // Designates an event indicating that the media (ICE) connection was
29
     // Designates an event indicating that the media (ICE) connection was
25
     // interrupted. This should go to the RTC module.
30
     // interrupted. This should go to the RTC module.
26
     CONNECTION_INTERRUPTED: 'xmpp.connection.interrupted',
31
     CONNECTION_INTERRUPTED: 'xmpp.connection.interrupted',
32
+
27
     // Designates an event indicating that the media (ICE) connection was
33
     // Designates an event indicating that the media (ICE) connection was
28
     // restored. This should go to the RTC module.
34
     // restored. This should go to the RTC module.
29
     CONNECTION_RESTORED: 'xmpp.connection.restored',
35
     CONNECTION_RESTORED: 'xmpp.connection.restored',
36
+
30
     // Designates an event indicating that the media (ICE) connection failed.
37
     // Designates an event indicating that the media (ICE) connection failed.
31
     // This should go to the RTC module.
38
     // This should go to the RTC module.
32
     CONNECTION_ICE_FAILED: 'xmpp.connection.ice.failed',
39
     CONNECTION_ICE_FAILED: 'xmpp.connection.ice.failed',
40
+
33
     // Designates an event indicating that the display name of a participant
41
     // Designates an event indicating that the display name of a participant
34
     // has changed.
42
     // has changed.
35
     DISPLAY_NAME_CHANGED: 'xmpp.display_name_changed',
43
     DISPLAY_NAME_CHANGED: 'xmpp.display_name_changed',
44
+
36
     /**
45
     /**
37
      * Chat room instance have been added to Strophe.emuc plugin.
46
      * Chat room instance have been added to Strophe.emuc plugin.
38
      */
47
      */
39
     EMUC_ROOM_ADDED: 'xmpp.emuc_room_added',
48
     EMUC_ROOM_ADDED: 'xmpp.emuc_room_added',
49
+
40
     /**
50
     /**
41
      * Chat room instance have been removed from Strophe.emuc plugin.
51
      * Chat room instance have been removed from Strophe.emuc plugin.
42
      */
52
      */
45
     FOCUS_DISCONNECTED: 'xmpp.focus_disconnected',
55
     FOCUS_DISCONNECTED: 'xmpp.focus_disconnected',
46
     FOCUS_LEFT: 'xmpp.focus_left',
56
     FOCUS_LEFT: 'xmpp.focus_left',
47
     GRACEFUL_SHUTDOWN: 'xmpp.graceful_shutdown',
57
     GRACEFUL_SHUTDOWN: 'xmpp.graceful_shutdown',
58
+
48
     /**
59
     /**
49
      * Event fired when 'transport-replace' Jingle message has been received,
60
      * Event fired when 'transport-replace' Jingle message has been received,
50
      * before the new offer is set on the PeerConnection.
61
      * before the new offer is set on the PeerConnection.
51
      */
62
      */
52
     ICE_RESTARTING: 'rtc.ice_restarting',
63
     ICE_RESTARTING: 'rtc.ice_restarting',
64
+
53
     /* Event fired when XMPP error is returned to any request, it is meant to be
65
     /* Event fired when XMPP error is returned to any request, it is meant to be
54
      * used to report 'signaling' errors to CallStats
66
      * used to report 'signaling' errors to CallStats
55
      *
67
      *
61
      * }
73
      * }
62
      */
74
      */
63
     JINGLE_ERROR: 'xmpp.jingle_error',
75
     JINGLE_ERROR: 'xmpp.jingle_error',
76
+
64
     // Event fired when we have failed to set initial offer
77
     // Event fired when we have failed to set initial offer
65
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
78
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
79
+
66
     // Designates an event indicating that we were kicked from the XMPP MUC.
80
     // Designates an event indicating that we were kicked from the XMPP MUC.
67
     KICKED: 'xmpp.kicked',
81
     KICKED: 'xmpp.kicked',
82
+
68
     // Designates an event indicating that our role in the XMPP MUC has changed.
83
     // Designates an event indicating that our role in the XMPP MUC has changed.
69
     LOCAL_ROLE_CHANGED: 'xmpp.localrole_changed',
84
     LOCAL_ROLE_CHANGED: 'xmpp.localrole_changed',
85
+
70
     // Designates an event indicating that an XMPP message in the MUC was
86
     // Designates an event indicating that an XMPP message in the MUC was
71
     // received.
87
     // received.
72
     MESSAGE_RECEIVED: 'xmpp.message_received',
88
     MESSAGE_RECEIVED: 'xmpp.message_received',
89
+
73
     // Designates an event indicating that the XMPP MUC was destroyed.
90
     // Designates an event indicating that the XMPP MUC was destroyed.
74
     MUC_DESTROYED: 'xmpp.muc_destroyed',
91
     MUC_DESTROYED: 'xmpp.muc_destroyed',
92
+
75
     // Designates an event indicating that we have joined the XMPP MUC.
93
     // Designates an event indicating that we have joined the XMPP MUC.
76
     MUC_JOINED: 'xmpp.muc_joined',
94
     MUC_JOINED: 'xmpp.muc_joined',
95
+
77
     // Designates an event indicating that a participant joined the XMPP MUC.
96
     // Designates an event indicating that a participant joined the XMPP MUC.
78
     MUC_MEMBER_JOINED: 'xmpp.muc_member_joined',
97
     MUC_MEMBER_JOINED: 'xmpp.muc_member_joined',
98
+
79
     // Designates an event indicating that a participant left the XMPP MUC.
99
     // Designates an event indicating that a participant left the XMPP MUC.
80
     MUC_MEMBER_LEFT: 'xmpp.muc_member_left',
100
     MUC_MEMBER_LEFT: 'xmpp.muc_member_left',
101
+
81
     // Designates an event indicating that local participant left the muc
102
     // Designates an event indicating that local participant left the muc
82
     MUC_LEFT: 'xmpp.muc_left',
103
     MUC_LEFT: 'xmpp.muc_left',
104
+
83
     // Designates an event indicating that the MUC role of a participant has
105
     // Designates an event indicating that the MUC role of a participant has
84
     // changed.
106
     // changed.
85
     MUC_ROLE_CHANGED: 'xmpp.muc_role_changed',
107
     MUC_ROLE_CHANGED: 'xmpp.muc_role_changed',
108
+
86
     // Designates an event indicating that the MUC has been locked or unlocked.
109
     // Designates an event indicating that the MUC has been locked or unlocked.
87
     MUC_LOCK_CHANGED: 'xmpp.muc_lock_changed',
110
     MUC_LOCK_CHANGED: 'xmpp.muc_lock_changed',
111
+
88
     // Designates an event indicating that a participant in the XMPP MUC has
112
     // Designates an event indicating that a participant in the XMPP MUC has
89
     // advertised that they have audio muted (or unmuted).
113
     // advertised that they have audio muted (or unmuted).
90
     PARTICIPANT_AUDIO_MUTED: 'xmpp.audio_muted',
114
     PARTICIPANT_AUDIO_MUTED: 'xmpp.audio_muted',
115
+
91
     // Designates an event indicating that a participant in the XMPP MUC has
116
     // Designates an event indicating that a participant in the XMPP MUC has
92
     // advertised that they have video muted (or unmuted).
117
     // advertised that they have video muted (or unmuted).
93
     PARTICIPANT_VIDEO_MUTED: 'xmpp.video_muted',
118
     PARTICIPANT_VIDEO_MUTED: 'xmpp.video_muted',
119
+
94
     // Designates an event indicating that the video type (e.g. 'camera' or
120
     // Designates an event indicating that the video type (e.g. 'camera' or
95
     // 'screen') for a participant has changed.
121
     // 'screen') for a participant has changed.
96
     // Note: currently this event fires every time we receive presence from
122
     // Note: currently this event fires every time we receive presence from
97
     // someone (regardless of whether or not the "video type" changed).
123
     // someone (regardless of whether or not the "video type" changed).
98
     PARTICIPANT_VIDEO_TYPE_CHANGED: 'xmpp.video_type',
124
     PARTICIPANT_VIDEO_TYPE_CHANGED: 'xmpp.video_type',
125
+
99
     /**
126
     /**
100
      * Indicates that the features of the participant has been changed.
127
      * Indicates that the features of the participant has been changed.
101
      */
128
      */
102
     PARTCIPANT_FEATURES_CHANGED: 'xmpp.partcipant_features_changed',
129
     PARTCIPANT_FEATURES_CHANGED: 'xmpp.partcipant_features_changed',
103
     PASSWORD_REQUIRED: 'xmpp.password_required',
130
     PASSWORD_REQUIRED: 'xmpp.password_required',
104
     PEERCONNECTION_READY: 'xmpp.peerconnection_ready',
131
     PEERCONNECTION_READY: 'xmpp.peerconnection_ready',
132
+
105
     /**
133
     /**
106
      * Indicates that phone number changed.
134
      * Indicates that phone number changed.
107
      */
135
      */
108
     PHONE_NUMBER_CHANGED: 'conference.phoneNumberChanged',
136
     PHONE_NUMBER_CHANGED: 'conference.phoneNumberChanged',
109
     PRESENCE_STATUS: 'xmpp.presence_status',
137
     PRESENCE_STATUS: 'xmpp.presence_status',
110
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
138
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
139
+
111
     // xmpp is connected and obtained user media
140
     // xmpp is connected and obtained user media
112
     READY_TO_JOIN: 'xmpp.ready_to_join',
141
     READY_TO_JOIN: 'xmpp.ready_to_join',
142
+
113
     /**
143
     /**
114
      * Indicates that recording state changed.
144
      * Indicates that recording state changed.
115
      */
145
      */
116
     RECORDER_STATE_CHANGED: 'xmpp.recorderStateChanged',
146
     RECORDER_STATE_CHANGED: 'xmpp.recorderStateChanged',
147
+
117
     // Designates an event indicating that we received statistics from a
148
     // Designates an event indicating that we received statistics from a
118
     // participant in the MUC.
149
     // participant in the MUC.
119
     REMOTE_STATS: 'xmpp.remote_stats',
150
     REMOTE_STATS: 'xmpp.remote_stats',
121
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
152
     ROOM_CONNECT_ERROR: 'xmpp.room_connect_error',
122
     ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',
153
     ROOM_CONNECT_NOT_ALLOWED_ERROR: 'xmpp.room_connect_error.not_allowed',
123
     ROOM_JOIN_ERROR: 'xmpp.room_join_error',
154
     ROOM_JOIN_ERROR: 'xmpp.room_join_error',
155
+
124
     /**
156
     /**
125
      * Indicates that max users limit has been reached.
157
      * Indicates that max users limit has been reached.
126
      */
158
      */
127
     ROOM_MAX_USERS_ERROR: 'xmpp.room_max_users_error',
159
     ROOM_MAX_USERS_ERROR: 'xmpp.room_max_users_error',
160
+
128
     // Designates an event indicating that we sent an XMPP message to the MUC.
161
     // Designates an event indicating that we sent an XMPP message to the MUC.
129
     SENDING_CHAT_MESSAGE: 'xmpp.sending_chat_message',
162
     SENDING_CHAT_MESSAGE: 'xmpp.sending_chat_message',
163
+
130
     /**
164
     /**
131
      * Event fired when we do not get our 'session-accept' acknowledged by
165
      * Event fired when we do not get our 'session-accept' acknowledged by
132
      * Jicofo. It most likely means that there is serious problem with our
166
      * Jicofo. It most likely means that there is serious problem with our
138
      * packets means that most likely it has never seen our IQ.
172
      * packets means that most likely it has never seen our IQ.
139
      */
173
      */
140
     SESSION_ACCEPT_TIMEOUT: 'xmpp.session_accept_timeout',
174
     SESSION_ACCEPT_TIMEOUT: 'xmpp.session_accept_timeout',
175
+
141
     // Designates an event indicating that we should join the conference with
176
     // Designates an event indicating that we should join the conference with
142
     // audio and/or video muted.
177
     // audio and/or video muted.
143
     START_MUTED_FROM_FOCUS: 'xmpp.start_muted_from_focus',
178
     START_MUTED_FROM_FOCUS: 'xmpp.start_muted_from_focus',
179
+
144
     // Designates an event indicating that the subject of the XMPP MUC has
180
     // Designates an event indicating that the subject of the XMPP MUC has
145
     // changed.
181
     // changed.
146
     SUBJECT_CHANGED: 'xmpp.subject_changed',
182
     SUBJECT_CHANGED: 'xmpp.subject_changed',
183
+
147
     // suspending detected
184
     // suspending detected
148
     SUSPEND_DETECTED: 'xmpp.suspend_detected',
185
     SUSPEND_DETECTED: 'xmpp.suspend_detected',
186
+
149
     // Designates an event indicating that the local ICE username fragment of
187
     // Designates an event indicating that the local ICE username fragment of
150
     // the jingle session has changed.
188
     // the jingle session has changed.
151
     LOCAL_UFRAG_CHANGED: 'xmpp.local_ufrag_changed',
189
     LOCAL_UFRAG_CHANGED: 'xmpp.local_ufrag_changed',
190
+
152
     // Designates an event indicating that the local ICE username fragment of
191
     // Designates an event indicating that the local ICE username fragment of
153
     // the jingle session has changed.
192
     // the jingle session has changed.
154
     REMOTE_UFRAG_CHANGED: 'xmpp.remote_ufrag_changed',
193
     REMOTE_UFRAG_CHANGED: 'xmpp.remote_ufrag_changed',
194
+
155
     // Designates an event indicating that the local ICE connection state has
195
     // Designates an event indicating that the local ICE connection state has
156
     // changed.
196
     // changed.
157
     ICE_CONNECTION_STATE_CHANGED: 'xmpp.ice_connection_state_changed'
197
     ICE_CONNECTION_STATE_CHANGED: 'xmpp.ice_connection_state_changed'

Ładowanie…
Anuluj
Zapisz