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

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 fa52308
2
+ * @license OpenTok.js 2.30.3 8bcab47
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: Thu, 03 Jul 2025 22:37:07 GMT
8
+ * Date: Mon, 07 Jul 2025 14:50:30 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":"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"});
8682
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.30.3","buildHash":"8bcab47","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 && stream.getVideoTracks().length) {
16862
+ if (env.isChromium) {
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,27 +17106,36 @@ function WidgetViewFactory(_temp) {
17106
17106
  });
17107
17107
  hasExistingElement = !!this._videoElementFacade;
17108
17108
  cancellation = this._getNewBindCancellation();
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
- });
17109
+ if (hasExistingElement) {
17110
+ _context5.next = 10;
17111
+ break;
17119
17112
  }
17120
- if (!(webRTCStream instanceof MediaStream && hasVideo && isSubscribingToVideo)) {
17121
- _context5.next = 9;
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;
17122
17127
  break;
17123
17128
  }
17124
- _context5.next = 9;
17129
+ if (!hasVideo) {
17130
+ _context5.next = 14;
17131
+ break;
17132
+ }
17133
+ _context5.next = 14;
17125
17134
  return this._tryToLoadVideoBuffer(webRTCStream, cancellation, throwIfBufferFails, hasVideo && isSubscribingToVideo);
17126
- case 9:
17127
- _context5.next = 11;
17135
+ case 14:
17136
+ _context5.next = 16;
17128
17137
  return this._bindToStream(webRTCStream, cancellation);
17129
- case 11:
17138
+ case 16:
17130
17139
  if (!hasExistingElement) {
17131
17140
  this._triggerVideoElementCreated();
17132
17141
  }
@@ -17135,16 +17144,16 @@ function WidgetViewFactory(_temp) {
17135
17144
  defaultVideoElementFacade: this._videoElementFacade,
17136
17145
  maxWaitTime: 5000
17137
17146
  });
17138
- _context5.next = 16;
17147
+ _context5.next = 21;
17139
17148
  return this._waitForVideoResolution(webRTCStream);
17140
- case 16:
17149
+ case 21:
17141
17150
  logging.debug('Waiting for video to be playing');
17142
- _context5.next = 19;
17151
+ _context5.next = 24;
17143
17152
  return whenVideoPlaying;
17144
- case 19:
17153
+ case 24:
17145
17154
  logging.debug('Video is playing');
17146
17155
  throwIfBindCancelled(cancellation);
17147
- case 21:
17156
+ case 26:
17148
17157
  case "end":
17149
17158
  return _context5.stop();
17150
17159
  }
@@ -25713,10 +25722,19 @@ function NativeVideoElementWrapperFactory(deps) {
25713
25722
  return this.videoWidth() / this.videoHeight();
25714
25723
  };
25715
25724
  _proto.prepareForStreamTransition = function prepareForStreamTransition() {
25716
- const streamImage = this._getStreamImage();
25717
- this._domElement.poster = streamImage;
25725
+ const streamImage = this._getStreamImage({
25726
+ silenceWarning: true
25727
+ });
25728
+ if (streamImage) {
25729
+ this._domElement.poster = streamImage;
25730
+ }
25718
25731
  };
25719
- _proto._getStreamImage = function _getStreamImage() {
25732
+ _proto._getStreamImage = function _getStreamImage(options) {
25733
+ if (options === void 0) {
25734
+ options = {};
25735
+ }
25736
+ const _options = options,
25737
+ silenceWarning = _options.silenceWarning;
25720
25738
  const canvas = OTHelpers.createElement('canvas', {
25721
25739
  width: this.videoWidth(),
25722
25740
  height: this.videoHeight(),
@@ -25736,13 +25754,15 @@ function NativeVideoElementWrapperFactory(deps) {
25736
25754
  if (imgData === null || imgData === 'data:,') {
25737
25755
  // 'data:,' is sometimes returned by canvas.toDataURL when one cannot be
25738
25756
  // generated.
25739
- this.logging.warn('Cannot get image data yet');
25757
+ const logging = silenceWarning ? this.logging.debug : this.logging.warn;
25758
+ logging('Cannot get image data yet');
25740
25759
  return null;
25741
25760
  }
25742
25761
  return imgData;
25743
25762
  };
25744
25763
  _proto.imgData = function imgData() {
25745
- return this._getStreamImage().replace('data:image/png;base64,', '').trim();
25764
+ var _this$_getStreamImage, _this$_getStreamImage2;
25765
+ return (_this$_getStreamImage = (_this$_getStreamImage2 = this._getStreamImage()) == null ? void 0 : _this$_getStreamImage2.replace('data:image/png;base64,', '').trim()) != null ? _this$_getStreamImage : null;
25746
25766
  }
25747
25767
  // Append the Video DOM element to a parent node
25748
25768
  ;
@@ -37595,25 +37615,24 @@ function SubscriberFactory(_ref2) {
37595
37615
  _context3.next = 9;
37596
37616
  return _widgetView.bindVideo(webRTCStream, videoContainerOptions, throwIfBufferFails);
37597
37617
  case 9:
37598
- _widgetView.loading(false);
37599
- _context3.next = 18;
37618
+ _context3.next = 17;
37600
37619
  break;
37601
- case 12:
37602
- _context3.prev = 12;
37620
+ case 11:
37621
+ _context3.prev = 11;
37603
37622
  _context3.t0 = _context3["catch"](6);
37604
37623
  if (!(_context3.t0 instanceof _cancel.CancellationError || _state.isDestroyed())) {
37605
- _context3.next = 16;
37624
+ _context3.next = 15;
37606
37625
  break;
37607
37626
  }
37608
37627
  return _context3.abrupt("return");
37609
- case 16:
37628
+ case 15:
37610
37629
  onVideoError(_context3.t0);
37611
37630
  throw _context3.t0;
37612
- case 18:
37631
+ case 17:
37613
37632
  case "end":
37614
37633
  return _context3.stop();
37615
37634
  }
37616
- }, _callee3, null, [[6, 12]]);
37635
+ }, _callee3, null, [[6, 11]]);
37617
37636
  }));
37618
37637
  return function bindWebRTCStream(_x3) {
37619
37638
  return _ref6.apply(this, arguments);
@@ -37951,6 +37970,7 @@ function SubscriberFactory(_ref2) {
37951
37970
  logging.debug('OT.Subscriber.onLoaded');
37952
37971
  _state.set('Subscribing');
37953
37972
  _subscribeStartTime = (0, _now.default)();
37973
+ _widgetView.loading(false);
37954
37974
  if (_chrome) {
37955
37975
  _chrome.showAfterLoading();
37956
37976
  }
@@ -38640,8 +38660,7 @@ function SubscriberFactory(_ref2) {
38640
38660
  }
38641
38661
  };
38642
38662
  const updateWidgetView = currentConnectionState => {
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) {
38663
+ if (_widgetView) {
38645
38664
  _widgetView.loading(currentConnectionState !== _eventNames.default.SUBSCRIBER_CONNECTED);
38646
38665
  }
38647
38666
  };