quickblox 2.24.0-beta.1 → 2.24.0

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,7 +1,7 @@
1
1
  {
2
2
  "name": "quickblox",
3
3
  "description": "QuickBlox JavaScript SDK",
4
- "version": "2.24.0-beta.1",
4
+ "version": "2.24.0",
5
5
  "homepage": "https://quickblox.com/developers/Javascript",
6
6
  "main": "src/qbMain.js",
7
7
  "types": "quickblox.d.ts",
package/quickblox.js CHANGED
@@ -32969,10 +32969,8 @@ ChatProxy.prototype = {
32969
32969
  *
32970
32970
  * TODO(2.25.0): make auto-enable SDK-internal — fire on initial connect and
32971
32971
  * on relogin after session-expired, skip on Stream-Management reconnect.
32972
- * Spec & three-state matrix:
32973
- * __ai-work-log/sdk-js/tasks/ad-hoc-2026-05-05-notice-reaction-admin-role/
32974
- * backlog-2.25.0-auto-enable-notices.md
32975
- * jira-stories/_jira-src-06-auto-enable-notices.md
32972
+ * Spec & three-state matrix are tracked in the internal 2.25.0 backlog
32973
+ * (auto-enable notices).
32976
32974
  *
32977
32975
  * Do not call enableNotices again before the previous callback fires —
32978
32976
  * concurrent enable calls are not specified.
@@ -37778,92 +37776,110 @@ function _getStats(peer, lastResults, successCallback, errorCallback) {
37778
37776
 
37779
37777
  peer.getStats(null).then(function (results) {
37780
37778
  results.forEach(function (result) {
37781
- var item;
37782
-
37783
- if (result.bytesReceived && result.type === 'inbound-rtp') {
37784
- item = statistic.remote[result.mediaType];
37785
- item.bitrate = _getBitratePerSecond(result, lastResults, false);
37786
- item.bytesReceived = result.bytesReceived;
37787
- item.packetsReceived = result.packetsReceived;
37788
- item.timestamp = result.timestamp;
37789
- if (result.mediaType === 'video' && result.framerateMean) {
37790
- item.framesPerSecond = Math.round(result.framerateMean * 10) / 10;
37791
- }
37792
- } else if (result.bytesSent && result.type === 'outbound-rtp') {
37793
- item = statistic.local[result.mediaType];
37794
- item.bitrate = _getBitratePerSecond(result, lastResults, true);
37795
- item.bytesSent = result.bytesSent;
37796
- item.packetsSent = result.packetsSent;
37797
- item.timestamp = result.timestamp;
37798
- if (result.mediaType === 'video' && result.framerateMean) {
37799
- item.framesPerSecond = Math.round(result.framerateMean * 10) / 10;
37800
- }
37801
- } else if (result.type === 'local-candidate') {
37802
- item = statistic.local.candidate;
37803
- if (result.candidateType === 'host' && result.mozLocalTransport === 'udp' && result.transport === 'udp') {
37804
- item.protocol = result.transport;
37805
- item.ip = result.ipAddress;
37806
- item.port = result.portNumber;
37807
- } else if (!Helpers.getVersionFirefox()) {
37808
- item.protocol = result.protocol;
37809
- item.ip = result.ip;
37810
- item.port = result.port;
37811
- }
37812
- } else if (result.type === 'remote-candidate') {
37813
- item = statistic.remote.candidate;
37814
- item.protocol = result.protocol || result.transport;
37815
- item.ip = result.ip || result.ipAddress;
37816
- item.port = result.port || result.portNumber;
37817
- } else if (result.type === 'track' && result.kind === 'video' && !Helpers.getVersionFirefox()) {
37818
- if (result.remoteSource) {
37819
- item = statistic.remote.video;
37820
- item.frameHeight = result.frameHeight;
37821
- item.frameWidth = result.frameWidth;
37822
- item.framesPerSecond = _getFramesPerSecond(result, lastResults, false);
37823
- } else {
37824
- item = statistic.local.video;
37825
- item.frameHeight = result.frameHeight;
37826
- item.frameWidth = result.frameWidth;
37827
- item.framesPerSecond = _getFramesPerSecond(result, lastResults, true);
37828
- }
37829
- }
37779
+ _applyStatReport(statistic, result, lastResults);
37830
37780
  });
37831
37781
  successCallback(statistic, results);
37832
37782
  }, errorCallback);
37783
+ }
37784
+
37785
+ function _applyStatReport(statistic, result, lastResults) {
37786
+ var item;
37787
+ // mediaType is deprecated in the W3C webrtc-stats spec and replaced by kind.
37788
+ // Safari/WebKit omits mediaType on some reports and provides only kind, so we
37789
+ // normalize once and use it for both the statistic lookup and the 'video' check.
37790
+ var mediaType = result.mediaType || result.kind;
37791
+
37792
+ if (result.bytesReceived && result.type === 'inbound-rtp') {
37793
+ item = statistic.remote[mediaType];
37833
37794
 
37834
- function _getBitratePerSecond(result, lastResults, isLocal) {
37835
- var lastResult = lastResults && lastResults.get(result.id),
37836
- seconds = lastResult ? ((result.timestamp - lastResult.timestamp) / 1000) : 5,
37837
- kilo = 1024,
37838
- bit = 8,
37839
- bitrate;
37840
-
37841
- if (!lastResult) {
37842
- bitrate = 0;
37843
- } else if (isLocal) {
37844
- bitrate = bit * (result.bytesSent - lastResult.bytesSent) / (kilo * seconds);
37795
+ if (item) {
37796
+ item.bitrate = _getBitratePerSecond(result, lastResults, false);
37797
+ item.bytesReceived = result.bytesReceived;
37798
+ item.packetsReceived = result.packetsReceived;
37799
+ item.timestamp = result.timestamp;
37800
+ if (mediaType === 'video' && result.framerateMean) {
37801
+ item.framesPerSecond = Math.round(result.framerateMean * 10) / 10;
37802
+ }
37803
+ } else {
37804
+ Helpers.traceWarning('_getStats: skipping inbound-rtp report with unknown mediaType/kind: ' + mediaType);
37805
+ }
37806
+ } else if (result.bytesSent && result.type === 'outbound-rtp') {
37807
+ item = statistic.local[mediaType];
37808
+
37809
+ if (item) {
37810
+ item.bitrate = _getBitratePerSecond(result, lastResults, true);
37811
+ item.bytesSent = result.bytesSent;
37812
+ item.packetsSent = result.packetsSent;
37813
+ item.timestamp = result.timestamp;
37814
+ if (mediaType === 'video' && result.framerateMean) {
37815
+ item.framesPerSecond = Math.round(result.framerateMean * 10) / 10;
37816
+ }
37845
37817
  } else {
37846
- bitrate = bit * (result.bytesReceived - lastResult.bytesReceived) / (kilo * seconds);
37818
+ Helpers.traceWarning('_getStats: skipping outbound-rtp report with unknown mediaType/kind: ' + mediaType);
37819
+ }
37820
+ } else if (result.type === 'local-candidate') {
37821
+ item = statistic.local.candidate;
37822
+ if (result.candidateType === 'host' && result.mozLocalTransport === 'udp' && result.transport === 'udp') {
37823
+ item.protocol = result.transport;
37824
+ item.ip = result.ipAddress;
37825
+ item.port = result.portNumber;
37826
+ } else if (!Helpers.getVersionFirefox()) {
37827
+ item.protocol = result.protocol;
37828
+ item.ip = result.ip;
37829
+ item.port = result.port;
37830
+ }
37831
+ } else if (result.type === 'remote-candidate') {
37832
+ item = statistic.remote.candidate;
37833
+ item.protocol = result.protocol || result.transport;
37834
+ item.ip = result.ip || result.ipAddress;
37835
+ item.port = result.port || result.portNumber;
37836
+ } else if (result.type === 'track' && result.kind === 'video' && !Helpers.getVersionFirefox()) {
37837
+ if (result.remoteSource) {
37838
+ item = statistic.remote.video;
37839
+ item.frameHeight = result.frameHeight;
37840
+ item.frameWidth = result.frameWidth;
37841
+ item.framesPerSecond = _getFramesPerSecond(result, lastResults, false);
37842
+ } else {
37843
+ item = statistic.local.video;
37844
+ item.frameHeight = result.frameHeight;
37845
+ item.frameWidth = result.frameWidth;
37846
+ item.framesPerSecond = _getFramesPerSecond(result, lastResults, true);
37847
37847
  }
37848
+ }
37849
+ }
37848
37850
 
37849
- return Math.round(bitrate);
37851
+ function _getBitratePerSecond(result, lastResults, isLocal) {
37852
+ var lastResult = lastResults && lastResults.get(result.id),
37853
+ seconds = lastResult ? ((result.timestamp - lastResult.timestamp) / 1000) : 5,
37854
+ kilo = 1024,
37855
+ bit = 8,
37856
+ bitrate;
37857
+
37858
+ if (!lastResult) {
37859
+ bitrate = 0;
37860
+ } else if (isLocal) {
37861
+ bitrate = bit * (result.bytesSent - lastResult.bytesSent) / (kilo * seconds);
37862
+ } else {
37863
+ bitrate = bit * (result.bytesReceived - lastResult.bytesReceived) / (kilo * seconds);
37850
37864
  }
37851
37865
 
37852
- function _getFramesPerSecond(result, lastResults, isLocal) {
37853
- var lastResult = lastResults && lastResults.get(result.id),
37854
- seconds = lastResult ? ((result.timestamp - lastResult.timestamp) / 1000) : 5,
37855
- framesPerSecond;
37866
+ return Math.round(bitrate);
37867
+ }
37856
37868
 
37857
- if (!lastResult) {
37858
- framesPerSecond = 0;
37859
- } else if (isLocal) {
37860
- framesPerSecond = (result.framesSent - lastResult.framesSent) / seconds;
37861
- } else {
37862
- framesPerSecond = (result.framesReceived - lastResult.framesReceived) / seconds;
37863
- }
37869
+ function _getFramesPerSecond(result, lastResults, isLocal) {
37870
+ var lastResult = lastResults && lastResults.get(result.id),
37871
+ seconds = lastResult ? ((result.timestamp - lastResult.timestamp) / 1000) : 5,
37872
+ framesPerSecond;
37864
37873
 
37865
- return Math.round(framesPerSecond * 10) / 10;
37874
+ if (!lastResult) {
37875
+ framesPerSecond = 0;
37876
+ } else if (isLocal) {
37877
+ framesPerSecond = (result.framesSent - lastResult.framesSent) / seconds;
37878
+ } else {
37879
+ framesPerSecond = (result.framesReceived - lastResult.framesReceived) / seconds;
37866
37880
  }
37881
+
37882
+ return Math.round(framesPerSecond * 10) / 10;
37867
37883
  }
37868
37884
 
37869
37885
  // Find the line in sdpLines[startLine...endLine - 1] that starts with |prefix|
@@ -38050,6 +38066,9 @@ function setMediaBitrate(sdp, media, bitrate) {
38050
38066
  return newLines.join('\n');
38051
38067
  }
38052
38068
 
38069
+ // PRIVATE - exposed for unit tests only, not part of the public SDK contract.
38070
+ qbRTCPeerConnection._applyStatReport = _applyStatReport;
38071
+
38053
38072
  module.exports = qbRTCPeerConnection;
38054
38073
 
38055
38074
  },{"../../qbConfig":152,"./qbWebRTCHelpers":146}],145:[function(require,module,exports){
@@ -40550,8 +40569,8 @@ module.exports = StreamManagement;
40550
40569
  */
40551
40570
 
40552
40571
  var config = {
40553
- version: '2.24.0-beta.1',
40554
- buildNumber: '1179',
40572
+ version: '2.24.0',
40573
+ buildNumber: '1180',
40555
40574
  creds: {
40556
40575
  'appId': 0,
40557
40576
  'authKey': '',