@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.
@@ -463,18 +463,25 @@ var createConnection = function (options) {
463
463
  stat.forEach(function (report) {
464
464
  if (!report.isRemote) {
465
465
  let mediaType = "";
466
- if (report.type == 'outbound-rtp') {
466
+ if (report.type === 'outbound-rtp') {
467
467
  mediaType = getReportMediaType(report);
468
468
  fillStatObject(result.outboundStream, report, mediaType);
469
- if (mediaType == 'video') {
469
+ if (mediaType === 'video') {
470
470
  getVideoSize(result.outboundStream[mediaType], report);
471
471
  }
472
- } else if (report.type == 'inbound-rtp') {
472
+ } else if (report.type === 'inbound-rtp') {
473
473
  mediaType = getReportMediaType(report);
474
474
  fillStatObject(result.inboundStream, report, mediaType);
475
- if (mediaType == 'video') {
475
+ if (mediaType === 'video') {
476
476
  getVideoSize(result.inboundStream[mediaType], report);
477
477
  }
478
+ } else if (report.type === 'candidate-pair' && report.state === 'succeeded' && report.nominated) {
479
+ if (report.availableIncomingBitrate) {
480
+ result.otherStats.availableIncomingBitrate = report.availableIncomingBitrate;
481
+ } else if (localVideo && report.availableOutgoingBitrate) {
482
+ // availableOutgoingBitrate is defined for incoming stream too #WCS-4175
483
+ result.otherStats.availableOutgoingBitrate = report.availableOutgoingBitrate;
484
+ }
478
485
  }
479
486
  }
480
487
  });
@@ -532,19 +539,27 @@ var createConnection = function (options) {
532
539
  } else {
533
540
  logger.debug(LOG_PREFIX, "Can't parse current SDP to detect codec and sampleRate");
534
541
  }
535
- var codec = util.getCurrentCodecAndSampleRate(sdp, mediaType);
542
+ let codec = util.getCurrentCodecAndSampleRate(sdp, mediaType);
536
543
  obj[mediaType]["codec"] = codec.name;
537
544
  obj[mediaType]["codecRate"] = codec.sampleRate;
545
+ let qualityLimitationDurations;
538
546
  Object.keys(report).forEach(function (key) {
539
547
  // Add audioLevel parameter parsing #WCS-3290
540
548
  if (key.startsWith("bytes") ||
541
549
  key.startsWith("packets") ||
542
550
  key.indexOf("Count") != -1 ||
543
551
  key.indexOf("audioLevel") != -1 ||
544
- key == "framesPerSecond") {
552
+ key === "framesPerSecond" ||
553
+ key === "qualityLimitationReason" ) {
545
554
  obj[mediaType][key] = report[key];
546
555
  }
556
+ if (key === "qualityLimitationDurations") {
557
+ qualityLimitationDurations = report[key];
558
+ }
547
559
  });
560
+ if (qualityLimitationDurations) {
561
+ obj[mediaType]["qualityLimitationDurations"] = qualityLimitationDurations[obj[mediaType]["qualityLimitationReason"]];
562
+ }
548
563
  };
549
564
 
550
565
  var fullScreen = function () {