@opentok/client 2.35.0-alpha.31 → 2.35.0-alpha.32

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.
@@ -624,12 +624,19 @@ declare namespace OT {
624
624
  callback?: (error?: OTError) => void
625
625
  ): Promise<void>;
626
626
 
627
- subscribe(
628
- stream: Stream,
629
- targetElement?: HTMLElement | string,
630
- properties?: SubscriberProperties,
631
- callback?: (error?: OTError) => void
632
- ): Subscriber;
627
+ subscribe: {
628
+ (
629
+ stream: Stream,
630
+ targetElement?: HTMLElement | string,
631
+ properties?: SubscriberProperties,
632
+ callback?: (error?: OTError) => void
633
+ ): Subscriber;
634
+ promise: (
635
+ stream: Stream,
636
+ targetElement?: HTMLElement | string,
637
+ properties?: SubscriberProperties,
638
+ ) => Promise<Subscriber>;
639
+ }
633
640
 
634
641
  unpublish(publisher: Publisher): void;
635
642
  unsubscribe(subscriber: Subscriber): void;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @license OpenTok.js 2.35.0 6edb54f00
2
+ * @license OpenTok.js 2.35.0 2989cd58d
3
3
  *
4
4
  * Copyright (c) 2010-2026 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: Tue, 26 May 2026 06:58:35 GMT
8
+ * Date: Tue, 26 May 2026 07:31:08 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -41919,7 +41919,7 @@ function staticConfigFactory(_temp) {
41919
41919
  _ref$axios = _ref.axios,
41920
41920
  axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
41921
41921
  _ref$properties = _ref.properties,
41922
- properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"6edb54f00","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","vonageApiURL":""} : _ref$properties;
41922
+ properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"2989cd58d","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","vonageApiURL":""} : _ref$properties;
41923
41923
  /** @type builtInConfig */
41924
41924
  const builtInConfig = (0, _cloneDeep.default)(properties);
41925
41925
  /**
@@ -71541,6 +71541,28 @@ function SessionFactory(deps) {
71541
71541
  return subscriber;
71542
71542
  };
71543
71543
 
71544
+ /**
71545
+ * Promisified version of {@link Session#subscribe}.
71546
+ * Instead of passing a completion handler, await the returned Promise, which resolves
71547
+ * with the Subscriber object on success.
71548
+ *
71549
+ * @example
71550
+ * // Subscribe to a stream with a target element and properties:
71551
+ * const subscriber = await session.subscribe.promise(stream, 'subscriberElementId', { insertMode: 'append' });
71552
+ *
71553
+ * // Subscribe with only a stream (optional params can be omitted):
71554
+ * const subscriber = await session.subscribe.promise(stream);
71555
+ */
71556
+ this.subscribe.promise = (stream, targetElement, properties) => new Promise((resolve, reject) => {
71557
+ this.subscribe(stream, targetElement, properties, (err, sub) => {
71558
+ if (err) {
71559
+ reject(err);
71560
+ } else {
71561
+ resolve(sub);
71562
+ }
71563
+ });
71564
+ });
71565
+
71544
71566
  /**
71545
71567
  * Stops subscribing to a stream in the session. the display of the audio-video stream is
71546
71568
  * removed from the local web page.