Preventing the client for using/sending resolution data from/to remote participants

This commit is contained in:
hristoterezov 2016-07-27 12:46:07 -05:00
parent 330597182c
commit 6ae35fb21d
2 changed files with 8 additions and 1 deletions

View File

@ -1155,10 +1155,14 @@ export default {
ConnectionQuality.addListener(CQEvents.LOCALSTATS_UPDATED,
(percent, stats) => {
APP.UI.updateLocalStats(percent, stats);
// Send only the data that remote participants care about.
let data = {
bitrate: stats.bitrate,
packetLoss: stats.packetLoss};
try {
room.broadcastEndpointMessage({
type: this.commands.defaults.CONNECTION_QUALITY,
values: stats });
values: data });
} catch (e) {
reportError(e);
}

View File

@ -75,6 +75,9 @@ export default {
eventEmitter.emit(CQEvents.REMOTESTATS_UPDATED, id, null, null);
return;
}
// Use only the fields we need
data = {bitrate: data.bitrate, packetLoss: data.packetLoss};
remoteStats[id] = data;
var newVal = 100 - data.packetLoss.total;