@flashphoner/websdk 2.0.263 → 2.0.265
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/examples/demo/streaming/media_devices_manager/manager.js +1 -4
- package/examples/demo/streaming/screen-camera-mixer/screen-camera-mixer.js +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
|
@@ -11404,7 +11404,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11404
11404
|
},
|
|
11405
11405
|
collectMetrics: function () {
|
|
11406
11406
|
var _collectMetrics = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
11407
|
-
var stats, metrics, lostMetrics;
|
|
11407
|
+
var stats, metrics, lostMetrics, headersUpdated;
|
|
11408
11408
|
return _regenerator().w(function (_context6) {
|
|
11409
11409
|
while (1) switch (_context6.n) {
|
|
11410
11410
|
case 0:
|
|
@@ -11419,9 +11419,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11419
11419
|
return statCollector.mediaConnection.getWebRTCStats();
|
|
11420
11420
|
case 1:
|
|
11421
11421
|
stats = _context6.v;
|
|
11422
|
-
|
|
11423
|
-
statCollector.metricsBatch = [];
|
|
11424
|
-
}
|
|
11422
|
+
statCollector.startNewBatch();
|
|
11425
11423
|
metrics = [];
|
|
11426
11424
|
lostMetrics = [];
|
|
11427
11425
|
statCollector.headers.split(",").forEach(function (header) {
|
|
@@ -11431,7 +11429,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11431
11429
|
id: components[1],
|
|
11432
11430
|
name: components[2]
|
|
11433
11431
|
};
|
|
11434
|
-
var value =
|
|
11432
|
+
var value = null;
|
|
11435
11433
|
if (stats[descriptor.type]) {
|
|
11436
11434
|
var _iterator2 = _createForOfIteratorHelper(stats[descriptor.type]),
|
|
11437
11435
|
_step2;
|
|
@@ -11449,36 +11447,44 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11449
11447
|
_iterator2.f();
|
|
11450
11448
|
}
|
|
11451
11449
|
}
|
|
11452
|
-
|
|
11453
|
-
if (value == "NO") {
|
|
11450
|
+
if (value === null) {
|
|
11454
11451
|
lostMetrics.push(descriptor);
|
|
11452
|
+
} else {
|
|
11453
|
+
metrics.push(value);
|
|
11455
11454
|
}
|
|
11456
11455
|
});
|
|
11457
|
-
if
|
|
11458
|
-
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
11459
|
-
}
|
|
11460
|
-
statCollector.metricsBatch.push(metrics);
|
|
11461
|
-
statCollector.batchCount--;
|
|
11462
|
-
if (!(statCollector.batchCount === 0)) {
|
|
11463
|
-
_context6.n = 2;
|
|
11464
|
-
break;
|
|
11465
|
-
}
|
|
11456
|
+
// Metrics list may change if some metrics are added or some metrics are lost #WCS-4627
|
|
11466
11457
|
_context6.n = 2;
|
|
11467
|
-
return statCollector.
|
|
11458
|
+
return statCollector.updateHeaders(stats);
|
|
11468
11459
|
case 2:
|
|
11460
|
+
headersUpdated = _context6.v;
|
|
11461
|
+
if (!lostMetrics.length) {
|
|
11462
|
+
_context6.n = 4;
|
|
11463
|
+
break;
|
|
11464
|
+
}
|
|
11465
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
11466
|
+
// Send metrics already collected and start a new batch with current metrics array to send them later #WCS-4627
|
|
11469
11467
|
_context6.n = 3;
|
|
11470
|
-
return statCollector.
|
|
11468
|
+
return statCollector.sendMetrics();
|
|
11471
11469
|
case 3:
|
|
11472
|
-
|
|
11470
|
+
statCollector.startNewBatch(metrics);
|
|
11471
|
+
_context6.n = 5;
|
|
11472
|
+
break;
|
|
11473
|
+
case 4:
|
|
11474
|
+
statCollector.metricsBatch.push(metrics);
|
|
11475
|
+
statCollector.batchCount--;
|
|
11476
|
+
if (!(statCollector.batchCount === 0 || headersUpdated)) {
|
|
11473
11477
|
_context6.n = 5;
|
|
11474
11478
|
break;
|
|
11475
11479
|
}
|
|
11476
|
-
|
|
11477
|
-
_context6.n = 4;
|
|
11480
|
+
_context6.n = 5;
|
|
11478
11481
|
return statCollector.sendMetrics();
|
|
11479
|
-
case 4:
|
|
11480
|
-
statCollector.sendHeaders();
|
|
11481
11482
|
case 5:
|
|
11483
|
+
// Check if metrics list changed and send a new headers if needed #WCS-4619
|
|
11484
|
+
if (headersUpdated) {
|
|
11485
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "RTC metrics list has changed, sending a new metrics description");
|
|
11486
|
+
statCollector.sendHeaders();
|
|
11487
|
+
}
|
|
11482
11488
|
statCollector.timerBusy = false;
|
|
11483
11489
|
case 6:
|
|
11484
11490
|
return _context6.a(2);
|
|
@@ -11497,7 +11503,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11497
11503
|
while (1) switch (_context7.p = _context7.n) {
|
|
11498
11504
|
case 0:
|
|
11499
11505
|
metricsToSend = [];
|
|
11500
|
-
for (i = 0; i < statCollector.metricsBatch.length; i++) {
|
|
11506
|
+
for (i = 0; statCollector.metricsBatch && i < statCollector.metricsBatch.length; i++) {
|
|
11501
11507
|
metricsString = "";
|
|
11502
11508
|
for (j = 0; j < statCollector.metricsBatch[i].length; j++) {
|
|
11503
11509
|
valueString = valueToString(statCollector.metricsBatch[i][j]);
|
|
@@ -11546,8 +11552,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11546
11552
|
};
|
|
11547
11553
|
statCollector.send("webRTCMetricsBatch", data);
|
|
11548
11554
|
}
|
|
11549
|
-
statCollector.
|
|
11550
|
-
statCollector.batchCount = statCollector.description.batchSize;
|
|
11555
|
+
statCollector.cleanBatch();
|
|
11551
11556
|
case 7:
|
|
11552
11557
|
return _context7.a(2);
|
|
11553
11558
|
}
|
|
@@ -11557,7 +11562,21 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11557
11562
|
return _sendMetrics.apply(this, arguments);
|
|
11558
11563
|
}
|
|
11559
11564
|
return sendMetrics;
|
|
11560
|
-
}()
|
|
11565
|
+
}(),
|
|
11566
|
+
startNewBatch: function startNewBatch(metrics) {
|
|
11567
|
+
if (!statCollector.metricsBatch) {
|
|
11568
|
+
statCollector.metricsBatch = [];
|
|
11569
|
+
if (metrics) {
|
|
11570
|
+
statCollector.metricsBatch.push(metrics);
|
|
11571
|
+
}
|
|
11572
|
+
}
|
|
11573
|
+
},
|
|
11574
|
+
cleanBatch: function cleanBatch() {
|
|
11575
|
+
if (statCollector.metricsBatch) {
|
|
11576
|
+
statCollector.metricsBatch = null;
|
|
11577
|
+
statCollector.batchCount = statCollector.description.batchSize;
|
|
11578
|
+
}
|
|
11579
|
+
}
|
|
11561
11580
|
};
|
|
11562
11581
|
return statCollector;
|
|
11563
11582
|
};
|