@flashphoner/sfusdk-examples 2.0.203 → 2.0.206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flashphoner/sfusdk-examples",
3
- "version": "2.0.203",
3
+ "version": "2.0.206",
4
4
  "description": "Official Flashphoner WebCallServer SFU SDK usage examples",
5
5
  "main": "dist/sfu.js",
6
6
  "types": "src/sfu.ts",
@@ -54,7 +54,12 @@ const connect = function() {
54
54
  tData = statsToTable(stats);
55
55
  gData = statsToGraph(stats);
56
56
  gView.refreshSigma(gData);
57
- tView.updateMetricTable(tData.WCS, "WCS");
57
+ //flatten tdata
58
+ const flatView = [];
59
+ for (const [k, v] of Object.entries(tData)) {
60
+ flatView.push(...v);
61
+ }
62
+ tView.updateMetricTable(flatView, "WCS");
58
63
  }
59
64
 
60
65
  gView.bindNodeClickEvents(function(e){
@@ -157,6 +157,9 @@ const statsToTable = function(stats) {
157
157
  stats.participants.forEach(function(participant){
158
158
  for (const [key, value] of Object.entries(participant.incomingTracks)) {
159
159
  const srcTrack = src[tKey(key, value)];
160
+ if (!srcTrack) {
161
+ continue;
162
+ }
160
163
  bitrate_out += srcTrack.bitrate;
161
164
  tracks_out++;
162
165
  }
@@ -187,6 +190,9 @@ const statsToTable = function(stats) {
187
190
  });
188
191
  for (const [key, value] of Object.entries(participant.incomingTracks)) {
189
192
  const srcTrack = src[tKey(key, value)];
193
+ if (!srcTrack) {
194
+ continue;
195
+ }
190
196
  pStats.push(trackToTable(srcTrack, srcTrack.nickName, value));
191
197
  tracksIn++;
192
198
  bitrateIn += srcTrack.bitrate;
@@ -197,6 +203,5 @@ const statsToTable = function(stats) {
197
203
  pStats.push(metricToTable("bitrate_out", bitrateOut, participant.nickName));
198
204
  metrics[participant.nickName] = pStats;
199
205
  });
200
-
201
206
  return metrics;
202
207
  }