@opentok/client 2.30.3-alpha.11 → 2.30.3-alpha.12

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.3 86f91ca
2
+ * @license OpenTok.js 2.30.3 fa52308
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, 02 Jul 2025 18:28:38 GMT
8
+ * Date: Thu, 03 Jul 2025 22:37:07 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -8679,7 +8679,7 @@ const logging = (0, _log.default)('StaticConfig');
8679
8679
  */
8680
8680
 
8681
8681
  /** @type builtInConfig */
8682
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.3","buildHash":"86f91ca","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"});
8682
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.3","buildHash":"fa52308","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"});
8683
8683
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
8684
8684
  const liveConfigMap = {
8685
8685
  apiUrl: 'apiURL',
@@ -16859,7 +16859,7 @@ function WidgetViewFactory(_temp) {
16859
16859
  _context.prev = 15;
16860
16860
  _context.t0 = _context["catch"](5);
16861
16861
  // We are not interested in the error.
16862
- if (env.isChromium) {
16862
+ if (env.isChromium && stream.getVideoTracks().length) {
16863
16863
  // For Chromium browsers, we need to enable the video track before playing it to ensure we
16864
16864
  // do not see a black screen during an AMR transition. See VIDCS-3570 for more details.
16865
16865
  // eslint-disable-next-line no-param-reassign
@@ -17106,36 +17106,27 @@ function WidgetViewFactory(_temp) {
17106
17106
  });
17107
17107
  hasExistingElement = !!this._videoElementFacade;
17108
17108
  cancellation = this._getNewBindCancellation();
17109
- if (hasExistingElement) {
17110
- _context5.next = 10;
17111
- break;
17112
- }
17113
- this._createVideoElementFacade({
17114
- _inject,
17115
- audioVolume,
17116
- fallbackText,
17117
- muted
17118
- });
17119
- this._videoFacadeEvents.on('mediaElementEvent', action => {
17120
- this.trigger('mediaElementEvent', action);
17121
- });
17122
- _context5.next = 14;
17123
- break;
17124
- case 10:
17125
- if (!(webRTCStream instanceof MediaStream)) {
17126
- _context5.next = 14;
17127
- break;
17109
+ if (!hasExistingElement) {
17110
+ this._createVideoElementFacade({
17111
+ _inject,
17112
+ audioVolume,
17113
+ fallbackText,
17114
+ muted
17115
+ });
17116
+ this._videoFacadeEvents.on('mediaElementEvent', action => {
17117
+ this.trigger('mediaElementEvent', action);
17118
+ });
17128
17119
  }
17129
- if (!hasVideo) {
17130
- _context5.next = 14;
17120
+ if (!(webRTCStream instanceof MediaStream && hasVideo && isSubscribingToVideo)) {
17121
+ _context5.next = 9;
17131
17122
  break;
17132
17123
  }
17133
- _context5.next = 14;
17124
+ _context5.next = 9;
17134
17125
  return this._tryToLoadVideoBuffer(webRTCStream, cancellation, throwIfBufferFails, hasVideo && isSubscribingToVideo);
17135
- case 14:
17136
- _context5.next = 16;
17126
+ case 9:
17127
+ _context5.next = 11;
17137
17128
  return this._bindToStream(webRTCStream, cancellation);
17138
- case 16:
17129
+ case 11:
17139
17130
  if (!hasExistingElement) {
17140
17131
  this._triggerVideoElementCreated();
17141
17132
  }
@@ -17144,16 +17135,16 @@ function WidgetViewFactory(_temp) {
17144
17135
  defaultVideoElementFacade: this._videoElementFacade,
17145
17136
  maxWaitTime: 5000
17146
17137
  });
17147
- _context5.next = 21;
17138
+ _context5.next = 16;
17148
17139
  return this._waitForVideoResolution(webRTCStream);
17149
- case 21:
17140
+ case 16:
17150
17141
  logging.debug('Waiting for video to be playing');
17151
- _context5.next = 24;
17142
+ _context5.next = 19;
17152
17143
  return whenVideoPlaying;
17153
- case 24:
17144
+ case 19:
17154
17145
  logging.debug('Video is playing');
17155
17146
  throwIfBindCancelled(cancellation);
17156
- case 26:
17147
+ case 21:
17157
17148
  case "end":
17158
17149
  return _context5.stop();
17159
17150
  }
@@ -37604,24 +37595,25 @@ function SubscriberFactory(_ref2) {
37604
37595
  _context3.next = 9;
37605
37596
  return _widgetView.bindVideo(webRTCStream, videoContainerOptions, throwIfBufferFails);
37606
37597
  case 9:
37607
- _context3.next = 17;
37598
+ _widgetView.loading(false);
37599
+ _context3.next = 18;
37608
37600
  break;
37609
- case 11:
37610
- _context3.prev = 11;
37601
+ case 12:
37602
+ _context3.prev = 12;
37611
37603
  _context3.t0 = _context3["catch"](6);
37612
37604
  if (!(_context3.t0 instanceof _cancel.CancellationError || _state.isDestroyed())) {
37613
- _context3.next = 15;
37605
+ _context3.next = 16;
37614
37606
  break;
37615
37607
  }
37616
37608
  return _context3.abrupt("return");
37617
- case 15:
37609
+ case 16:
37618
37610
  onVideoError(_context3.t0);
37619
37611
  throw _context3.t0;
37620
- case 17:
37612
+ case 18:
37621
37613
  case "end":
37622
37614
  return _context3.stop();
37623
37615
  }
37624
- }, _callee3, null, [[6, 11]]);
37616
+ }, _callee3, null, [[6, 12]]);
37625
37617
  }));
37626
37618
  return function bindWebRTCStream(_x3) {
37627
37619
  return _ref6.apply(this, arguments);
@@ -37959,7 +37951,6 @@ function SubscriberFactory(_ref2) {
37959
37951
  logging.debug('OT.Subscriber.onLoaded');
37960
37952
  _state.set('Subscribing');
37961
37953
  _subscribeStartTime = (0, _now.default)();
37962
- _widgetView.loading(false);
37963
37954
  if (_chrome) {
37964
37955
  _chrome.showAfterLoading();
37965
37956
  }
@@ -38649,7 +38640,8 @@ function SubscriberFactory(_ref2) {
38649
38640
  }
38650
38641
  };
38651
38642
  const updateWidgetView = currentConnectionState => {
38652
- if (_widgetView) {
38643
+ // We check that the subscriber has loaded so we do not prematurely hide the loading spinner and show a flickering video.
38644
+ if (_widgetView && _loaded) {
38653
38645
  _widgetView.loading(currentConnectionState !== _eventNames.default.SUBSCRIBER_CONNECTED);
38654
38646
  }
38655
38647
  };