|
|
|
@ -122,6 +122,7 @@ const statsEmitter = { |
|
|
|
|
_onStatsUpdated(localUserId: string, stats: Object) { |
|
|
|
|
const allUserFramerates = stats.framerate || {}; |
|
|
|
|
const allUserResolutions = stats.resolution || {}; |
|
|
|
|
const allUserCodecs = stats.codec || {}; |
|
|
|
|
|
|
|
|
|
// FIXME resolution and framerate are maps keyed off of user ids with
|
|
|
|
|
// stat values. Receivers of stats expect resolution and framerate to
|
|
|
|
@ -129,7 +130,8 @@ const statsEmitter = { |
|
|
|
|
// stats objects.
|
|
|
|
|
const modifiedLocalStats = Object.assign({}, stats, { |
|
|
|
|
framerate: allUserFramerates[localUserId], |
|
|
|
|
resolution: allUserResolutions[localUserId] |
|
|
|
|
resolution: allUserResolutions[localUserId], |
|
|
|
|
codec: allUserCodecs[localUserId] |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this._emitStatsUpdate(localUserId, modifiedLocalStats); |
|
|
|
@ -138,8 +140,9 @@ const statsEmitter = { |
|
|
|
|
// and update remote user stats as needed.
|
|
|
|
|
const framerateUserIds = Object.keys(allUserFramerates); |
|
|
|
|
const resolutionUserIds = Object.keys(allUserResolutions); |
|
|
|
|
const codecUserIds = Object.keys(allUserCodecs); |
|
|
|
|
|
|
|
|
|
_.union(framerateUserIds, resolutionUserIds) |
|
|
|
|
_.union(framerateUserIds, resolutionUserIds, codecUserIds) |
|
|
|
|
.filter(id => id !== localUserId) |
|
|
|
|
.forEach(id => { |
|
|
|
|
const remoteUserStats = {}; |
|
|
|
@ -156,6 +159,12 @@ const statsEmitter = { |
|
|
|
|
remoteUserStats.resolution = resolution; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const codec = allUserCodecs[id]; |
|
|
|
|
|
|
|
|
|
if (codec) { |
|
|
|
|
remoteUserStats.codec = codec; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this._emitStatsUpdate(id, remoteUserStats); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|