@flashphoner/websdk 2.0.263 → 2.0.264
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/docTemplate/README.md +1 -1
- package/flashphoner-no-flash.js +46 -27
- package/flashphoner-no-flash.min.js +1 -1
- package/flashphoner-no-webrtc.js +46 -27
- package/flashphoner-no-webrtc.min.js +1 -1
- package/flashphoner-no-wsplayer.js +46 -27
- package/flashphoner-no-wsplayer.min.js +1 -1
- package/flashphoner-room-api-webrtc-only.js +46 -27
- package/flashphoner-room-api-webrtc-only.min.js +1 -1
- package/flashphoner-room-api.js +32 -15
- package/flashphoner-room-api.min.js +1 -1
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +46 -27
- package/flashphoner-temasys-flash-websocket.js +46 -27
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +46 -27
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +46 -27
- package/flashphoner.min.js +1 -1
- package/package.json +1 -2
- package/src/stats-collector.js +32 -15
|
@@ -13293,7 +13293,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13293
13293
|
},
|
|
13294
13294
|
collectMetrics: function () {
|
|
13295
13295
|
var _collectMetrics = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
13296
|
-
var stats, metrics, lostMetrics;
|
|
13296
|
+
var stats, metrics, lostMetrics, headersUpdated;
|
|
13297
13297
|
return _regenerator().w(function (_context6) {
|
|
13298
13298
|
while (1) switch (_context6.n) {
|
|
13299
13299
|
case 0:
|
|
@@ -13308,9 +13308,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13308
13308
|
return statCollector.mediaConnection.getWebRTCStats();
|
|
13309
13309
|
case 1:
|
|
13310
13310
|
stats = _context6.v;
|
|
13311
|
-
|
|
13312
|
-
statCollector.metricsBatch = [];
|
|
13313
|
-
}
|
|
13311
|
+
statCollector.startNewBatch();
|
|
13314
13312
|
metrics = [];
|
|
13315
13313
|
lostMetrics = [];
|
|
13316
13314
|
statCollector.headers.split(",").forEach(function (header) {
|
|
@@ -13320,7 +13318,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13320
13318
|
id: components[1],
|
|
13321
13319
|
name: components[2]
|
|
13322
13320
|
};
|
|
13323
|
-
var value =
|
|
13321
|
+
var value = null;
|
|
13324
13322
|
if (stats[descriptor.type]) {
|
|
13325
13323
|
var _iterator2 = _createForOfIteratorHelper(stats[descriptor.type]),
|
|
13326
13324
|
_step2;
|
|
@@ -13338,36 +13336,44 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13338
13336
|
_iterator2.f();
|
|
13339
13337
|
}
|
|
13340
13338
|
}
|
|
13341
|
-
|
|
13342
|
-
if (value == "NO") {
|
|
13339
|
+
if (value === null) {
|
|
13343
13340
|
lostMetrics.push(descriptor);
|
|
13341
|
+
} else {
|
|
13342
|
+
metrics.push(value);
|
|
13344
13343
|
}
|
|
13345
13344
|
});
|
|
13346
|
-
if
|
|
13347
|
-
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
13348
|
-
}
|
|
13349
|
-
statCollector.metricsBatch.push(metrics);
|
|
13350
|
-
statCollector.batchCount--;
|
|
13351
|
-
if (!(statCollector.batchCount === 0)) {
|
|
13352
|
-
_context6.n = 2;
|
|
13353
|
-
break;
|
|
13354
|
-
}
|
|
13345
|
+
// Metrics list may change if some metrics are added or some metrics are lost #WCS-4627
|
|
13355
13346
|
_context6.n = 2;
|
|
13356
|
-
return statCollector.
|
|
13347
|
+
return statCollector.updateHeaders(stats);
|
|
13357
13348
|
case 2:
|
|
13349
|
+
headersUpdated = _context6.v;
|
|
13350
|
+
if (!lostMetrics.length) {
|
|
13351
|
+
_context6.n = 4;
|
|
13352
|
+
break;
|
|
13353
|
+
}
|
|
13354
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
13355
|
+
// Send metrics already collected and start a new batch with current metrics array to send them later #WCS-4627
|
|
13358
13356
|
_context6.n = 3;
|
|
13359
|
-
return statCollector.
|
|
13357
|
+
return statCollector.sendMetrics();
|
|
13360
13358
|
case 3:
|
|
13361
|
-
|
|
13359
|
+
statCollector.startNewBatch(metrics);
|
|
13360
|
+
_context6.n = 5;
|
|
13361
|
+
break;
|
|
13362
|
+
case 4:
|
|
13363
|
+
statCollector.metricsBatch.push(metrics);
|
|
13364
|
+
statCollector.batchCount--;
|
|
13365
|
+
if (!(statCollector.batchCount === 0 || headersUpdated)) {
|
|
13362
13366
|
_context6.n = 5;
|
|
13363
13367
|
break;
|
|
13364
13368
|
}
|
|
13365
|
-
|
|
13366
|
-
_context6.n = 4;
|
|
13369
|
+
_context6.n = 5;
|
|
13367
13370
|
return statCollector.sendMetrics();
|
|
13368
|
-
case 4:
|
|
13369
|
-
statCollector.sendHeaders();
|
|
13370
13371
|
case 5:
|
|
13372
|
+
// Check if metrics list changed and send a new headers if needed #WCS-4619
|
|
13373
|
+
if (headersUpdated) {
|
|
13374
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "RTC metrics list has changed, sending a new metrics description");
|
|
13375
|
+
statCollector.sendHeaders();
|
|
13376
|
+
}
|
|
13371
13377
|
statCollector.timerBusy = false;
|
|
13372
13378
|
case 6:
|
|
13373
13379
|
return _context6.a(2);
|
|
@@ -13386,7 +13392,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13386
13392
|
while (1) switch (_context7.p = _context7.n) {
|
|
13387
13393
|
case 0:
|
|
13388
13394
|
metricsToSend = [];
|
|
13389
|
-
for (i = 0; i < statCollector.metricsBatch.length; i++) {
|
|
13395
|
+
for (i = 0; statCollector.metricsBatch && i < statCollector.metricsBatch.length; i++) {
|
|
13390
13396
|
metricsString = "";
|
|
13391
13397
|
for (j = 0; j < statCollector.metricsBatch[i].length; j++) {
|
|
13392
13398
|
valueString = valueToString(statCollector.metricsBatch[i][j]);
|
|
@@ -13435,8 +13441,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13435
13441
|
};
|
|
13436
13442
|
statCollector.send("webRTCMetricsBatch", data);
|
|
13437
13443
|
}
|
|
13438
|
-
statCollector.
|
|
13439
|
-
statCollector.batchCount = statCollector.description.batchSize;
|
|
13444
|
+
statCollector.cleanBatch();
|
|
13440
13445
|
case 7:
|
|
13441
13446
|
return _context7.a(2);
|
|
13442
13447
|
}
|
|
@@ -13446,7 +13451,21 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
13446
13451
|
return _sendMetrics.apply(this, arguments);
|
|
13447
13452
|
}
|
|
13448
13453
|
return sendMetrics;
|
|
13449
|
-
}()
|
|
13454
|
+
}(),
|
|
13455
|
+
startNewBatch: function startNewBatch(metrics) {
|
|
13456
|
+
if (!statCollector.metricsBatch) {
|
|
13457
|
+
statCollector.metricsBatch = [];
|
|
13458
|
+
if (metrics) {
|
|
13459
|
+
statCollector.metricsBatch.push(metrics);
|
|
13460
|
+
}
|
|
13461
|
+
}
|
|
13462
|
+
},
|
|
13463
|
+
cleanBatch: function cleanBatch() {
|
|
13464
|
+
if (statCollector.metricsBatch) {
|
|
13465
|
+
statCollector.metricsBatch = null;
|
|
13466
|
+
statCollector.batchCount = statCollector.description.batchSize;
|
|
13467
|
+
}
|
|
13468
|
+
}
|
|
13450
13469
|
};
|
|
13451
13470
|
return statCollector;
|
|
13452
13471
|
};
|
|
@@ -20048,7 +20048,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20048
20048
|
},
|
|
20049
20049
|
collectMetrics: function () {
|
|
20050
20050
|
var _collectMetrics = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
20051
|
-
var stats, metrics, lostMetrics;
|
|
20051
|
+
var stats, metrics, lostMetrics, headersUpdated;
|
|
20052
20052
|
return _regenerator().w(function (_context6) {
|
|
20053
20053
|
while (1) switch (_context6.n) {
|
|
20054
20054
|
case 0:
|
|
@@ -20063,9 +20063,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20063
20063
|
return statCollector.mediaConnection.getWebRTCStats();
|
|
20064
20064
|
case 1:
|
|
20065
20065
|
stats = _context6.v;
|
|
20066
|
-
|
|
20067
|
-
statCollector.metricsBatch = [];
|
|
20068
|
-
}
|
|
20066
|
+
statCollector.startNewBatch();
|
|
20069
20067
|
metrics = [];
|
|
20070
20068
|
lostMetrics = [];
|
|
20071
20069
|
statCollector.headers.split(",").forEach(function (header) {
|
|
@@ -20075,7 +20073,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20075
20073
|
id: components[1],
|
|
20076
20074
|
name: components[2]
|
|
20077
20075
|
};
|
|
20078
|
-
var value =
|
|
20076
|
+
var value = null;
|
|
20079
20077
|
if (stats[descriptor.type]) {
|
|
20080
20078
|
var _iterator2 = _createForOfIteratorHelper(stats[descriptor.type]),
|
|
20081
20079
|
_step2;
|
|
@@ -20093,36 +20091,44 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20093
20091
|
_iterator2.f();
|
|
20094
20092
|
}
|
|
20095
20093
|
}
|
|
20096
|
-
|
|
20097
|
-
if (value == "NO") {
|
|
20094
|
+
if (value === null) {
|
|
20098
20095
|
lostMetrics.push(descriptor);
|
|
20096
|
+
} else {
|
|
20097
|
+
metrics.push(value);
|
|
20099
20098
|
}
|
|
20100
20099
|
});
|
|
20101
|
-
if
|
|
20102
|
-
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
20103
|
-
}
|
|
20104
|
-
statCollector.metricsBatch.push(metrics);
|
|
20105
|
-
statCollector.batchCount--;
|
|
20106
|
-
if (!(statCollector.batchCount === 0)) {
|
|
20107
|
-
_context6.n = 2;
|
|
20108
|
-
break;
|
|
20109
|
-
}
|
|
20100
|
+
// Metrics list may change if some metrics are added or some metrics are lost #WCS-4627
|
|
20110
20101
|
_context6.n = 2;
|
|
20111
|
-
return statCollector.
|
|
20102
|
+
return statCollector.updateHeaders(stats);
|
|
20112
20103
|
case 2:
|
|
20104
|
+
headersUpdated = _context6.v;
|
|
20105
|
+
if (!lostMetrics.length) {
|
|
20106
|
+
_context6.n = 4;
|
|
20107
|
+
break;
|
|
20108
|
+
}
|
|
20109
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
20110
|
+
// Send metrics already collected and start a new batch with current metrics array to send them later #WCS-4627
|
|
20113
20111
|
_context6.n = 3;
|
|
20114
|
-
return statCollector.
|
|
20112
|
+
return statCollector.sendMetrics();
|
|
20115
20113
|
case 3:
|
|
20116
|
-
|
|
20114
|
+
statCollector.startNewBatch(metrics);
|
|
20115
|
+
_context6.n = 5;
|
|
20116
|
+
break;
|
|
20117
|
+
case 4:
|
|
20118
|
+
statCollector.metricsBatch.push(metrics);
|
|
20119
|
+
statCollector.batchCount--;
|
|
20120
|
+
if (!(statCollector.batchCount === 0 || headersUpdated)) {
|
|
20117
20121
|
_context6.n = 5;
|
|
20118
20122
|
break;
|
|
20119
20123
|
}
|
|
20120
|
-
|
|
20121
|
-
_context6.n = 4;
|
|
20124
|
+
_context6.n = 5;
|
|
20122
20125
|
return statCollector.sendMetrics();
|
|
20123
|
-
case 4:
|
|
20124
|
-
statCollector.sendHeaders();
|
|
20125
20126
|
case 5:
|
|
20127
|
+
// Check if metrics list changed and send a new headers if needed #WCS-4619
|
|
20128
|
+
if (headersUpdated) {
|
|
20129
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "RTC metrics list has changed, sending a new metrics description");
|
|
20130
|
+
statCollector.sendHeaders();
|
|
20131
|
+
}
|
|
20126
20132
|
statCollector.timerBusy = false;
|
|
20127
20133
|
case 6:
|
|
20128
20134
|
return _context6.a(2);
|
|
@@ -20141,7 +20147,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20141
20147
|
while (1) switch (_context7.p = _context7.n) {
|
|
20142
20148
|
case 0:
|
|
20143
20149
|
metricsToSend = [];
|
|
20144
|
-
for (i = 0; i < statCollector.metricsBatch.length; i++) {
|
|
20150
|
+
for (i = 0; statCollector.metricsBatch && i < statCollector.metricsBatch.length; i++) {
|
|
20145
20151
|
metricsString = "";
|
|
20146
20152
|
for (j = 0; j < statCollector.metricsBatch[i].length; j++) {
|
|
20147
20153
|
valueString = valueToString(statCollector.metricsBatch[i][j]);
|
|
@@ -20190,8 +20196,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20190
20196
|
};
|
|
20191
20197
|
statCollector.send("webRTCMetricsBatch", data);
|
|
20192
20198
|
}
|
|
20193
|
-
statCollector.
|
|
20194
|
-
statCollector.batchCount = statCollector.description.batchSize;
|
|
20199
|
+
statCollector.cleanBatch();
|
|
20195
20200
|
case 7:
|
|
20196
20201
|
return _context7.a(2);
|
|
20197
20202
|
}
|
|
@@ -20201,7 +20206,21 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
20201
20206
|
return _sendMetrics.apply(this, arguments);
|
|
20202
20207
|
}
|
|
20203
20208
|
return sendMetrics;
|
|
20204
|
-
}()
|
|
20209
|
+
}(),
|
|
20210
|
+
startNewBatch: function startNewBatch(metrics) {
|
|
20211
|
+
if (!statCollector.metricsBatch) {
|
|
20212
|
+
statCollector.metricsBatch = [];
|
|
20213
|
+
if (metrics) {
|
|
20214
|
+
statCollector.metricsBatch.push(metrics);
|
|
20215
|
+
}
|
|
20216
|
+
}
|
|
20217
|
+
},
|
|
20218
|
+
cleanBatch: function cleanBatch() {
|
|
20219
|
+
if (statCollector.metricsBatch) {
|
|
20220
|
+
statCollector.metricsBatch = null;
|
|
20221
|
+
statCollector.batchCount = statCollector.description.batchSize;
|
|
20222
|
+
}
|
|
20223
|
+
}
|
|
20205
20224
|
};
|
|
20206
20225
|
return statCollector;
|
|
20207
20226
|
};
|