@opentok/client 2.30.1-alpha.3 → 2.30.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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.30.1 72c06c3d2
2
+ * @license OpenTok.js 2.30.1 8989bb63b
3
3
  *
4
4
  * Copyright (c) 2010-2025 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: Wed, 21 May 2025 16:17:04 GMT
8
+ * Date: Thu, 15 May 2025 16:40:16 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8672,7 +8672,7 @@ const logging = (0, _log.default)('StaticConfig');
8672
8672
  */
8673
8673
 
8674
8674
  /** @type builtInConfig */
8675
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.1","buildHash":"72c06c3d2","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"});
8675
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.1","buildHash":"8989bb63b","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"});
8676
8676
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
8677
8677
  const liveConfigMap = {
8678
8678
  apiUrl: 'apiURL',
@@ -17776,9 +17776,8 @@ function PublisherFactory(_ref) {
17776
17776
  });
17777
17777
  });
17778
17778
  function getCommonAnalyticsFields() {
17779
- var _getSession, _getSession2, _getSession2$connecti;
17780
17779
  return {
17781
- connectionId: (_getSession = getSession()) != null && _getSession.isConnected() ? (_getSession2 = getSession()) == null ? void 0 : (_getSession2$connecti = _getSession2.connection) == null ? void 0 : _getSession2$connecti.connectionId : null,
17780
+ connectionId: getSession().isConnected() ? getSession().connection.connectionId : null,
17782
17781
  streamId: getStreamId(),
17783
17782
  widgetType: 'Publisher'
17784
17783
  };
@@ -18080,7 +18079,7 @@ function PublisherFactory(_ref) {
18080
18079
  logAnalyticsEvent('GetRtcStatsReport', 'Called');
18081
18080
  });
18082
18081
  const recordQOS = _ref4 => {
18083
- var _this$session2, _this$session3, _this$session3$connec, _properties$audioFall;
18082
+ var _properties$audioFall;
18084
18083
  let parsedStats = _ref4.parsedStats,
18085
18084
  simulcastEnabled = _ref4.simulcastEnabled,
18086
18085
  remoteConnectionId = _ref4.remoteConnectionId,
@@ -18089,7 +18088,7 @@ function PublisherFactory(_ref) {
18089
18088
  const QoSBlob = {
18090
18089
  peerId,
18091
18090
  widgetType: 'Publisher',
18092
- connectionId: (_this$session2 = this.session) != null && _this$session2.isConnected() ? (_this$session3 = this.session) == null ? void 0 : (_this$session3$connec = _this$session3.connection) == null ? void 0 : _this$session3$connec.connectionId : null,
18091
+ connectionId: this.session && this.session.isConnected() ? this.session.connection.connectionId : null,
18093
18092
  streamId: this.streamId,
18094
18093
  width: widgetView.width,
18095
18094
  height: widgetView.height,
@@ -20893,7 +20892,7 @@ function PublisherFactory(_ref) {
20893
20892
  document.addEventListener('visibilitychange', visibilityHandler);
20894
20893
  };
20895
20894
  const handleBuggedUnMutedLocalAudioTrack = audioTrack => {
20896
- var _this$session4;
20895
+ var _this$session2;
20897
20896
  if (hasAudio()) {
20898
20897
  if (!hasVideo()) {
20899
20898
  // We only need to reset the audio source when the publisher is audio only.
@@ -20908,7 +20907,7 @@ function PublisherFactory(_ref) {
20908
20907
  this.videoElement().pause();
20909
20908
  }
20910
20909
  }
20911
- this == null ? void 0 : (_this$session4 = this.session) == null ? void 0 : _this$session4.trigger('gsmCallEnded');
20910
+ this == null ? void 0 : (_this$session2 = this.session) == null ? void 0 : _this$session2.trigger('gsmCallEnded');
20912
20911
  };
20913
20912
 
20914
20913
  /**
@@ -37158,18 +37157,18 @@ function SubscriberFactory(_ref2) {
37158
37157
  return _webRTCStream.getAudioTracks().length > 0;
37159
37158
  };
37160
37159
  const logAnalyticsEvent = (action, variation, payload, options, throttle) => {
37161
- var _session2, _session3, _session3$connection, _session$sessionInfo$, _session4, _session4$sessionInfo, _session5;
37160
+ var _session2;
37162
37161
  let stats = (0, _assign.default)({
37163
37162
  action,
37164
37163
  variation,
37165
37164
  payload,
37166
37165
  streamId: _stream ? _stream.id : null,
37167
37166
  sessionId: _session ? _session.sessionId : null,
37168
- connectionId: (_session2 = _session) != null && _session2.isConnected() ? (_session3 = _session) == null ? void 0 : (_session3$connection = _session3.connection) == null ? void 0 : _session3$connection.connectionId : null,
37169
- partnerId: (_session$sessionInfo$ = (_session4 = _session) == null ? void 0 : (_session4$sessionInfo = _session4.sessionInfo) == null ? void 0 : _session4$sessionInfo.partnerId) != null ? _session$sessionInfo$ : null,
37167
+ connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null,
37168
+ partnerId: _session && _session.sessionInfo ? _session.sessionInfo.partnerId : null,
37170
37169
  subscriberId: _widgetId,
37171
37170
  widgetType: 'Subscriber',
37172
- singlePeerConnection: !!((_session5 = _session) != null && _session5._singlePeerConnectionController)
37171
+ singlePeerConnection: !!((_session2 = _session) != null && _session2._singlePeerConnectionController)
37173
37172
  }, options);
37174
37173
  if (variation === 'Failure' || variation === 'iceconnectionstatechange' && payload === 'closed') {
37175
37174
  stats = (0, _assign.default)(stats, _preDisconnectStats);
@@ -37341,9 +37340,8 @@ function SubscriberFactory(_ref2) {
37341
37340
  (0, _connectivityAttemptPinger.default)({
37342
37341
  connectivityState,
37343
37342
  logAttempt() {
37344
- var _session6, _session7, _session7$connection;
37345
37343
  logAnalyticsEvent('Subscribe', 'Attempting', null, {
37346
- connectionId: (_session6 = _session) != null && _session6.isConnected() ? (_session7 = _session) == null ? void 0 : (_session7$connection = _session7.connection) == null ? void 0 : _session7$connection.connectionId : null
37344
+ connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null
37347
37345
  });
37348
37346
  }
37349
37347
  });
@@ -37368,7 +37366,7 @@ function SubscriberFactory(_ref2) {
37368
37366
  logAnalyticsEvent('ICERestart', variation, payload);
37369
37367
  };
37370
37368
  const recordQOS = _ref12 => {
37371
- var _session$connection$c, _session8, _session8$connection, _properties$preferred, _properties$preferred2;
37369
+ var _properties$preferred, _properties$preferred2;
37372
37370
  let parsedStats = _ref12.parsedStats,
37373
37371
  remoteConnectionId = _ref12.remoteConnectionId,
37374
37372
  peerId = _ref12.peerId,
@@ -37382,7 +37380,7 @@ function SubscriberFactory(_ref2) {
37382
37380
  subscribeToAudio: _isSubscribingToAudio,
37383
37381
  audioVolume: this.getAudioVolume(),
37384
37382
  videoTrack: _streamHasTracks('video'),
37385
- connectionId: (_session$connection$c = (_session8 = _session) == null ? void 0 : (_session8$connection = _session8.connection) == null ? void 0 : _session8$connection.connectionId) != null ? _session$connection$c : null,
37383
+ connectionId: _session ? _session.connection.connectionId : null,
37386
37384
  hasVideo: _stream && _stream.hasVideo,
37387
37385
  subscribeToVideo: _properties.subscribeToVideo,
37388
37386
  congestionLevel: _congestionLevel,
@@ -37906,13 +37904,13 @@ function SubscriberFactory(_ref2) {
37906
37904
  }();
37907
37905
  const onRemoteStreamAdded = (0, _queue.default)( /*#__PURE__*/function () {
37908
37906
  var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11(_ref20, done) {
37909
- var webRTCStream, peerConnection, sourceStreamId, _session9, sessionInfo, forceDisable;
37907
+ var webRTCStream, peerConnection, sourceStreamId, _session3, sessionInfo, forceDisable;
37910
37908
  return _regenerator.default.wrap(function _callee11$(_context11) {
37911
37909
  while (1) switch (_context11.prev = _context11.next) {
37912
37910
  case 0:
37913
37911
  webRTCStream = _ref20.webRTCStream, peerConnection = _ref20.peerConnection;
37914
37912
  sourceStreamId = peerConnection == null ? void 0 : peerConnection.getSourceStreamId();
37915
- _session9 = _session, sessionInfo = _session9.sessionInfo;
37913
+ _session3 = _session, sessionInfo = _session3.sessionInfo;
37916
37914
  setStream(webRTCStream, sourceStreamId);
37917
37915
  logging.debug('OT.Subscriber.onRemoteStreamAdded with sourceStreamId', sourceStreamId);
37918
37916
  if (!_state.isMigrating()) {
@@ -38621,7 +38619,6 @@ function SubscriberFactory(_ref2) {
38621
38619
  };
38622
38620
  }();
38623
38621
  this._destroy = _ref30 => {
38624
- var _session10, _session11, _session11$connection, _session$sessionInfo$2, _session12, _session12$sessionInf;
38625
38622
  let _ref30$reason = _ref30.reason,
38626
38623
  reason = _ref30$reason === void 0 ? 'Unknown' : _ref30$reason,
38627
38624
  quiet = _ref30.quiet,
@@ -38637,8 +38634,8 @@ function SubscriberFactory(_ref2) {
38637
38634
  }
38638
38635
  _preDisconnectStats = {
38639
38636
  sessionId: _session.sessionId,
38640
- connectionId: (_session10 = _session) != null && _session10.isConnected() ? (_session11 = _session) == null ? void 0 : (_session11$connection = _session11.connection) == null ? void 0 : _session11$connection.connectionId : null,
38641
- partnerId: (_session$sessionInfo$2 = (_session12 = _session) == null ? void 0 : (_session12$sessionInf = _session12.sessionInfo) == null ? void 0 : _session12$sessionInf.partnerId) != null ? _session$sessionInfo$2 : null,
38637
+ connectionId: _session && _session.isConnected() ? _session.connection.connectionId : null,
38638
+ partnerId: _session && _session.sessionInfo ? _session.sessionInfo.partnerId : null,
38642
38639
  streamId: _stream && !_stream.destroyed ? _stream.id : null
38643
38640
  };
38644
38641
  this._disconnect({
@@ -39634,7 +39631,7 @@ function SubscriberFactory(_ref2) {
39634
39631
  _activeSourceStreamId = sourceStreamId;
39635
39632
  peerConnectionsAsync[sourceStreamId] = new Promise((resolve, reject) => {
39636
39633
  _session._.getIceConfig().then(iceConfig => {
39637
- var _session13;
39634
+ var _session4;
39638
39635
  if (iceConfig.needRumorIceServersFallback) {
39639
39636
  iceConfig.servers = [...(fallbackIceServers || []), ...(iceConfig.servers || [])];
39640
39637
  }
@@ -39651,7 +39648,7 @@ function SubscriberFactory(_ref2) {
39651
39648
  keyStore: _session.keyStore,
39652
39649
  sFrameClientStore: _session.sFrameClientStore,
39653
39650
  isE2ee: _session._.isE2ee(),
39654
- sessionId: (_session13 = _session) == null ? void 0 : _session13.sessionId
39651
+ sessionId: (_session4 = _session) == null ? void 0 : _session4.sessionId
39655
39652
  };
39656
39653
  if (Object.prototype.hasOwnProperty.call(_properties, 'codecFlags')) {
39657
39654
  props.codecFlags = _properties.codecFlags;
@@ -44812,7 +44809,6 @@ function SessionFactory(deps) {
44812
44809
  * @memberOf Session
44813
44810
  */
44814
44811
  this.subscribe = function (stream, targetElement, properties, completionHandler) {
44815
- var _this$connection;
44816
44812
  if (typeof targetElement === 'function') {
44817
44813
  completionHandler = targetElement;
44818
44814
  targetElement = undefined;
@@ -44823,7 +44819,7 @@ function SessionFactory(deps) {
44823
44819
  properties = undefined;
44824
44820
  }
44825
44821
  completionHandler = completionHandler || function () {};
44826
- if (!((_this$connection = this.connection) != null && _this$connection.connectionId)) {
44822
+ if (!this.connection || !this.connection.connectionId) {
44827
44823
  dispatchOTError(otError(errors.NOT_CONNECTED, new Error('Session.subscribe :: Connection required to subscribe'), ExceptionCodes.UNABLE_TO_SUBSCRIBE), completionHandler);
44828
44824
  return undefined;
44829
44825
  }
@@ -45021,13 +45017,12 @@ function SessionFactory(deps) {
45021
45017
  _isSocketReconnecting = false;
45022
45018
  this.dispatchEvent(new Events.SessionReconnectedEvent());
45023
45019
  if (this.sessionInfo.reconnection) {
45024
- var _this$session, _this$session$session;
45025
45020
  sessionObjects.publishers.where({
45026
45021
  session: this
45027
45022
  }).forEach(publisher => {
45028
45023
  publisher._.iceRestart();
45029
45024
  });
45030
- if (!((_this$session = this.session) != null && (_this$session$session = _this$session.sessionInfo) != null && _this$session$session.p2pEnabled)) {
45025
+ if (!this.session.sessionInfo.p2pEnabled) {
45031
45026
  sessionObjects.subscribers.where({
45032
45027
  session: this
45033
45028
  }).forEach(subscriber => {