Sfoglia il codice sorgente

Documents some of the XMPP events. Renames some of them.

master
Boris Grozev 9 anni fa
parent
commit
332aafbe20

+ 6
- 3
modules/UI/UI.js Vedi File

@@ -260,14 +260,17 @@ function registerListeners() {
260 260
     APP.xmpp.addListener(XMPPEvents.ETHERPAD, initEtherpad);
261 261
     APP.xmpp.addListener(XMPPEvents.AUTHENTICATION_REQUIRED,
262 262
         onAuthenticationRequired);
263
-    APP.xmpp.addListener(XMPPEvents.VIDEO_TYPE, onPeerVideoTypeChanged);
263
+    APP.xmpp.addListener(XMPPEvents.PARTICIPANT_VIDEO_TYPE_CHANGED,
264
+        onPeerVideoTypeChanged);
264 265
     APP.xmpp.addListener(XMPPEvents.DEVICE_AVAILABLE,
265 266
         function (resource, devices) {
266 267
             VideoLayout.setDeviceAvailabilityIcons(resource, devices);
267 268
         });
268 269
 
269
-    APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED, VideoLayout.onAudioMute);
270
-    APP.xmpp.addListener(XMPPEvents.VIDEO_MUTED, VideoLayout.onVideoMute);
270
+    APP.xmpp.addListener(XMPPEvents.PARTICIPANT_AUDIO_MUTED,
271
+        VideoLayout.onAudioMute);
272
+    APP.xmpp.addListener(XMPPEvents.PARTICIPANT_VIDEO_MUTED,
273
+        VideoLayout.onVideoMute);
271 274
     APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS, function (doMuteAudio) {
272 275
         UI.setAudioMuted(doMuteAudio);
273 276
     });

+ 4
- 1
modules/xmpp/JingleSessionPC.js Vedi File

@@ -1355,10 +1355,11 @@ JingleSessionPC.prototype.setLocalDescription = function () {
1355 1355
 }
1356 1356
 
1357 1357
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
1358
+// TODO: is this hack (along with the XMPPEvent-s used only for it) still needed
1359
+// now that we announce an SSRC for receive-only streams?
1358 1360
 function sendKeyframe(pc) {
1359 1361
     console.log('sendkeyframe', pc.iceConnectionState);
1360 1362
     if (pc.iceConnectionState !== 'connected') return; // safe...
1361
-    var self = this;
1362 1363
     pc.setRemoteDescription(
1363 1364
         pc.remoteDescription,
1364 1365
         function () {
@@ -1431,6 +1432,8 @@ JingleSessionPC.prototype.remoteStreamAdded = function (data, times) {
1431 1432
 
1432 1433
     var isVideo = data.stream.getVideoTracks().length > 0;
1433 1434
     // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
1435
+    // TODO: is this hack still needed now that we announce an SSRC for
1436
+    // receive-only streams?
1434 1437
     if (isVideo &&
1435 1438
         data.peerjid && this.peerjid === data.peerjid &&
1436 1439
         data.stream.getVideoTracks().length === 0 &&

+ 3
- 3
modules/xmpp/strophe.emuc.js Vedi File

@@ -138,14 +138,14 @@ module.exports = function(XMPP, eventEmitter) {
138 138
             // Parse audio info tag.
139 139
             var audioMuted = $(pres).find('>audiomuted');
140 140
             if (audioMuted.length) {
141
-                eventEmitter.emit(XMPPEvents.AUDIO_MUTED,
141
+                eventEmitter.emit(XMPPEvents.PARTICIPANT_AUDIO_MUTED,
142 142
                     from, (audioMuted.text() === "true"));
143 143
             }
144 144
 
145 145
             // Parse video info tag.
146 146
             var videoMuted = $(pres).find('>videomuted');
147 147
             if (videoMuted.length) {
148
-                eventEmitter.emit(XMPPEvents.VIDEO_MUTED,
148
+                eventEmitter.emit(XMPPEvents.PARTICIPANT_VIDEO_MUTED,
149 149
                     from, (videoMuted.text() === "true"));
150 150
             }
151 151
 
@@ -180,7 +180,7 @@ module.exports = function(XMPP, eventEmitter) {
180 180
             {
181 181
                 if (videoType.text().length)
182 182
                 {
183
-                    eventEmitter.emit(XMPPEvents.VIDEO_TYPE,
183
+                    eventEmitter.emit(XMPPEvents.PARTICIPANT_VIDEO_TYPE_CHANGED,
184 184
                         Strophe.getResourceFromJid(from), videoType.text());
185 185
                 }
186 186
             }

+ 57
- 19
service/xmpp/XMPPEvents.js Vedi File

@@ -1,47 +1,85 @@
1 1
 var XMPPEvents = {
2
+    // Designates an event indicating that the connection to the XMPP server
3
+    // failed.
2 4
     CONNECTION_FAILED: "xmpp.connection.failed",
3
-    // Indicates an interrupted connection event.
5
+    // Designates an event indicating that the media (ICE) connection was
6
+    // interrupted. This should go to the RTC module.
4 7
     CONNECTION_INTERRUPTED: "xmpp.connection.interrupted",
5
-    // Indicates a restored connection event.
8
+    // Designates an event indicating that the media (ICE) connection was
9
+    // restored. This should go to the RTC module.
6 10
     CONNECTION_RESTORED: "xmpp.connection.restored",
7
-    CONFERENCE_CREATED: "xmpp.conferenceCreated.jingle",
11
+    // Designates an event indicating that an offer (e.g. Jingle
12
+    // session-initiate) was received.
8 13
     CALL_INCOMING: "xmpp.callincoming.jingle",
9
-    DISPOSE_CONFERENCE: "xmpp.dispose_conference",
10
-    GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown",
14
+    // Designates an event indicating that we were kicked from the XMPP MUC.
11 15
     KICKED: "xmpp.kicked",
12
-    BRIDGE_DOWN: "xmpp.bridge_down",
16
+    // Designates an event indicating that the userID for a specific JID has
17
+    // changed.
13 18
     USER_ID_CHANGED: "xmpp.user_id_changed",
14
-    // We joined the MUC
19
+    // Designates an event indicating that we have joined the XMPP MUC.
15 20
     MUC_JOINED: "xmpp.muc_joined",
16
-    // A member joined the MUC
21
+    // Designates an event indicating that a participant joined the XMPP MUC.
17 22
     MUC_MEMBER_JOINED: "xmpp.muc_member_joined",
18
-    // A member left the MUC
23
+    // Designates an event indicating that a participant left the XMPP MUC.
19 24
     MUC_MEMBER_LEFT: "xmpp.muc_member_left",
25
+    // Designates an event indicating that the MUC role of a participant has
26
+    // changed.
20 27
     MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
28
+    // Designates an event indicating that the XMPP MUC was destroyed.
21 29
     MUC_DESTROYED: "xmpp.muc_destroyed",
30
+    // Designates an event indicating that the display name of a participant
31
+    // has changed.
22 32
     DISPLAY_NAME_CHANGED: "xmpp.display_name_changed",
33
+    // Designates an event indicating that we received statistics from a
34
+    // participant in the MUC.
23 35
     REMOTE_STATS: "xmpp.remote_stats",
36
+    // Designates an event indicating that our role in the XMPP MUC has changed.
24 37
     LOCAL_ROLE_CHANGED: "xmpp.localrole_changed",
25
-    PRESENCE_STATUS: "xmpp.presence_status",
26
-    RESERVATION_ERROR: "xmpp.room_reservation_error",
38
+    // Designates an event indicating that the subject of the XMPP MUC has
39
+    // changed.
27 40
     SUBJECT_CHANGED: "xmpp.subject_changed",
41
+    // Designates an event indicating that an XMPP message in the MUC was
42
+    // received.
28 43
     MESSAGE_RECEIVED: "xmpp.message_received",
44
+    // Designates an event indicating that we sent an XMPP message to the MUC.
29 45
     SENDING_CHAT_MESSAGE: "xmpp.sending_chat_message",
46
+    // Designates an event indicating that the video type (e.g. 'camera' or
47
+    // 'screen') for a participant has changed.
48
+    PARTICIPANT_VIDEO_TYPE_CHANGED: "xmpp.video_type",
49
+    // Designates an event indicating that a participant in the XMPP MUC has
50
+    // advertised that they have audio muted (or unmuted).
51
+    PARTICIPANT_AUDIO_MUTED: "xmpp.audio_muted",
52
+    // Designates an event indicating that a participant in the XMPP MUC has
53
+    // advertised that they have video muted (or unmuted).
54
+    PARTICIPANT_VIDEO_MUTED: "xmpp.video_muted",
55
+    // Designates an event indicating that the focus has asked us to mute our
56
+    // audio.
57
+    AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus",
58
+    // Designates an event indicating that a moderator in the room changed the
59
+    // "start muted" settings for the conference.
60
+    START_MUTED_SETTING_CHANGED: "xmpp.start_muted_setting_changed",
61
+    // Designates an event indicating that we should join the conference with
62
+    // audio and/or video muted.
63
+    START_MUTED_FROM_FOCUS: "xmpp.start_muted_from_focus",
64
+
65
+
66
+    PEERCONNECTION_READY: "xmpp.peerconnection_ready",
67
+    CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed",
30 68
     PASSWORD_REQUIRED: "xmpp.password_required",
31 69
     AUTHENTICATION_REQUIRED: "xmpp.authentication_required",
32 70
     CHAT_ERROR_RECEIVED: "xmpp.chat_error_received",
33 71
     ETHERPAD: "xmpp.etherpad",
34 72
     DEVICE_AVAILABLE: "xmpp.device_available",
35
-    VIDEO_TYPE: "xmpp.video_type",
36
-    PEERCONNECTION_READY: "xmpp.peerconnection_ready",
37
-    CONFERENCE_SETUP_FAILED: "xmpp.conference_setup_failed",
38
-    AUDIO_MUTED: "xmpp.audio_muted",
39
-    VIDEO_MUTED: "xmpp.video_muted",
40
-    AUDIO_MUTED_BY_FOCUS: "xmpp.audio_muted_by_focus",
41
-    START_MUTED_SETTING_CHANGED: "xmpp.start_muted_setting_changed",
42
-    START_MUTED_FROM_FOCUS: "xmpp.start_muted_from_focus",
73
+    BRIDGE_DOWN: "xmpp.bridge_down",
74
+    PRESENCE_STATUS: "xmpp.presence_status",
75
+    RESERVATION_ERROR: "xmpp.room_reservation_error",
76
+    DISPOSE_CONFERENCE: "xmpp.dispose_conference",
77
+    GRACEFUL_SHUTDOWN: "xmpp.graceful_shutdown",
78
+    // TODO: only used in a hack, should probably be removed.
43 79
     SET_LOCAL_DESCRIPTION_ERROR: 'xmpp.set_local_description_error',
80
+    // TODO: only used in a hack, should probably be removed.
44 81
     SET_REMOTE_DESCRIPTION_ERROR: 'xmpp.set_remote_description_error',
82
+    // TODO: only used in a hack, should probably be removed.
45 83
     CREATE_ANSWER_ERROR: 'xmpp.create_answer_error',
46 84
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
47 85
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',

Loading…
Annulla
Salva