Browse Source

Merge branch 'master' into restyle-toggle-state

master
Lyubomir Marinov 9 years ago
parent
commit
35c1a77845
5 changed files with 48 additions and 16 deletions
  1. 5
    7
      analytics.js
  2. 0
    5
      app.js
  3. 41
    4
      conference.js
  4. 1
    0
      css/_videolayout_default.scss
  5. 1
    0
      modules/TokenData/TokenData.js

+ 5
- 7
analytics.js View File

16
     /* eslint-enable */
16
     /* eslint-enable */
17
   }
17
   }
18
 
18
 
19
-  Analytics.prototype.sendEvent = function (action, data, label, browserName) {
19
+  Analytics.prototype.sendEvent = function (action, data) {
20
     // empty label if missing value for it and add the value,
20
     // empty label if missing value for it and add the value,
21
     // the value should be integer or null
21
     // the value should be integer or null
22
-    var value = Math.round(parseFloat(data));
22
+    var value = data.value;
23
+    value = value? Math.round(parseFloat(value)) : null;
24
+    var label = data.label || "";
23
 
25
 
24
     ga('send', 'event', 'jit.si',
26
     ga('send', 'event', 'jit.si',
25
-        action + '.' + browserName, label ? label : "", value ? value : null);
26
-  };
27
-
28
-  Analytics.prototype.sendFeedback = function (data, label, browserName) {
29
-      this.sendEvent('feedback.rating', data.overall, label, browserName);
27
+        action + '.' + data.browserName, label, value);
30
   };
28
   };
31
 
29
 
32
   ctx.Analytics = Analytics;
30
   ctx.Analytics = Analytics;

+ 0
- 5
app.js View File

110
     var isUIReady = APP.UI.start();
110
     var isUIReady = APP.UI.start();
111
     if (isUIReady) {
111
     if (isUIReady) {
112
         APP.conference.init({roomName: buildRoomName()}).then(function () {
112
         APP.conference.init({roomName: buildRoomName()}).then(function () {
113
-            let server = APP.tokenData.server;
114
-            if(server) {
115
-                APP.conference.logEvent("server." + server, 1);
116
-            }
117
-
118
             APP.UI.initConference();
113
             APP.UI.initConference();
119
 
114
 
120
             APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {
115
             APP.UI.addListener(UIEvents.LANG_CHANGED, function (language) {

+ 41
- 4
conference.js View File

485
     }
485
     }
486
 }
486
 }
487
 
487
 
488
+/**
489
+ * Sends statistics from APP.tokenData
490
+ */
491
+function sendTokenDataStats() {
492
+    let {server, group} = APP.tokenData;
493
+    if(server) {
494
+        APP.conference.logEvent("server." + server, 1);
495
+    }
496
+    if(group) {
497
+        APP.conference.logEvent("group", group);
498
+    }
499
+}
500
+
501
+/**
502
+ * Set permanent ptoperties to analytics.
503
+ * NOTE: Has to be used after JitsiMeetJS.init. otherwise analytics will be
504
+ * null.
505
+ */
506
+function setAnalyticsPermanentProperties() {
507
+    let permanentProperties = {
508
+        userAgent: navigator.userAgent,
509
+        roomName: APP.conference.roomName
510
+    };
511
+    let {server, group} = APP.tokenData;
512
+    if(server) {
513
+        permanentProperties.server = server;
514
+    }
515
+    if(group) {
516
+        permanentProperties.group = group;
517
+    }
518
+    JitsiMeetJS.analytics.addPermanentProperties(permanentProperties);
519
+}
520
+
488
 export default {
521
 export default {
489
     isModerator: false,
522
     isModerator: false,
490
     audioMuted: false,
523
     audioMuted: false,
532
         }
565
         }
533
 
566
 
534
         return JitsiMeetJS.init(config)
567
         return JitsiMeetJS.init(config)
535
-            .then(() => createInitialLocalTracksAndConnect(options.roomName))
536
-            .then(([tracks, con]) => {
568
+            .then(() => {
569
+                setAnalyticsPermanentProperties();
570
+                sendTokenDataStats();
571
+                return createInitialLocalTracksAndConnect(options.roomName);
572
+            }).then(([tracks, con]) => {
537
                 console.log('initialized with %s local tracks', tracks.length);
573
                 console.log('initialized with %s local tracks', tracks.length);
538
                 APP.connection = connection = con;
574
                 APP.connection = connection = con;
539
                 this._createRoom(tracks);
575
                 this._createRoom(tracks);
1453
             // Longer delays will be caused by something else and will just
1489
             // Longer delays will be caused by something else and will just
1454
             // poison the data.
1490
             // poison the data.
1455
             if (delay < 2000) {
1491
             if (delay < 2000) {
1456
-                JitsiMeetJS.analytics.sendEvent('stream.switch.delay', delay);
1492
+                JitsiMeetJS.analytics.sendEvent('stream.switch.delay',
1493
+                    {value: delay});
1457
             }
1494
             }
1458
         });
1495
         });
1459
 
1496
 
1765
      */
1802
      */
1766
     logEvent(name, value) {
1803
     logEvent(name, value) {
1767
         if(JitsiMeetJS.analytics) {
1804
         if(JitsiMeetJS.analytics) {
1768
-            JitsiMeetJS.analytics.sendEvent(name, value);
1805
+            JitsiMeetJS.analytics.sendEvent(name, {value});
1769
         }
1806
         }
1770
         if(room) {
1807
         if(room) {
1771
             room.sendApplicationLog(JSON.stringify({name, value}));
1808
             room.sendApplicationLog(JSON.stringify({name, value}));

+ 1
- 0
css/_videolayout_default.scss View File

574
     padding: 10px;
574
     padding: 10px;
575
     color: rgba(255,255,255,.5);
575
     color: rgba(255,255,255,.5);
576
     z-index: 1011;
576
     z-index: 1011;
577
+    border-radius: 50%;
577
 }
578
 }
578
 
579
 
579
 .centeredVideoLabel {
580
 .centeredVideoLabel {

+ 1
- 0
modules/TokenData/TokenData.js View File

99
         if(!this.payload.context)
99
         if(!this.payload.context)
100
             return;
100
             return;
101
         this.server = this.payload.context.server;
101
         this.server = this.payload.context.server;
102
+        this.group = this.payload.context.group;
102
         let callerData = this.payload.context.user;
103
         let callerData = this.payload.context.user;
103
         let calleeData = this.payload.context.callee;
104
         let calleeData = this.payload.context.callee;
104
         if(callerData)
105
         if(callerData)

Loading…
Cancel
Save