@opentok/client 2.20.4 → 2.20.5

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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.20.4 06efe7d04
2
+ * @license OpenTok.js 2.20.5 674ea5899
3
3
  *
4
4
  * Copyright (c) 2010-2021 TokBox, Inc.
5
5
  * Subject to the applicable Software Development Kit (SDK) License Agreement:
6
6
  * https://tokbox.com/support/sdk_license
7
7
  *
8
- * Date: Sat, 30 Oct 2021 01:17:59 GMT
8
+ * Date: Thu, 18 Nov 2021 21:49:19 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -6378,7 +6378,7 @@ const _require = __webpack_require__(138),
6378
6378
  /** @type builtInConfig */
6379
6379
 
6380
6380
 
6381
- const builtInConfig = cloneDeep({"version":"v2.20.4","buildHash":"06efe7d04","minimumVersion":{"firefox":52,"chrome":49},"debug":"false","websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"https://static.opentok.com","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
6381
+ const builtInConfig = cloneDeep({"version":"v2.20.5","buildHash":"674ea5899","minimumVersion":{"firefox":52,"chrome":49},"debug":"false","websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"https://static.opentok.com","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
6382
6382
  const whitelistAllowedRuntimeProperties = pick(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
6383
6383
  const liveConfigMap = {
6384
6384
  apiUrl: 'apiURL',
@@ -9951,7 +9951,6 @@ module.exports = function PeerConnectionFactory(deps) {
9951
9951
  value = newValue;
9952
9952
 
9953
9953
  if (value && !api.iceConnectionStateIsConnected()) {
9954
- api.clearFailedTimeout();
9955
9954
  api.generateOffer();
9956
9955
  } else {
9957
9956
  logging.debug('iceRestart is going to wait until we disconnect and then restart ice');
@@ -10134,6 +10133,12 @@ module.exports = function PeerConnectionFactory(deps) {
10134
10133
  logging.debug('iceconnectionstatechange', _peerConnection.iceConnectionState);
10135
10134
 
10136
10135
  if (_peerConnection.iceConnectionState === 'connected') {
10136
+ // Now that the iceConnectionState is connected, let's make sure the transitionToFailedTimeOut
10137
+ // is cleared ASAP to avoid triggering an iceConnectionStateChange event to failed.
10138
+ if (_previousIceState === 'disconnected') {
10139
+ api.clearFailedTimeout();
10140
+ }
10141
+
10137
10142
  api.emit('iceConnected');
10138
10143
 
10139
10144
  _iceRestartNeeded.set(false);
@@ -16530,7 +16535,7 @@ module.exports = function PublisherFactory(_ref) {
16530
16535
  this._removeSubscriber = subscriberId => {
16531
16536
  const isAdaptiveEnabled = this.session.sessionInfo.isAdaptiveEnabled;
16532
16537
 
16533
- if (isAdaptiveEnabled) {
16538
+ if (isAdaptiveEnabled && activeSourceStreamId === 'P2P') {
16534
16539
  this._.startRelayedToRoutedTransition();
16535
16540
  }
16536
16541
 
@@ -17885,6 +17890,8 @@ module.exports = function PublisherFactory(_ref) {
17885
17890
  });
17886
17891
  };
17887
17892
 
17893
+ const isAdaptiveEnabled = this.session.sessionInfo.isAdaptiveEnabled;
17894
+
17888
17895
  switch (type) {
17889
17896
  case 'unsubscribe':
17890
17897
  this._removeSubscriber(subscriberId);
@@ -17893,6 +17900,12 @@ module.exports = function PublisherFactory(_ref) {
17893
17900
 
17894
17901
  default:
17895
17902
  if (!futurePeerConnection) {
17903
+ if (isAdaptiveEnabled && getP2pPeerConnection()) {
17904
+ // In the case Rumor sends two generateOffers for the P2P leg,
17905
+ // we need to ignore the second one.
17906
+ return;
17907
+ }
17908
+
17896
17909
  addPeerConnection();
17897
17910
  } else {
17898
17911
  futurePeerConnection.then(peerConnection => peerConnection.processMessage(type, message));
@@ -19245,18 +19258,10 @@ module.exports = function PublisherFactory(_ref) {
19245
19258
  return _regenerator.default.wrap(function _callee24$(_context24) {
19246
19259
  while (1) switch (_context24.prev = _context24.next) {
19247
19260
  case 0:
19248
- if (!(activeSourceStreamId === 'MANTIS')) {
19249
- _context24.next = 2;
19250
- break;
19251
- }
19252
-
19253
- return _context24.abrupt("return");
19254
-
19255
- case 2:
19256
19261
  logRelayedToRoutedTransition('Attempt');
19257
19262
 
19258
19263
  if (_this.session) {
19259
- _context24.next = 6;
19264
+ _context24.next = 4;
19260
19265
  break;
19261
19266
  }
19262
19267
 
@@ -19265,9 +19270,9 @@ module.exports = function PublisherFactory(_ref) {
19265
19270
  });
19266
19271
  return _context24.abrupt("return");
19267
19272
 
19268
- case 6:
19273
+ case 4:
19269
19274
  if (_this.streamId) {
19270
- _context24.next = 9;
19275
+ _context24.next = 7;
19271
19276
  break;
19272
19277
  }
19273
19278
 
@@ -19276,18 +19281,18 @@ module.exports = function PublisherFactory(_ref) {
19276
19281
  });
19277
19282
  return _context24.abrupt("return");
19278
19283
 
19279
- case 9:
19284
+ case 7:
19280
19285
  _this.session._.streamDestroy(_this.streamId, 'P2P');
19281
19286
 
19282
- _context24.next = 12;
19287
+ _context24.next = 10;
19283
19288
  return _restartSendingRtpToMantis();
19284
19289
 
19285
- case 12:
19290
+ case 10:
19286
19291
  logRelayedToRoutedTransition('Success');
19287
19292
 
19288
19293
  _this.trigger('streamDestroyForP2PComplete');
19289
19294
 
19290
- case 14:
19295
+ case 12:
19291
19296
  case "end":
19292
19297
  return _context24.stop();
19293
19298
  }
@@ -30587,38 +30592,46 @@ module.exports = function SubscriberFactory(_temp) {
30587
30592
  return _regenerator.default.wrap(function _callee2$(_context2) {
30588
30593
  while (1) switch (_context2.prev = _context2.next) {
30589
30594
  case 0:
30595
+ if (webRTCStream) {
30596
+ _context2.next = 2;
30597
+ break;
30598
+ }
30599
+
30600
+ return _context2.abrupt("return");
30601
+
30602
+ case 2:
30590
30603
  videoContainerOptions = {
30591
30604
  error: onVideoError,
30592
30605
  audioVolume: _audioVolume
30593
30606
  };
30594
- _context2.prev = 1;
30595
- _context2.next = 4;
30607
+ _context2.prev = 3;
30608
+ _context2.next = 6;
30596
30609
  return _widgetView.bindVideo(webRTCStream, videoContainerOptions);
30597
30610
 
30598
- case 4:
30599
- _context2.next = 12;
30611
+ case 6:
30612
+ _context2.next = 14;
30600
30613
  break;
30601
30614
 
30602
- case 6:
30603
- _context2.prev = 6;
30604
- _context2.t0 = _context2["catch"](1);
30615
+ case 8:
30616
+ _context2.prev = 8;
30617
+ _context2.t0 = _context2["catch"](3);
30605
30618
 
30606
30619
  if (!(_context2.t0 instanceof CancellationError || _state.isDestroyed())) {
30607
- _context2.next = 10;
30620
+ _context2.next = 12;
30608
30621
  break;
30609
30622
  }
30610
30623
 
30611
30624
  return _context2.abrupt("return");
30612
30625
 
30613
- case 10:
30626
+ case 12:
30614
30627
  onVideoError(_context2.t0);
30615
30628
  throw _context2.t0;
30616
30629
 
30617
- case 12:
30630
+ case 14:
30618
30631
  case "end":
30619
30632
  return _context2.stop();
30620
30633
  }
30621
- }, _callee2, null, [[1, 6]]);
30634
+ }, _callee2, null, [[3, 8]]);
30622
30635
  }));
30623
30636
 
30624
30637
  return function bindWebRTCStream(_x2) {
@@ -33196,34 +33209,14 @@ module.exports = function SubscriberFactory(_temp) {
33196
33209
  return _context18.abrupt("return");
33197
33210
 
33198
33211
  case 2:
33199
- if (!(_activeSourceStreamId === 'MANTIS')) {
33200
- _context18.next = 4;
33201
- break;
33202
- }
33203
-
33204
- return _context18.abrupt("return");
33205
-
33206
- case 4:
33207
33212
  logRelayedToRoutedTransition('Attempt');
33208
-
33209
- if (_state.isSubscribing()) {
33210
- _context18.next = 8;
33211
- break;
33212
- }
33213
-
33214
- logRelayedToRoutedTransition('Failure', {
33215
- reason: 'Subscriber is not subscribing'
33216
- });
33217
- return _context18.abrupt("return");
33218
-
33219
- case 8:
33220
33213
  webRTCStream = webRTCStreams.MANTIS;
33221
33214
  _webRTCStream = webRTCStream; // bind mantis stream
33222
33215
 
33223
- _context18.next = 12;
33216
+ _context18.next = 7;
33224
33217
  return bindWebRTCStream(webRTCStream);
33225
33218
 
33226
- case 12:
33219
+ case 7:
33227
33220
  // Keep the loading spinner hidden so that the transition looks transparent.
33228
33221
  _widgetView.loading(false); // remove and close p2p connection
33229
33222
 
@@ -33232,16 +33225,16 @@ module.exports = function SubscriberFactory(_temp) {
33232
33225
  _activeSourceStreamId = 'MANTIS'; // remove webRTCStream
33233
33226
 
33234
33227
  removeWebRTCStream('P2P');
33235
- _context18.next = 18;
33228
+ _context18.next = 13;
33236
33229
  return getCurrentPeerConnection();
33237
33230
 
33238
- case 18:
33231
+ case 13:
33239
33232
  peerConnection = _context18.sent;
33240
33233
  // Create audioLevelSampler for the current peer connection
33241
33234
  createAudioLevelSampler(peerConnection);
33242
33235
  logRelayedToRoutedTransition('Success');
33243
33236
 
33244
- case 21:
33237
+ case 16:
33245
33238
  case "end":
33246
33239
  return _context18.stop();
33247
33240
  }