twilio-video 2.19.0 → 2.19.1

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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@ The Twilio Programmable Video SDKs use [Semantic Versioning](http://www.semver.o
2
2
 
3
3
  **Version 1.x reached End of Life on September 8th, 2021.** See the changelog entry [here](https://www.twilio.com/changelog/end-of-life-complete-for-unsupported-versions-of-the-programmable-video-sdk). Support for the 1.x version ended on December 4th, 2020.
4
4
 
5
+ 2.19.1 (February 7, 2022)
6
+ =========================
7
+ Bug Fixes
8
+ ---------
9
+
10
+ - Fixed a bug where media connection was not getting reconnected after a network interruption if participant was not subscribed to any tracks. (VIDEO-8315)
11
+ - Fixed a bug where network quality score stops updating after network glitches. (VIDEO-8413)
12
+
13
+
5
14
  2.19.0 (January 31, 2022)
6
15
  =========================
7
16
 
package/README.md CHANGED
@@ -74,7 +74,7 @@ Releases of twilio-video.js are hosted on a CDN, and you can include these
74
74
  directly in your web app using a <script> tag.
75
75
 
76
76
  ```html
77
- <script src="//sdk.twilio.com/js/video/releases/2.19.0/twilio-video.min.js"></script>
77
+ <script src="//sdk.twilio.com/js/video/releases/2.19.1/twilio-video.min.js"></script>
78
78
 
79
79
  ```
80
80
 
@@ -1,4 +1,4 @@
1
- /*! twilio-video.js 2.19.0
1
+ /*! twilio-video.js 2.19.1
2
2
 
3
3
  The following license applies to all parts of this software except as
4
4
  documented below.
@@ -3491,6 +3491,8 @@ function restartWhenInadvertentlyStopped(localMediaTrack) {
3491
3491
  addMediaStreamTrackListeners();
3492
3492
  trackChangeInProgress.resolve();
3493
3493
  trackChangeInProgress = null;
3494
+ }).catch(function (error) {
3495
+ log.error('failed to restart track: ', error);
3494
3496
  });
3495
3497
  }
3496
3498
  // NOTE(mmalavalli): If the MediaStreamTrack ends before the DOM is visible,
@@ -11076,13 +11078,6 @@ var IceConnectionMonitor = /** @class */ (function () {
11076
11078
  }
11077
11079
  IceConnectionMonitor.prototype._getActivePairStat = function (stats) {
11078
11080
  var statsArray = Array.from(stats.values());
11079
- var hasInBoundTracks = statsArray.find(function (stat) { return stat.type === 'inbound-rtp'; });
11080
- if (!hasInBoundTracks) {
11081
- // NOTE(mpatwardhan): when there are no tracks shared on a peerConnection
11082
- // we may see inactivity on bytesReceived - but that is not real inactivity,
11083
- // ignore it.
11084
- return null;
11085
- }
11086
11081
  var activePairStats = statsArray.find(function (stat) { return stat.type === 'candidate-pair' && stat.nominated; });
11087
11082
  // NOTE(mpatwardhan): sometimes (JSDK-2667) after getting disconnected while switching network
11088
11083
  // we may not find active pair. Treat this as 0 bytesReceived so that we count it towards inactivity.
@@ -11136,6 +11131,9 @@ var IceConnectionMonitor = /** @class */ (function () {
11136
11131
  if (!iceStats) {
11137
11132
  return;
11138
11133
  }
11134
+ // NOTE(mpatwardhan): We look at bytesReceived on active candidate pair as an indication of active ice connection.
11135
+ // As per spec (https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatepairstats-bytesreceived) this value
11136
+ // includes RTCP traffic and is +ve even when there are no tracks subscribed to.
11139
11137
  if (!_this._lastActivity || _this._lastActivity.bytesReceived !== iceStats.bytesReceived) {
11140
11138
  _this._lastActivity = iceStats;
11141
11139
  // detected activity, cancel scheduled callback if any.
@@ -11907,6 +11905,8 @@ var __extends = (this && this.__extends) || (function () {
11907
11905
  })();
11908
11906
  var MediaSignaling = require('./mediasignaling');
11909
11907
  var AsyncVar = require('../../util/asyncvar');
11908
+ var Timeout = require('../../util/timeout');
11909
+ var NETWORK_QUALITY_RESPONSE_TIME_MS = 5000;
11910
11910
  /**
11911
11911
  * @interface MediaSignalingTransport
11912
11912
  * @property {function(object): boolean} send
@@ -11991,6 +11991,13 @@ var NetworkQualitySignaling = /** @class */ (function (_super) {
11991
11991
  _networkQualityInputs: {
11992
11992
  value: new AsyncVar()
11993
11993
  },
11994
+ _resendTimer: {
11995
+ value: new Timeout(function () {
11996
+ // and schedule next timer at x1.5 the delay..
11997
+ _this._resendTimer.setDelay(_this._resendTimer.delay * 1.5);
11998
+ _this._sendNetworkQualityInputs();
11999
+ }, NETWORK_QUALITY_RESPONSE_TIME_MS, false),
12000
+ },
11994
12001
  _networkQualityReportLevels: {
11995
12002
  get: function () {
11996
12003
  return {
@@ -12002,6 +12009,7 @@ var NetworkQualitySignaling = /** @class */ (function (_super) {
12002
12009
  });
12003
12010
  _this.on('ready', function (transport) {
12004
12011
  transport.on('message', function (message) {
12012
+ _this._log.debug('Incoming: ', message);
12005
12013
  switch (message.type) {
12006
12014
  case 'network_quality':
12007
12015
  _this._handleNetworkQualityMessage(message);
@@ -12089,7 +12097,13 @@ var NetworkQualitySignaling = /** @class */ (function (_super) {
12089
12097
  if (updated) {
12090
12098
  this.emit('updated');
12091
12099
  }
12092
- setTimeout(function () { return _this._sendNetworkQualityInputs(); }, 1000);
12100
+ // score is received. so reset the timer to default timeout.
12101
+ this._resendTimer.setDelay(NETWORK_QUALITY_RESPONSE_TIME_MS);
12102
+ // timer is cleared only while we are sending inputs.
12103
+ // if we are already sending inputs do not send them again.
12104
+ if (this._resendTimer.isSet) {
12105
+ setTimeout(function () { return _this._sendNetworkQualityInputs(); }, 1000);
12106
+ }
12093
12107
  };
12094
12108
  /**
12095
12109
  * Start sending {@link NetworkQualityInputs}.
@@ -12098,10 +12112,13 @@ var NetworkQualitySignaling = /** @class */ (function (_super) {
12098
12112
  */
12099
12113
  NetworkQualitySignaling.prototype._sendNetworkQualityInputs = function () {
12100
12114
  var _this = this;
12115
+ this._resendTimer.clear();
12101
12116
  return this._networkQualityInputs.take().then(function (networkQualityInputs) {
12102
12117
  if (_this._transport) {
12103
12118
  _this._transport.publish(createNetworkQualityInputsMessage(networkQualityInputs, _this._networkQualityReportLevels));
12104
12119
  }
12120
+ }).finally(function () {
12121
+ _this._resendTimer.start();
12105
12122
  });
12106
12123
  };
12107
12124
  /**
@@ -12134,7 +12151,7 @@ function createNetworkQualityInputsMessage(networkQualityInputs, networkQualityR
12134
12151
  }
12135
12152
  module.exports = NetworkQualitySignaling;
12136
12153
 
12137
- },{"../../util/asyncvar":118,"./mediasignaling":71}],74:[function(require,module,exports){
12154
+ },{"../../util/asyncvar":118,"../../util/timeout":143,"./mediasignaling":71}],74:[function(require,module,exports){
12138
12155
  'use strict';
12139
12156
  var __extends = (this && this.__extends) || (function () {
12140
12157
  var extendStatics = function (d, b) {
@@ -31762,7 +31779,7 @@ module.exports={
31762
31779
  "name": "twilio-video",
31763
31780
  "title": "Twilio Video",
31764
31781
  "description": "Twilio Video JavaScript Library",
31765
- "version": "2.19.0",
31782
+ "version": "2.19.1",
31766
31783
  "homepage": "https://twilio.com",
31767
31784
  "author": "Mark Andrus Roberts <mroberts@twilio.com>",
31768
31785
  "contributors": [