|
@@ -108,20 +108,19 @@ const statsEmitter = {
|
108
|
108
|
* @returns {void}
|
109
|
109
|
*/
|
110
|
110
|
_onStatsUpdated(currentUserId, stats) {
|
111
|
|
- const allUserFramerates = stats.framerate;
|
112
|
|
- const allUserResolutions = stats.resolution;
|
113
|
|
-
|
114
|
|
- const currentUserFramerate = allUserFramerates[currentUserId];
|
115
|
|
- const currentUserResolution = allUserResolutions[currentUserId];
|
|
111
|
+ const allUserFramerates = stats.framerate || {};
|
|
112
|
+ const allUserResolutions = stats.resolution || {};
|
116
|
113
|
|
117
|
114
|
// FIXME resolution and framerate are hashes keyed off of user ids with
|
118
|
115
|
// stat values. Receivers of stats expect resolution and framerate to
|
119
|
116
|
// be primatives, not hashes, so overwrites the 'lib-jitsi-meet' stats
|
120
|
117
|
// objects.
|
121
|
|
- stats.framerate = currentUserFramerate;
|
122
|
|
- stats.resolution = currentUserResolution;
|
|
118
|
+ const modifiedLocalStats = Object.assign({}, stats, {
|
|
119
|
+ framerate: allUserFramerates[currentUserId],
|
|
120
|
+ resolution: allUserResolutions[currentUserId]
|
|
121
|
+ });
|
123
|
122
|
|
124
|
|
- this._emitStatsUpdate(currentUserId, stats);
|
|
123
|
+ this._emitStatsUpdate(currentUserId, modifiedLocalStats);
|
125
|
124
|
|
126
|
125
|
// Get all the unique user ids from the framerate and resolution stats
|
127
|
126
|
// and update remote user stats as needed.
|