Преглед изворни кода

feat(rtcstats): send meeting uuid to rtcstats (#8526)

* send meeting uuid to rtcstats

* change ret description

* fix flow error

* update lib-jitsi-meet version
master
Andrei Gavrilescu пре 4 година
родитељ
комит
9895a04609
No account linked to committer's email address

+ 5
- 0
conference.js Прегледај датотеку

@@ -33,6 +33,7 @@ import {
33 33
     conferenceLeft,
34 34
     conferenceSubjectChanged,
35 35
     conferenceTimestampChanged,
36
+    conferenceUniqueIdSet,
36 37
     conferenceWillJoin,
37 38
     conferenceWillLeave,
38 39
     dataChannelOpened,
@@ -1865,6 +1866,10 @@ export default {
1865 1866
                 APP.store.dispatch(conferenceLeft(room, ...args));
1866 1867
             });
1867 1868
 
1869
+        room.on(
1870
+            JitsiConferenceEvents.CONFERENCE_UNIQUE_ID_SET,
1871
+            (...args) => APP.store.dispatch(conferenceUniqueIdSet(room, ...args)));
1872
+
1868 1873
         room.on(
1869 1874
             JitsiConferenceEvents.AUTH_STATUS_CHANGED,
1870 1875
             (authEnabled, authLogin) =>

+ 2
- 2
package-lock.json Прегледај датотеку

@@ -10343,8 +10343,8 @@
10343 10343
       }
10344 10344
     },
10345 10345
     "lib-jitsi-meet": {
10346
-      "version": "github:jitsi/lib-jitsi-meet#9fdde46694d1c4bc8b7f051cc8d50e0df29ffd07",
10347
-      "from": "github:jitsi/lib-jitsi-meet#9fdde46694d1c4bc8b7f051cc8d50e0df29ffd07",
10346
+      "version": "github:jitsi/lib-jitsi-meet#479dd989a081e8ae23ca4f4ab68395a2f76d34d0",
10347
+      "from": "github:jitsi/lib-jitsi-meet#479dd989a081e8ae23ca4f4ab68395a2f76d34d0",
10348 10348
       "requires": {
10349 10349
         "@jitsi/js-utils": "1.0.2",
10350 10350
         "@jitsi/sdp-interop": "1.0.3",

+ 1
- 1
package.json Прегледај датотеку

@@ -56,7 +56,7 @@
56 56
     "jquery-i18next": "1.2.1",
57 57
     "js-md5": "0.6.1",
58 58
     "jwt-decode": "2.2.0",
59
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#9fdde46694d1c4bc8b7f051cc8d50e0df29ffd07",
59
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#479dd989a081e8ae23ca4f4ab68395a2f76d34d0",
60 60
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
61 61
     "lodash": "4.17.19",
62 62
     "moment": "2.19.4",

+ 10
- 0
react/features/base/conference/actionTypes.js Прегледај датотеку

@@ -42,6 +42,16 @@ export const CONFERENCE_JOINED = 'CONFERENCE_JOINED';
42 42
  */
43 43
 export const CONFERENCE_LEFT = 'CONFERENCE_LEFT';
44 44
 
45
+/**
46
+ * The type of (redux) action which signals that an uuid for a conference has been set.
47
+ *
48
+ * {
49
+ *     type: CONFERENCE_UNIQUE_ID_SET,
50
+ *     conference: JitsiConference
51
+ * }
52
+ */
53
+export const CONFERENCE_UNIQUE_ID_SET = 'CONFERENCE_UNIQUE_ID_SET';
54
+
45 55
 /**
46 56
  * The type of (redux) action, which indicates conference subject changes.
47 57
  *

+ 17
- 0
react/features/base/conference/actions.js Прегледај датотеку

@@ -36,6 +36,7 @@ import {
36 36
     CONFERENCE_LEFT,
37 37
     CONFERENCE_SUBJECT_CHANGED,
38 38
     CONFERENCE_TIMESTAMP_CHANGED,
39
+    CONFERENCE_UNIQUE_ID_SET,
39 40
     CONFERENCE_WILL_JOIN,
40 41
     CONFERENCE_WILL_LEAVE,
41 42
     DATA_CHANNEL_OPENED,
@@ -295,6 +296,22 @@ export function conferenceLeft(conference: Object) {
295 296
     };
296 297
 }
297 298
 
299
+/**
300
+ * Signals that the unique identifier for conference has been set.
301
+ *
302
+ * @param {JitsiConference} conference - The JitsiConference instance, where the uuid has been set.
303
+ * @returns {{
304
+    *   type: CONFERENCE_UNIQUE_ID_SET,
305
+    *   conference: JitsiConference,
306
+    * }}
307
+    */
308
+export function conferenceUniqueIdSet(conference: Object) {
309
+    return {
310
+        type: CONFERENCE_UNIQUE_ID_SET,
311
+        conference
312
+    };
313
+}
314
+
298 315
 /**
299 316
  * Signals that the conference subject has been changed.
300 317
  *

+ 9
- 5
react/features/rtcstats/middleware.js Прегледај датотеку

@@ -1,9 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { getAmplitudeIdentity } from '../analytics';
4
-import {
5
-    CONFERENCE_JOINED
6
-} from '../base/conference';
4
+import { CONFERENCE_UNIQUE_ID_SET } from '../base/conference';
7 5
 import { LIB_WILL_INIT } from '../base/lib-jitsi-meet';
8 6
 import { getLocalParticipant } from '../base/participants';
9 7
 import { MiddlewareRegistry } from '../base/redux';
@@ -47,7 +45,7 @@ MiddlewareRegistry.register(store => next => action => {
47 45
         }
48 46
         break;
49 47
     }
50
-    case CONFERENCE_JOINED: {
48
+    case CONFERENCE_UNIQUE_ID_SET: {
51 49
         if (isRtcstatsEnabled(state) && RTCStats.isInitialized()) {
52 50
             // Once the conference started connect to the rtcstats server and send data.
53 51
             try {
@@ -55,6 +53,11 @@ MiddlewareRegistry.register(store => next => action => {
55 53
 
56 54
                 const localParticipant = getLocalParticipant(state);
57 55
 
56
+                // Unique identifier for a conference session, not to be confused with meeting name
57
+                // i.e. If all participants leave a meeting it will have a different value on the next join.
58
+                const { conference } = action;
59
+                const meetingUniqueId = conference && conference.getMeetingUniqueId();
60
+
58 61
                 // The current implementation of rtcstats-server is configured to send data to amplitude, thus
59 62
                 // we add identity specific information so we can corelate on the amplitude side. If amplitude is
60 63
                 // not configured an empty object will be sent.
@@ -65,7 +68,8 @@ MiddlewareRegistry.register(store => next => action => {
65 68
                 RTCStats.sendIdentityData({
66 69
                     ...getAmplitudeIdentity(),
67 70
                     ...config,
68
-                    displayName: localParticipant?.name
71
+                    displayName: localParticipant?.name,
72
+                    meetingUniqueId
69 73
                 });
70 74
             } catch (error) {
71 75
                 // If the connection failed do not impact jitsi-meet just silently fail.

Loading…
Откажи
Сачувај