@opentok/client 2.30.0-alpha.12 → 2.30.0-alpha.14

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.0 27b0a4f
2
+ * @license OpenTok.js 2.30.0 e92b0ba
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, 24 Apr 2025 17:50:29 GMT
8
+ * Date: Thu, 01 May 2025 16:34:48 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.0","buildHash":"27b0a4f","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.0","buildHash":"e92b0ba","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',
@@ -17167,10 +17167,6 @@ function WidgetViewFactory(_temp) {
17167
17167
  OTHelpers.css(this._posterContainer, 'backgroundImage', `url(${src})`);
17168
17168
  return this.poster();
17169
17169
  };
17170
- _proto.prepareForStreamTransition = function prepareForStreamTransition() {
17171
- var _this$_videoElementFa;
17172
- (_this$_videoElementFa = this._videoElementFacade) == null ? void 0 : _this$_videoElementFa.prepareForStreamTransition();
17173
- };
17174
17170
  _proto.loading = function loading(isLoading) {
17175
17171
  if (isLoading === undefined) {
17176
17172
  return this._loading;
@@ -25331,11 +25327,7 @@ function NativeVideoElementWrapperFactory(deps) {
25331
25327
  _proto.aspectRatio = function aspectRatio() {
25332
25328
  return this.videoWidth() / this.videoHeight();
25333
25329
  };
25334
- _proto.prepareForStreamTransition = function prepareForStreamTransition() {
25335
- const streamImage = this._getStreamImage();
25336
- this._domElement.poster = streamImage;
25337
- };
25338
- _proto._getStreamImage = function _getStreamImage() {
25330
+ _proto.imgData = function imgData() {
25339
25331
  const canvas = OTHelpers.createElement('canvas', {
25340
25332
  width: this.videoWidth(),
25341
25333
  height: this.videoHeight(),
@@ -25358,10 +25350,7 @@ function NativeVideoElementWrapperFactory(deps) {
25358
25350
  this.logging.warn('Cannot get image data yet');
25359
25351
  return null;
25360
25352
  }
25361
- return imgData;
25362
- };
25363
- _proto.imgData = function imgData() {
25364
- return this._getStreamImage().replace('data:image/png;base64,', '').trim();
25353
+ return imgData.replace('data:image/png;base64,', '').trim();
25365
25354
  }
25366
25355
  // Append the Video DOM element to a parent node
25367
25356
  ;
@@ -36916,7 +36905,6 @@ function SubscriberFactory(_ref2) {
36916
36905
  P2P: _eventNames.default.SUBSCRIBER_DISCONNECTED,
36917
36906
  MANTIS: _eventNames.default.SUBSCRIBER_DISCONNECTED
36918
36907
  };
36919
- let _subscriberConnectionState = _eventNames.default.SUBSCRIBER_DISCONNECTED;
36920
36908
  let _videoMediaProcessorConnector;
36921
36909
  let _originalVideoTrack;
36922
36910
  let _senderStats;
@@ -37032,31 +37020,29 @@ function SubscriberFactory(_ref2) {
37032
37020
  hasVideo: (_stream2 = _stream) == null ? void 0 : _stream2.hasVideo
37033
37021
  }; // We want to catch any error in the prebuffering when transition to P2P.
37034
37022
  // Otherwise, we ignore it.
37035
- throwIfBufferFails = _isAdaptiveEnabled && _activeSourceStreamId === 'P2P'; // To minimize the blip effect during a stream transition, we take a snapshot of the video stream (if available)
37036
- // and display it instead of a blank screen.
37037
- _widgetView.prepareForStreamTransition();
37038
- _context3.prev = 6;
37039
- _context3.next = 9;
37023
+ throwIfBufferFails = _isAdaptiveEnabled && _activeSourceStreamId === 'P2P';
37024
+ _context3.prev = 5;
37025
+ _context3.next = 8;
37040
37026
  return _widgetView.bindVideo(webRTCStream, videoContainerOptions, throwIfBufferFails);
37041
- case 9:
37042
- _context3.next = 17;
37027
+ case 8:
37028
+ _context3.next = 16;
37043
37029
  break;
37044
- case 11:
37045
- _context3.prev = 11;
37046
- _context3.t0 = _context3["catch"](6);
37030
+ case 10:
37031
+ _context3.prev = 10;
37032
+ _context3.t0 = _context3["catch"](5);
37047
37033
  if (!(_context3.t0 instanceof _cancel.CancellationError || _state.isDestroyed())) {
37048
- _context3.next = 15;
37034
+ _context3.next = 14;
37049
37035
  break;
37050
37036
  }
37051
37037
  return _context3.abrupt("return");
37052
- case 15:
37038
+ case 14:
37053
37039
  onVideoError(_context3.t0);
37054
37040
  throw _context3.t0;
37055
- case 17:
37041
+ case 16:
37056
37042
  case "end":
37057
37043
  return _context3.stop();
37058
37044
  }
37059
- }, _callee3, null, [[6, 11]]);
37045
+ }, _callee3, null, [[5, 10]]);
37060
37046
  }));
37061
37047
  return function bindWebRTCStream(_x3) {
37062
37048
  return _ref6.apply(this, arguments);
@@ -37619,8 +37605,12 @@ function SubscriberFactory(_ref2) {
37619
37605
  const hasExpectedTracks = peerConnection => {
37620
37606
  const hasVideoTracks = peerConnection._hasVideoTracks();
37621
37607
  const hasAudioTracks = peerConnection._hasAudioTracks();
37622
- const isMissingVideo = _stream && _stream.hasVideo && !hasVideoTracks;
37623
- const isMissingAudio = _stream && _stream.hasAudio && !hasAudioTracks;
37608
+
37609
+ // If we're not subbing to video/audio, we don't expect those tracks in the PC
37610
+ const shouldHaveVideoTracks = _properties.subscribeToVideo;
37611
+ const shouldHaveAudioTracks = _properties.subscribeToAudio;
37612
+ const isMissingVideo = _stream && _stream.hasVideo && !hasVideoTracks && shouldHaveVideoTracks;
37613
+ const isMissingAudio = _stream && _stream.hasAudio && !hasAudioTracks && shouldHaveAudioTracks;
37624
37614
  return !(isMissingVideo || isMissingAudio);
37625
37615
  };
37626
37616
  const onTrackAdded = /*#__PURE__*/function () {
@@ -38083,7 +38073,7 @@ function SubscriberFactory(_ref2) {
38083
38073
  };
38084
38074
  const notifyStateChange = (state, currentConnectionState, sourceStreamId) => {
38085
38075
  logging.debug(`OT.Subscriber.connectionStateChanged to ${state}`);
38086
- if (_subscriberConnectionState === currentConnectionState || state === 'failed' && !_session._.isSocketConnected()) {
38076
+ if (state === 'failed' && !_session._.isSocketConnected()) {
38087
38077
  return;
38088
38078
  }
38089
38079
 
@@ -38113,7 +38103,6 @@ function SubscriberFactory(_ref2) {
38113
38103
  if (sourceStreamId === _activeSourceStreamId) {
38114
38104
  updateWidgetView(currentConnectionState);
38115
38105
  notifyStateChange(state, currentConnectionState, sourceStreamId);
38116
- _subscriberConnectionState = currentConnectionState;
38117
38106
  }
38118
38107
  };
38119
38108
  const onIceRestartSuccess = () => {
@@ -41938,7 +41927,7 @@ exports.default = _default;
41938
41927
  exports.__esModule = true;
41939
41928
  exports.default = void 0;
41940
41929
  var _default = (mediaStream, oldTrack, newTrack) => {
41941
- if (oldTrack === newTrack) {
41930
+ if (oldTrack === newTrack || !oldTrack || !newTrack) {
41942
41931
  return;
41943
41932
  }
41944
41933
  mediaStream.removeTrack(oldTrack);
@@ -83818,27 +83807,8 @@ function initSessionFactory(deps) {
83818
83807
  * Set this to <code>true</code> if IP white listing is enabled for your project.
83819
83808
  * The default value is <code>false</code>.
83820
83809
  * </li>
83821
- * <li><code>iceConfig</code> &mdash; (Object) This object includes the following properties:
83822
- * <p>
83823
- * <ul>
83824
- * <li>
83825
- * <code>includeServers</code> (String) &mdash; Set this to <code>'custom'</code> and client will use only the custom TURN servers you provide in the <code>customServers</code> array. Set this to <code>'all'</code> (the default) and the client will use both the custom TURN servers you provide along with OpenTok TURN servers.
83826
- * </li>
83827
- * <li>
83828
- * <code>transportPolicy</code> (String) &mdash; Set this to <code>'all'</code> (the default) and the client will use all ICE transport types (such as host, srflx, and TURN) to establish media connectivity. Set this to <code>'relay'</code> to force connectivity through TURN always and ignore all other ICE candidates.
83829
- * </li>
83830
- * <li>
83831
- * <code>customServers</code> (Array) &mdash; Set this to an array of objects defining your custom TURN servers. Each object corresponds to one custom TURN server, and it includes the following properties: <code>urls</code> &mdash; a string or an array of strings, where each string is a URL supported by the TURN server (and this may be only one URL); <code>username</code> &mdash; the username (string) for the TURN server defined in this object; <code>credential</code> &mdash; the credential string for the TURN server defined in this object.
83832
- * </li>
83833
- * </ul>
83834
- * </p>
83835
- * <p>
83836
- * This feature is part of the configurable TURN
83837
- * <a href="https://www.vonage.com/communications-apis/video/pricing/" target="_blank">add-on feature</a>. For more information
83838
- * and a code sample, see the
83839
- * <a href="https://tokbox.com/developer/guides/configurable-turn-servers/">Configurable TURN servers</a>
83840
- * developer guide.
83841
- * </p>
83810
+ * <li><code>iceConfig</code> &mdash; (Object) This feature is part of the configurable TURN
83811
+ * <a href="https://www.vonage.com/communications-apis/video/pricing/" target="_blank">add-on feature</a>.
83842
83812
  * </li>
83843
83813
  * <li><code>encryptionSecret</code> &mdash; (String) This is the initial encryption secret used by the
83844
83814
  * end-to-end encryption feature. See <a href="https://tokbox.com/developer/guides/end-to-end-encryption/">