Pārlūkot izejas kodu

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

j8
Boris Grozev 10 gadus atpakaļ
vecāks
revīzija
332aafbe20

+ 6
- 3
modules/UI/UI.js Parādīt failu

260
     APP.xmpp.addListener(XMPPEvents.ETHERPAD, initEtherpad);
260
     APP.xmpp.addListener(XMPPEvents.ETHERPAD, initEtherpad);
261
     APP.xmpp.addListener(XMPPEvents.AUTHENTICATION_REQUIRED,
261
     APP.xmpp.addListener(XMPPEvents.AUTHENTICATION_REQUIRED,
262
         onAuthenticationRequired);
262
         onAuthenticationRequired);
263
-    APP.xmpp.addListener(XMPPEvents.VIDEO_TYPE, onPeerVideoTypeChanged);
263
+    APP.xmpp.addListener(XMPPEvents.PARTICIPANT_VIDEO_TYPE_CHANGED,
264
+        onPeerVideoTypeChanged);
264
     APP.xmpp.addListener(XMPPEvents.DEVICE_AVAILABLE,
265
     APP.xmpp.addListener(XMPPEvents.DEVICE_AVAILABLE,
265
         function (resource, devices) {
266
         function (resource, devices) {
266
             VideoLayout.setDeviceAvailabilityIcons(resource, devices);
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
     APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS, function (doMuteAudio) {
274
     APP.xmpp.addListener(XMPPEvents.AUDIO_MUTED_BY_FOCUS, function (doMuteAudio) {
272
         UI.setAudioMuted(doMuteAudio);
275
         UI.setAudioMuted(doMuteAudio);
273
     });
276
     });

+ 4
- 1
modules/xmpp/JingleSessionPC.js Parādīt failu

1355
 }
1355
 }
1356
 
1356
 
1357
 // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
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
 function sendKeyframe(pc) {
1360
 function sendKeyframe(pc) {
1359
     console.log('sendkeyframe', pc.iceConnectionState);
1361
     console.log('sendkeyframe', pc.iceConnectionState);
1360
     if (pc.iceConnectionState !== 'connected') return; // safe...
1362
     if (pc.iceConnectionState !== 'connected') return; // safe...
1361
-    var self = this;
1362
     pc.setRemoteDescription(
1363
     pc.setRemoteDescription(
1363
         pc.remoteDescription,
1364
         pc.remoteDescription,
1364
         function () {
1365
         function () {
1431
 
1432
 
1432
     var isVideo = data.stream.getVideoTracks().length > 0;
1433
     var isVideo = data.stream.getVideoTracks().length > 0;
1433
     // an attempt to work around https://github.com/jitsi/jitmeet/issues/32
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
     if (isVideo &&
1437
     if (isVideo &&
1435
         data.peerjid && this.peerjid === data.peerjid &&
1438
         data.peerjid && this.peerjid === data.peerjid &&
1436
         data.stream.getVideoTracks().length === 0 &&
1439
         data.stream.getVideoTracks().length === 0 &&

+ 3
- 3
modules/xmpp/strophe.emuc.js Parādīt failu

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

+ 57
- 19
service/xmpp/XMPPEvents.js Parādīt failu

1
 var XMPPEvents = {
1
 var XMPPEvents = {
2
+    // Designates an event indicating that the connection to the XMPP server
3
+    // failed.
2
     CONNECTION_FAILED: "xmpp.connection.failed",
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
     CONNECTION_INTERRUPTED: "xmpp.connection.interrupted",
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
     CONNECTION_RESTORED: "xmpp.connection.restored",
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
     CALL_INCOMING: "xmpp.callincoming.jingle",
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
     KICKED: "xmpp.kicked",
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
     USER_ID_CHANGED: "xmpp.user_id_changed",
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
     MUC_JOINED: "xmpp.muc_joined",
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
     MUC_MEMBER_JOINED: "xmpp.muc_member_joined",
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
     MUC_MEMBER_LEFT: "xmpp.muc_member_left",
24
     MUC_MEMBER_LEFT: "xmpp.muc_member_left",
25
+    // Designates an event indicating that the MUC role of a participant has
26
+    // changed.
20
     MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
27
     MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
28
+    // Designates an event indicating that the XMPP MUC was destroyed.
21
     MUC_DESTROYED: "xmpp.muc_destroyed",
29
     MUC_DESTROYED: "xmpp.muc_destroyed",
30
+    // Designates an event indicating that the display name of a participant
31
+    // has changed.
22
     DISPLAY_NAME_CHANGED: "xmpp.display_name_changed",
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
     REMOTE_STATS: "xmpp.remote_stats",
35
     REMOTE_STATS: "xmpp.remote_stats",
36
+    // Designates an event indicating that our role in the XMPP MUC has changed.
24
     LOCAL_ROLE_CHANGED: "xmpp.localrole_changed",
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
     SUBJECT_CHANGED: "xmpp.subject_changed",
40
     SUBJECT_CHANGED: "xmpp.subject_changed",
41
+    // Designates an event indicating that an XMPP message in the MUC was
42
+    // received.
28
     MESSAGE_RECEIVED: "xmpp.message_received",
43
     MESSAGE_RECEIVED: "xmpp.message_received",
44
+    // Designates an event indicating that we sent an XMPP message to the MUC.
29
     SENDING_CHAT_MESSAGE: "xmpp.sending_chat_message",
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
     PASSWORD_REQUIRED: "xmpp.password_required",
68
     PASSWORD_REQUIRED: "xmpp.password_required",
31
     AUTHENTICATION_REQUIRED: "xmpp.authentication_required",
69
     AUTHENTICATION_REQUIRED: "xmpp.authentication_required",
32
     CHAT_ERROR_RECEIVED: "xmpp.chat_error_received",
70
     CHAT_ERROR_RECEIVED: "xmpp.chat_error_received",
33
     ETHERPAD: "xmpp.etherpad",
71
     ETHERPAD: "xmpp.etherpad",
34
     DEVICE_AVAILABLE: "xmpp.device_available",
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
     SET_LOCAL_DESCRIPTION_ERROR: 'xmpp.set_local_description_error',
79
     SET_LOCAL_DESCRIPTION_ERROR: 'xmpp.set_local_description_error',
80
+    // TODO: only used in a hack, should probably be removed.
44
     SET_REMOTE_DESCRIPTION_ERROR: 'xmpp.set_remote_description_error',
81
     SET_REMOTE_DESCRIPTION_ERROR: 'xmpp.set_remote_description_error',
82
+    // TODO: only used in a hack, should probably be removed.
45
     CREATE_ANSWER_ERROR: 'xmpp.create_answer_error',
83
     CREATE_ANSWER_ERROR: 'xmpp.create_answer_error',
46
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
84
     JINGLE_FATAL_ERROR: 'xmpp.jingle_fatal_error',
47
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',
85
     PROMPT_FOR_LOGIN: 'xmpp.prompt_for_login',

Notiek ielāde…
Atcelt
Saglabāt