@opentok/client 2.30.2-alpha.7 → 2.30.2-alpha.9

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.
@@ -168,6 +168,7 @@ declare namespace OT {
168
168
  preferredResolution?: 'auto' | Dimensions;
169
169
  style?: Partial<SubscriberStyle>;
170
170
  subscribeToAudio?: boolean;
171
+ subscribeToCaptions?: boolean;
171
172
  subscribeToVideo?: boolean;
172
173
  testNetwork?: boolean;
173
174
  };
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.30.2 e62a09f34
2
+ * @license OpenTok.js 2.30.2 4246a15
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, 05 Jun 2025 17:53:24 GMT
8
+ * Date: Tue, 10 Jun 2025 16:05:17 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.2","buildHash":"e62a09f34","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.2","buildHash":"4246a15","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',
@@ -37400,6 +37400,7 @@ function SubscriberFactory(_ref2) {
37400
37400
  */
37401
37401
  const Subscriber = function Subscriber(targetElement, options, completionHandler) {
37402
37402
  var _this = this,
37403
+ _properties$subscribe,
37403
37404
  _stream$getChannelsOf;
37404
37405
  if (options === void 0) {
37405
37406
  options = {};
@@ -38276,6 +38277,7 @@ function SubscriberFactory(_ref2) {
38276
38277
  _lastSubscribeToVideoReason = 'loading';
38277
38278
  this.subscribeToVideo(_properties.subscribeToVideo, 'loading');
38278
38279
  }
38280
+ this.subscribeToCaptions(_properties.subscribeToCaptions);
38279
38281
  };
38280
38282
  const setStreamPreferences = (_ref16, sourceStreamId) => {
38281
38283
  let p2pEnabled = _ref16.p2pEnabled;
@@ -40550,9 +40552,9 @@ function SubscriberFactory(_ref2) {
40550
40552
  const video = _stream.getChannelsOfType('video');
40551
40553
  const data = _stream.getChannelsOfType('data');
40552
40554
 
40553
- // We're initalizing the flag here based on the data channel because we won't know the inital state otherwise.
40554
- // The flag can then be mutated by subscribeToCaptions()
40555
- let _isSubscribedToCaptions = data.some(channel => channel.id === 'caption1' && channel.active);
40555
+ // If the user has not specified a value for subscribeToCaptions, we will default to the stream
40556
+ // caption channel active state.
40557
+ _properties.subscribeToCaptions = (_properties$subscribe = _properties.subscribeToCaptions) != null ? _properties$subscribe : data.some(channel => channel.id === 'caption1' && channel.active);
40556
40558
 
40557
40559
  /**
40558
40560
  * Toggles captions on and off. Starts subscribing to captions (if it is available and currently
@@ -40584,7 +40586,7 @@ function SubscriberFactory(_ref2) {
40584
40586
  attributes = {
40585
40587
  active
40586
40588
  };
40587
- _isSubscribedToCaptions = active;
40589
+ _properties.subscribeToCaptions = active;
40588
40590
  logAnalyticsEvent('subscribeToCaptions', 'Attempt', {
40589
40591
  subscribeToCaptions: active
40590
40592
  });
@@ -40613,7 +40615,7 @@ function SubscriberFactory(_ref2) {
40613
40615
  * @method #isSubscribedToCaptions
40614
40616
  * @memberOf Subscriber
40615
40617
  */
40616
- this.isSubscribedToCaptions = () => _isSubscribedToCaptions;
40618
+ this.isSubscribedToCaptions = () => _properties.subscribeToCaptions;
40617
40619
  const channelsToSubscribeTo = audio.map(channel => ({
40618
40620
  id: channel.id,
40619
40621
  type: channel.type,
@@ -43677,6 +43679,9 @@ function SessionFactory(deps) {
43677
43679
  cpuPressureMonitor.on('pressureMonitorEvent', newState => {
43678
43680
  _cpuPerformanceState = newState;
43679
43681
  this.dispatchEvent(new Events.CpuPerformanceChangedEvent(newState));
43682
+ this.logEvent('cpuPerformanceChanged', 'Event', {
43683
+ cpuPerformanceState: newState
43684
+ });
43680
43685
  });
43681
43686
  }
43682
43687