|
|
@@ -97,6 +97,26 @@ JitsiRemoteTrack.prototype._setVideoType = function (type) {
|
|
97
|
97
|
this.eventEmitter.emit(JitsiTrackEvents.TRACK_VIDEOTYPE_CHANGED, type);
|
|
98
|
98
|
};
|
|
99
|
99
|
|
|
|
100
|
+JitsiRemoteTrack.prototype._playCallback = function () {
|
|
|
101
|
+ var type = (this.isVideoTrack() ? 'video' : 'audio');
|
|
|
102
|
+
|
|
|
103
|
+ var now = window.performance.now();
|
|
|
104
|
+ console.log("(TIME) Render " + type + ":\t", now);
|
|
|
105
|
+ this.conference.getConnectionTimes()[type + ".render"] = now;
|
|
|
106
|
+
|
|
|
107
|
+ var ttfm = now
|
|
|
108
|
+ - (this.conference.getConnectionTimes()["session.initiate"]
|
|
|
109
|
+ - this.conference.getConnectionTimes()["muc.joined"])
|
|
|
110
|
+ - (window.connectionTimes["obtainPermissions.end"]
|
|
|
111
|
+ - window.connectionTimes["obtainPermissions.start"]);
|
|
|
112
|
+ this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
|
|
|
113
|
+ console.log("(TIME) TTFM " + type + ":\t", ttfm);
|
|
|
114
|
+ var eventName = type +'.ttfm';
|
|
|
115
|
+ if(this.hasBeenMuted)
|
|
|
116
|
+ eventName += '.muted';
|
|
|
117
|
+ Statistics.analytics.sendEvent(eventName, ttfm);
|
|
|
118
|
+};
|
|
|
119
|
+
|
|
100
|
120
|
/**
|
|
101
|
121
|
* Attach time to first media tracker only if there is conference and only
|
|
102
|
122
|
* for the first element.
|
|
|
@@ -115,32 +135,12 @@ JitsiRemoteTrack.prototype._attachTTFMTracker = function (container) {
|
|
115
|
135
|
if (this.isVideoTrack())
|
|
116
|
136
|
ttfmTrackerVideoAttached = true;
|
|
117
|
137
|
|
|
118
|
|
- var playCallback = function () {
|
|
119
|
|
- var type = (this.isVideoTrack() ? 'video' : 'audio');
|
|
120
|
|
-
|
|
121
|
|
- var now = window.performance.now();
|
|
122
|
|
- console.log("(TIME) Render " + type + ":\t", now);
|
|
123
|
|
- this.conference.getConnectionTimes()[type + ".render"] = now;
|
|
124
|
|
-
|
|
125
|
|
- var ttfm = now
|
|
126
|
|
- - (this.conference.getConnectionTimes()["session.initiate"]
|
|
127
|
|
- - this.conference.getConnectionTimes()["muc.joined"])
|
|
128
|
|
- - (window.connectionTimes["obtainPermissions.end"]
|
|
129
|
|
- - window.connectionTimes["obtainPermissions.start"]);
|
|
130
|
|
- this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
|
|
131
|
|
- console.log("(TIME) TTFM " + type + ":\t", ttfm);
|
|
132
|
|
- var eventName = type +'.ttfm';
|
|
133
|
|
- if(this.hasBeenMuted)
|
|
134
|
|
- eventName += '.muted';
|
|
135
|
|
- Statistics.analytics.sendEvent(eventName, ttfm);
|
|
136
|
|
- }.bind(this);
|
|
137
|
|
-
|
|
138
|
138
|
if (RTCBrowserType.isTemasysPluginUsed()) {
|
|
139
|
139
|
// FIXME: this is not working for IE11
|
|
140
|
|
- AdapterJS.addEvent(container, 'play', playCallback);
|
|
|
140
|
+ AdapterJS.addEvent(container, 'play', this._playCallback.bind(this));
|
|
141
|
141
|
}
|
|
142
|
142
|
else {
|
|
143
|
|
- container.addEventListener("canplay", playCallback);
|
|
|
143
|
+ container.addEventListener("canplay", this._playCallback.bind(this));
|
|
144
|
144
|
}
|
|
145
|
145
|
};
|
|
146
|
146
|
|