瀏覽代碼

Distinguish tracks that had been muted when calculating ttfm.

master
damencho 9 年之前
父節點
當前提交
fe9aebd0c6
共有 1 個檔案被更改,包括 11 行新增1 行删除
  1. 11
    1
      modules/RTC/JitsiRemoteTrack.js

+ 11
- 1
modules/RTC/JitsiRemoteTrack.js 查看文件

25
     this.conference = conference;
25
     this.conference = conference;
26
     this.peerjid = ownerJid;
26
     this.peerjid = ownerJid;
27
     this.muted = muted;
27
     this.muted = muted;
28
+    // we want to mark whether the track has been ever muted
29
+    // to detect ttfm events for startmuted conferences, as it can significantly
30
+    // increase ttfm values
31
+    this.hasBeenMuted = muted;
28
 }
32
 }
29
 
33
 
30
 JitsiRemoteTrack.prototype = Object.create(JitsiTrack.prototype);
34
 JitsiRemoteTrack.prototype = Object.create(JitsiTrack.prototype);
38
     if(this.muted === value)
42
     if(this.muted === value)
39
         return;
43
         return;
40
 
44
 
45
+    if(value)
46
+        this.hasBeenMuted = true;
47
+
41
     // we can have a fake video stream
48
     // we can have a fake video stream
42
     if(this.stream)
49
     if(this.stream)
43
         this.stream.muted = value;
50
         this.stream.muted = value;
120
             - this.conference.getConnectionTimes()["muc.joined"]);
127
             - this.conference.getConnectionTimes()["muc.joined"]);
121
         this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
128
         this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
122
         console.log("(TIME) TTFM " + type + ":\t", ttfm);
129
         console.log("(TIME) TTFM " + type + ":\t", ttfm);
123
-        Statistics.analytics.sendEvent(type +'.ttfm', ttfm);
130
+        var eventName = type +'.ttfm';
131
+        if(this.hasBeenMuted)
132
+            eventName += '.muted';
133
+        Statistics.analytics.sendEvent(eventName, ttfm);
124
     }.bind(this));
134
     }.bind(this));
125
 };
135
 };
126
 
136
 

Loading…
取消
儲存