@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
|
@@ -11966,7 +11966,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11966
11966
|
},
|
|
11967
11967
|
collectMetrics: function () {
|
|
11968
11968
|
var _collectMetrics = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6() {
|
|
11969
|
-
var stats, metrics, lostMetrics;
|
|
11969
|
+
var stats, metrics, lostMetrics, headersUpdated;
|
|
11970
11970
|
return _regenerator().w(function (_context6) {
|
|
11971
11971
|
while (1) switch (_context6.n) {
|
|
11972
11972
|
case 0:
|
|
@@ -11981,9 +11981,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11981
11981
|
return statCollector.mediaConnection.getWebRTCStats();
|
|
11982
11982
|
case 1:
|
|
11983
11983
|
stats = _context6.v;
|
|
11984
|
-
|
|
11985
|
-
statCollector.metricsBatch = [];
|
|
11986
|
-
}
|
|
11984
|
+
statCollector.startNewBatch();
|
|
11987
11985
|
metrics = [];
|
|
11988
11986
|
lostMetrics = [];
|
|
11989
11987
|
statCollector.headers.split(",").forEach(function (header) {
|
|
@@ -11993,7 +11991,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
11993
11991
|
id: components[1],
|
|
11994
11992
|
name: components[2]
|
|
11995
11993
|
};
|
|
11996
|
-
var value =
|
|
11994
|
+
var value = null;
|
|
11997
11995
|
if (stats[descriptor.type]) {
|
|
11998
11996
|
var _iterator2 = _createForOfIteratorHelper(stats[descriptor.type]),
|
|
11999
11997
|
_step2;
|
|
@@ -12011,36 +12009,44 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
12011
12009
|
_iterator2.f();
|
|
12012
12010
|
}
|
|
12013
12011
|
}
|
|
12014
|
-
|
|
12015
|
-
if (value == "NO") {
|
|
12012
|
+
if (value === null) {
|
|
12016
12013
|
lostMetrics.push(descriptor);
|
|
12014
|
+
} else {
|
|
12015
|
+
metrics.push(value);
|
|
12017
12016
|
}
|
|
12018
12017
|
});
|
|
12019
|
-
if
|
|
12020
|
-
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
12021
|
-
}
|
|
12022
|
-
statCollector.metricsBatch.push(metrics);
|
|
12023
|
-
statCollector.batchCount--;
|
|
12024
|
-
if (!(statCollector.batchCount === 0)) {
|
|
12025
|
-
_context6.n = 2;
|
|
12026
|
-
break;
|
|
12027
|
-
}
|
|
12018
|
+
// Metrics list may change if some metrics are added or some metrics are lost #WCS-4627
|
|
12028
12019
|
_context6.n = 2;
|
|
12029
|
-
return statCollector.
|
|
12020
|
+
return statCollector.updateHeaders(stats);
|
|
12030
12021
|
case 2:
|
|
12022
|
+
headersUpdated = _context6.v;
|
|
12023
|
+
if (!lostMetrics.length) {
|
|
12024
|
+
_context6.n = 4;
|
|
12025
|
+
break;
|
|
12026
|
+
}
|
|
12027
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "Missing metrics: " + JSON.stringify(lostMetrics));
|
|
12028
|
+
// Send metrics already collected and start a new batch with current metrics array to send them later #WCS-4627
|
|
12031
12029
|
_context6.n = 3;
|
|
12032
|
-
return statCollector.
|
|
12030
|
+
return statCollector.sendMetrics();
|
|
12033
12031
|
case 3:
|
|
12034
|
-
|
|
12032
|
+
statCollector.startNewBatch(metrics);
|
|
12033
|
+
_context6.n = 5;
|
|
12034
|
+
break;
|
|
12035
|
+
case 4:
|
|
12036
|
+
statCollector.metricsBatch.push(metrics);
|
|
12037
|
+
statCollector.batchCount--;
|
|
12038
|
+
if (!(statCollector.batchCount === 0 || headersUpdated)) {
|
|
12035
12039
|
_context6.n = 5;
|
|
12036
12040
|
break;
|
|
12037
12041
|
}
|
|
12038
|
-
|
|
12039
|
-
_context6.n = 4;
|
|
12042
|
+
_context6.n = 5;
|
|
12040
12043
|
return statCollector.sendMetrics();
|
|
12041
|
-
case 4:
|
|
12042
|
-
statCollector.sendHeaders();
|
|
12043
12044
|
case 5:
|
|
12045
|
+
// Check if metrics list changed and send a new headers if needed #WCS-4619
|
|
12046
|
+
if (headersUpdated) {
|
|
12047
|
+
statCollector.logger.info(LOG_PREFIX + "-" + statCollector.id, "RTC metrics list has changed, sending a new metrics description");
|
|
12048
|
+
statCollector.sendHeaders();
|
|
12049
|
+
}
|
|
12044
12050
|
statCollector.timerBusy = false;
|
|
12045
12051
|
case 6:
|
|
12046
12052
|
return _context6.a(2);
|
|
@@ -12059,7 +12065,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
12059
12065
|
while (1) switch (_context7.p = _context7.n) {
|
|
12060
12066
|
case 0:
|
|
12061
12067
|
metricsToSend = [];
|
|
12062
|
-
for (i = 0; i < statCollector.metricsBatch.length; i++) {
|
|
12068
|
+
for (i = 0; statCollector.metricsBatch && i < statCollector.metricsBatch.length; i++) {
|
|
12063
12069
|
metricsString = "";
|
|
12064
12070
|
for (j = 0; j < statCollector.metricsBatch[i].length; j++) {
|
|
12065
12071
|
valueString = valueToString(statCollector.metricsBatch[i][j]);
|
|
@@ -12108,8 +12114,7 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
12108
12114
|
};
|
|
12109
12115
|
statCollector.send("webRTCMetricsBatch", data);
|
|
12110
12116
|
}
|
|
12111
|
-
statCollector.
|
|
12112
|
-
statCollector.batchCount = statCollector.description.batchSize;
|
|
12117
|
+
statCollector.cleanBatch();
|
|
12113
12118
|
case 7:
|
|
12114
12119
|
return _context7.a(2);
|
|
12115
12120
|
}
|
|
@@ -12119,7 +12124,21 @@ var StreamStatsCollector = function StreamStatsCollector(description, id, mediaC
|
|
|
12119
12124
|
return _sendMetrics.apply(this, arguments);
|
|
12120
12125
|
}
|
|
12121
12126
|
return sendMetrics;
|
|
12122
|
-
}()
|
|
12127
|
+
}(),
|
|
12128
|
+
startNewBatch: function startNewBatch(metrics) {
|
|
12129
|
+
if (!statCollector.metricsBatch) {
|
|
12130
|
+
statCollector.metricsBatch = [];
|
|
12131
|
+
if (metrics) {
|
|
12132
|
+
statCollector.metricsBatch.push(metrics);
|
|
12133
|
+
}
|
|
12134
|
+
}
|
|
12135
|
+
},
|
|
12136
|
+
cleanBatch: function cleanBatch() {
|
|
12137
|
+
if (statCollector.metricsBatch) {
|
|
12138
|
+
statCollector.metricsBatch = null;
|
|
12139
|
+
statCollector.batchCount = statCollector.description.batchSize;
|
|
12140
|
+
}
|
|
12141
|
+
}
|
|
12123
12142
|
};
|
|
12124
12143
|
return statCollector;
|
|
12125
12144
|
};
|