@opentok/client 2.29.4-alpha.4 → 2.29.4-alpha.6

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.29.4 9411431
2
+ * @license OpenTok.js 2.29.4 abc11f8
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, 30 Apr 2025 21:12:20 GMT
8
+ * Date: Tue, 06 May 2025 19:44:43 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.29.4","buildHash":"9411431","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.29.4","buildHash":"abc11f8","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',
@@ -37263,12 +37263,13 @@ function SubscriberFactory(_ref2) {
37263
37263
  logging.error('Completion handler threw an exception', err);
37264
37264
  }
37265
37265
  });
37266
- _session.on('captionReceived', event => {
37266
+ const onCaptionReceived = event => {
37267
37267
  if (event.streamId === _subscriber.streamId) {
37268
37268
  this.dispatchEvent(event);
37269
37269
  this.trigger(_eventNames.default.SUBSCRIBER_CAPTION_RECEIVED, event);
37270
37270
  }
37271
- });
37271
+ };
37272
+ _session.on('captionReceived', onCaptionReceived);
37272
37273
  const getVariationFromState = _ref8 => {
37273
37274
  let transition = _ref8.transition,
37274
37275
  from = _ref8.from;
@@ -37619,8 +37620,12 @@ function SubscriberFactory(_ref2) {
37619
37620
  const hasExpectedTracks = peerConnection => {
37620
37621
  const hasVideoTracks = peerConnection._hasVideoTracks();
37621
37622
  const hasAudioTracks = peerConnection._hasAudioTracks();
37622
- const isMissingVideo = _stream && _stream.hasVideo && !hasVideoTracks;
37623
- const isMissingAudio = _stream && _stream.hasAudio && !hasAudioTracks;
37623
+
37624
+ // If we're not subbing to video/audio, we don't expect those tracks in the PC
37625
+ const shouldHaveVideoTracks = _properties.subscribeToVideo;
37626
+ const shouldHaveAudioTracks = _properties.subscribeToAudio;
37627
+ const isMissingVideo = _stream && _stream.hasVideo && !hasVideoTracks && shouldHaveVideoTracks;
37628
+ const isMissingAudio = _stream && _stream.hasAudio && !hasAudioTracks && shouldHaveAudioTracks;
37624
37629
  return !(isMissingVideo || isMissingAudio);
37625
37630
  };
37626
37631
  const onTrackAdded = /*#__PURE__*/function () {
@@ -38617,6 +38622,7 @@ function SubscriberFactory(_ref2) {
38617
38622
  _chrome.destroy();
38618
38623
  _chrome = null;
38619
38624
  }
38625
+ _session.off('captionReceived', onCaptionReceived);
38620
38626
  if (_widgetView) {
38621
38627
  _widgetView.destroy();
38622
38628
  _widgetView.off();
@@ -41938,7 +41944,7 @@ exports.default = _default;
41938
41944
  exports.__esModule = true;
41939
41945
  exports.default = void 0;
41940
41946
  var _default = (mediaStream, oldTrack, newTrack) => {
41941
- if (oldTrack === newTrack) {
41947
+ if (oldTrack === newTrack || !oldTrack || !newTrack) {
41942
41948
  return;
41943
41949
  }
41944
41950
  mediaStream.removeTrack(oldTrack);