@flashphoner/websdk 2.0.246 → 2.0.247

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.
@@ -11772,18 +11772,25 @@ var createConnection = function createConnection(options) {
11772
11772
  stat.forEach(function (report) {
11773
11773
  if (!report.isRemote) {
11774
11774
  var mediaType = "";
11775
- if (report.type == 'outbound-rtp') {
11775
+ if (report.type === 'outbound-rtp') {
11776
11776
  mediaType = getReportMediaType(report);
11777
11777
  fillStatObject(result.outboundStream, report, mediaType);
11778
- if (mediaType == 'video') {
11778
+ if (mediaType === 'video') {
11779
11779
  getVideoSize(result.outboundStream[mediaType], report);
11780
11780
  }
11781
- } else if (report.type == 'inbound-rtp') {
11781
+ } else if (report.type === 'inbound-rtp') {
11782
11782
  mediaType = getReportMediaType(report);
11783
11783
  fillStatObject(result.inboundStream, report, mediaType);
11784
- if (mediaType == 'video') {
11784
+ if (mediaType === 'video') {
11785
11785
  getVideoSize(result.inboundStream[mediaType], report);
11786
11786
  }
11787
+ } else if (report.type === 'candidate-pair' && report.state === 'succeeded' && report.nominated) {
11788
+ if (report.availableIncomingBitrate) {
11789
+ result.otherStats.availableIncomingBitrate = report.availableIncomingBitrate;
11790
+ } else if (localVideo && report.availableOutgoingBitrate) {
11791
+ // availableOutgoingBitrate is defined for incoming stream too #WCS-4175
11792
+ result.otherStats.availableOutgoingBitrate = report.availableOutgoingBitrate;
11793
+ }
11787
11794
  }
11788
11795
  }
11789
11796
  });
@@ -11840,12 +11847,19 @@ var createConnection = function createConnection(options) {
11840
11847
  var codec = util.getCurrentCodecAndSampleRate(sdp, mediaType);
11841
11848
  obj[mediaType]["codec"] = codec.name;
11842
11849
  obj[mediaType]["codecRate"] = codec.sampleRate;
11850
+ var qualityLimitationDurations;
11843
11851
  Object.keys(report).forEach(function (key) {
11844
11852
  // Add audioLevel parameter parsing #WCS-3290
11845
- if (key.startsWith("bytes") || key.startsWith("packets") || key.indexOf("Count") != -1 || key.indexOf("audioLevel") != -1 || key == "framesPerSecond") {
11853
+ if (key.startsWith("bytes") || key.startsWith("packets") || key.indexOf("Count") != -1 || key.indexOf("audioLevel") != -1 || key === "framesPerSecond" || key === "qualityLimitationReason") {
11846
11854
  obj[mediaType][key] = report[key];
11847
11855
  }
11856
+ if (key === "qualityLimitationDurations") {
11857
+ qualityLimitationDurations = report[key];
11858
+ }
11848
11859
  });
11860
+ if (qualityLimitationDurations) {
11861
+ obj[mediaType]["qualityLimitationDurations"] = qualityLimitationDurations[obj[mediaType]["qualityLimitationReason"]];
11862
+ }
11849
11863
  };
11850
11864
  var fullScreen = function fullScreen() {
11851
11865
  var video = document.getElementById(id);