@opentok/client 2.27.3-beta.2 → 2.27.3-beta.3

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.27.3-beta.02 76678ae
2
+ * @license OpenTok.js 2.27.3-beta.03 7ad22c0
3
3
  *
4
4
  * Copyright (c) 2010-2024 TokBox, Inc.
5
5
  * Subject to the applicable Software Development Kit (SDK) License Agreement:
6
6
  * https://www.vonage.com/legal/communications-apis/terms-of-use/
7
7
  *
8
- * Date: Fri, 15 Mar 2024 16:55:56 GMT
8
+ * Date: Tue, 19 Mar 2024 16:57:00 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -7952,7 +7952,7 @@ const logging = (0, _log.default)('StaticConfig');
7952
7952
  */
7953
7953
 
7954
7954
  /** @type builtInConfig */
7955
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.27.3-beta.02","buildHash":"76678ae","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
7955
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.27.3-beta.03","buildHash":"7ad22c0","minimumVersion":{"firefox":52,"chrome":49},"debug":false,"websiteURL":"http://www.tokbox.com","configURL":"https://config.opentok.com","ipWhitelistConfigURL":"","cdnURL":"","loggingURL":"https://hlg.tokbox.com/prod","apiURL":"https://anvil.opentok.com"});
7956
7956
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
7957
7957
  const liveConfigMap = {
7958
7958
  apiUrl: 'apiURL',
@@ -34093,33 +34093,36 @@ function SubscriberFactory(_ref2) {
34093
34093
  _context7.next = 23;
34094
34094
  return bindWebRTCStream(_mediaStream);
34095
34095
  case 23:
34096
- _context7.next = 33;
34096
+ _context7.next = 34;
34097
34097
  break;
34098
34098
  case 25:
34099
34099
  _context7.prev = 25;
34100
34100
  _context7.t0 = _context7["catch"](20);
34101
34101
  if (!(0, _amrVideoBufferError.isAmrVideoBufferError)(_context7.t0)) {
34102
- _context7.next = 32;
34102
+ _context7.next = 33;
34103
34103
  break;
34104
34104
  }
34105
34105
  logging.error(`OT.Subscriber: ${_context7.t0.message}`);
34106
- // If videoBuffer failed, there is no much we can do since there isn't a retry logic
34107
- // at platform level. However we can finish the transition, and hopefully next
34108
- // transition fixes it.
34106
+ // If videoBuffer failed, we complete the transition to avoid a hanging state.
34109
34107
  onLoaded();
34110
34108
  amrState.completeTransitionTo(_activeSourceStreamId);
34109
+ // If it fails when transitioning to P2P, we roll back to Routed. If it fails when
34110
+ // transitioning to Routed, then there is nothing we can do.
34111
+ if (_activeSourceStreamId === 'P2P') {
34112
+ socket.subscriberDestroy(_stream.id, _this.widgetId, _activeSourceStreamId);
34113
+ }
34111
34114
  return _context7.abrupt("return");
34112
- case 32:
34113
- throw _context7.t0;
34114
34115
  case 33:
34116
+ throw _context7.t0;
34117
+ case 34:
34115
34118
  startAudioStatsWatcher();
34116
34119
  if (!_state.isDestroyed()) {
34117
- _context7.next = 37;
34120
+ _context7.next = 38;
34118
34121
  break;
34119
34122
  }
34120
34123
  logging.error('Subscriber destroyed');
34121
34124
  return _context7.abrupt("return");
34122
- case 37:
34125
+ case 38:
34123
34126
  if (peerConnection && (typeof window !== undefined ? window : global).webkitMediaStream) {
34124
34127
  // Enable any video streams that we previously disabled for OPENTOK-27112
34125
34128
  peerConnection._getVideoTracks().forEach(track => {
@@ -34147,12 +34150,12 @@ function SubscriberFactory(_ref2) {
34147
34150
  _widgetView.once('videoElementCreated', resolve);
34148
34151
  _subscriber.once('destroyed', reject);
34149
34152
  });
34150
- _context7.next = 45;
34153
+ _context7.next = 46;
34151
34154
  return videoElementCreated;
34152
- case 45:
34153
- _context7.next = 47;
34155
+ case 46:
34156
+ _context7.next = 48;
34154
34157
  return _pcConnected.promise;
34155
- case 47:
34158
+ case 48:
34156
34159
  if (!isSwappingStreams) {
34157
34160
  onLoaded();
34158
34161
  } else {
@@ -34188,34 +34191,34 @@ function SubscriberFactory(_ref2) {
34188
34191
  // Given an AMR transition, and an audio connector, we apply the connector for the new
34189
34192
  // relayed stream and clear it for the routed stream.
34190
34193
  if (!_isAdaptiveEnabled) {
34191
- _context7.next = 63;
34194
+ _context7.next = 64;
34192
34195
  break;
34193
34196
  }
34194
34197
  amrState.completeTransitionTo(_activeSourceStreamId);
34195
34198
  if (!(_isSubscribingToAudio && _audioConnector.audioMediaProcessorConnector)) {
34196
- _context7.next = 63;
34199
+ _context7.next = 64;
34197
34200
  break;
34198
34201
  }
34199
- _context7.prev = 54;
34200
- _context7.next = 57;
34202
+ _context7.prev = 55;
34203
+ _context7.next = 58;
34201
34204
  return _audioConnector.applyAudioConnectorOnRoutedToRelayedTransition();
34202
- case 57:
34205
+ case 58:
34203
34206
  logAnalyticsEvent('setAudioMediaProcessorConnector', 'Success', {
34204
34207
  message: 'Audio connector applied on routed to relayed transition.'
34205
34208
  });
34206
- _context7.next = 63;
34209
+ _context7.next = 64;
34207
34210
  break;
34208
- case 60:
34209
- _context7.prev = 60;
34210
- _context7.t1 = _context7["catch"](54);
34211
+ case 61:
34212
+ _context7.prev = 61;
34213
+ _context7.t1 = _context7["catch"](55);
34211
34214
  logAnalyticsEvent('setAudioMediaProcessorConnector', 'Failure', {
34212
34215
  message: _context7.t1.message
34213
34216
  });
34214
- case 63:
34217
+ case 64:
34215
34218
  case "end":
34216
34219
  return _context7.stop();
34217
34220
  }
34218
- }, _callee7, null, [[20, 25], [54, 60]]);
34221
+ }, _callee7, null, [[20, 25], [55, 61]]);
34219
34222
  }));
34220
34223
  return function onRemoteStreamAdded(_x9, _x10) {
34221
34224
  return _ref15.apply(this, arguments);
@@ -67397,11 +67400,15 @@ Message.subscribers.create = function (opt) {
67397
67400
  content
67398
67401
  });
67399
67402
  };
67400
- Message.subscribers.destroy = function (apiKey, sessionId, streamId, subscriberId) {
67403
+ Message.subscribers.destroy = function (apiKey, sessionId, streamId, subscriberId, sourceStreamId) {
67404
+ const content = {};
67405
+ if (sourceStreamId) {
67406
+ content.sourceStreamId = sourceStreamId;
67407
+ }
67401
67408
  return (0, _serializeMessage.default)({
67402
67409
  method: 'delete',
67403
67410
  uri: `/v2/partner/${apiKey}/session/${sessionId}/stream/${streamId}/subscriber/${subscriberId}`,
67404
- content: {}
67411
+ content
67405
67412
  });
67406
67413
  };
67407
67414
  Message.subscribers.update = function (apiKey, sessionId, streamId, subscriberId, attributes) {
@@ -97885,8 +97892,8 @@ function RaptorSocketFactory(deps) {
97885
97892
  };
97886
97893
  this.publish(RaptorMessage.subscribers.create(subscriberCreateOpts), {}, true, completion);
97887
97894
  };
97888
- this.subscriberDestroy = function (streamId, subscriberId) {
97889
- this.publish(RaptorMessage.subscribers.destroy(_apiKey, _sessionId, streamId, subscriberId), {}, true);
97895
+ this.subscriberDestroy = function (streamId, subscriberId, sourceStreamId) {
97896
+ this.publish(RaptorMessage.subscribers.destroy(_apiKey, _sessionId, streamId, subscriberId, sourceStreamId), {}, true);
97890
97897
  };
97891
97898
  this.subscriberUpdate = function (streamId, subscriberId, attributes) {
97892
97899
  this.publish(RaptorMessage.subscribers.update(_apiKey, _sessionId, streamId, subscriberId, attributes), {}, true);