@opentok/client 2.28.5 → 2.29.0-alpha.2

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.28.5 383b0af
2
+ * @license OpenTok.js 2.29.0 1f996f6
3
3
  *
4
4
  * Copyright (c) 2010-2024 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: Fri, 29 Nov 2024 16:39:33 GMT
8
+ * Date: Fri, 06 Dec 2024 17:49:18 GMT
9
9
  */
10
10
 
11
11
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -3738,32 +3738,43 @@ function EventsFactory(deps) {
3738
3738
  };
3739
3739
 
3740
3740
  /**
3741
- * The Session object dispatches a cpuPerformanceChanged event when the CPU performance state has been changed
3742
- * The event will only be dispatched on Chromium browsers (Chrome 125+, Edge 125+, and Opera 111+).
3743
- * Events will not be dispatched after disconnecting from a Session, but will resume after reconnecting.
3744
- * This is a <b>beta</b> feature.
3741
+ * The Session object dispatches a <code>cpuPerformanceChanged</code> event
3742
+ * when the CPU performance state changes.
3743
+ * The event is only dispatched on Chromium browsers (Chrome 125+, Edge 125+, and Opera 111+).
3744
+ * Events are not dispatched after disconnecting from a session, but they resume after reconnecting.
3745
3745
  *
3746
- * @property {cpuPerformanceState} cpuPerformanceState The new cpuPerformanceState. The cpuPerformanceState can
3747
- * be one the following: "nominal", "fair", "serious", or "critical";
3746
+ * @property {String} cpuPerformanceState The new CPU performance state. The CPU performance state can
3747
+ * be one the following: "nominal", "fair", "serious", or "critical".
3748
+ * (See <a href="https://w3c.github.io/compute-pressure/#pressure-states">this W3C specification</a>.)
3748
3749
  *
3750
+ * @see <a href="Session.html#event:cpuPerformanceChanged">Session cpuPerformanceChanged event</a>
3751
+ * @class CpuPerformanceChangedEvent
3752
+ * @augments Event
3749
3753
  */
3750
- Events.CpuPerformanceChanged = function CpuPerformanceChanged(cpuPerformanceState) {
3754
+ Events.CpuPerformanceChangedEvent = function CpuPerformanceChangedEvent(cpuPerformanceState) {
3751
3755
  return new _Event4.default('cpuPerformanceChanged', false, {
3752
3756
  cpuPerformanceState
3753
3757
  });
3754
3758
  };
3755
3759
 
3756
3760
  /**
3757
- * The Subscriber object dispatches a qualityScoreChanged event when either the audio or video quality
3758
- * score has changed. The scores are a heuristic value representing the expected subscriber experience. The values
3759
- * range from 5 to 1, with the integer values corresponding to Excellent | Good | Fair | Poor | Bad.
3760
- * This is a <b>beta</b> feature.
3761
+ * The Subscriber object dispatches a <code>qualityScoreChanged</code>
3762
+ * event when either the audio or video quality score changes for the subscriber.
3763
+ * The scores are a heuristic value representing the expected subscriber experience.
3764
+ * The values are integers ranging from 1 to 5, with the values corresponding to
3765
+ * bad, poor, fair, good, and excellent.
3766
+ *
3767
+ * @class QualityScoreChangedEvent
3768
+ * @augments Event
3769
+ * @see <a href="Subscriber.html#event:qualityScoreChanged">Subscriber qualityScoreChanged event</a>
3761
3770
  *
3762
- * @property {QualityScore} qualityScore most recent quality score. The event contains
3763
- * a qualityScore object with optional audio and video properties.
3771
+ * @property {Object} qualityScore The current quality score for the subscriber.
3772
+ * The event contains two properties: <code>audioQualityScore</code>
3773
+ * and <code>videoQualityScore</code>. These properties are undefined if there
3774
+ * is either no audio or no video.
3764
3775
  *
3765
3776
  */
3766
- Events.QualityScoreChanged = function qualityScoreChanged(qualityScore) {
3777
+ Events.QualityScoreChangedEvent = function qualityScoreChanged(qualityScore) {
3767
3778
  return new _Event4.default('qualityScoreChanged', false, {
3768
3779
  qualityScore
3769
3780
  });
@@ -3798,7 +3809,6 @@ function EventsFactory(deps) {
3798
3809
  };
3799
3810
 
3800
3811
  /**
3801
- * This is a <b>beta</b> feature.
3802
3812
  * Defines an event object for the <code>mediaStreamAvailable</code> event dispatched by both
3803
3813
  * the Publisher and Subscriber objects. The Publisher and Subscriber objects both dispatch a <code>mediaStreamAvailable</code>
3804
3814
  * event when the MediaStream is available to be used in custom video elements. The Publisher and Subscriber objects should still be used to
@@ -3812,9 +3822,10 @@ function EventsFactory(deps) {
3812
3822
  * event</a>
3813
3823
  * @see <a href="Subscriber.html#event:mediaStreamAvailable">Subscriber mediaStreamAvailable
3814
3824
  * event</a>
3825
+ * @class MediaStreamAvailableEvent
3815
3826
  * @augments Event
3816
3827
  */
3817
- Events.MediaStreamAvailable = function MediaStreamAvailable(mediaStream) {
3828
+ Events.MediaStreamAvailableEvent = function MediaStreamAvailableEvent(mediaStream) {
3818
3829
  return new _Event4.default('mediaStreamAvailable', false, {
3819
3830
  mediaStream
3820
3831
  });
@@ -3896,9 +3907,7 @@ function EventsFactory(deps) {
3896
3907
  * setting the <code>videoDisabledDisplayMode</code> property, or you can set the
3897
3908
  * <code>videoDisabledDisplayMode</code> property when
3898
3909
  * calling the <code>OT.initPublisher()</code> method and setting the <code>style</code> property
3899
- * of the <code>properties</code> parameter.
3900
- * <p>
3901
- * This is a beta feature.</li>
3910
+ * of the <code>properties</code> parameter.</li>
3902
3911
  * </ul>
3903
3912
  * </li>
3904
3913
  *
@@ -3954,16 +3963,18 @@ function EventsFactory(deps) {
3954
3963
  };
3955
3964
 
3956
3965
  /**
3957
- * Dispatched when the audio input device is changed. This is a <b>beta</b> feature.
3966
+ * Dispatched when the audio input device is changed.
3958
3967
  *
3959
- * @property {Object} device The audio input device. Contains a deviceId and label.
3968
+ * <p> For more information, see <a href="https://tokbox.com/developer/guides/audio-video/js/#audioInputDeviceChanged">this documentation</a>.
3969
+ * @property {Object} device The audio input device.
3970
+ * This object has a <code>deviceId</code> property and a <code>label</code> property (both strings).
3960
3971
  *
3961
3972
  * @see <a href="Publisher.html#event:audioInputDeviceChanged">Publisher audioInputDeviceChanged event</a></p>
3962
3973
  * @see <a href="Publisher.html#setAudioSource">Publisher.setAudioSource()</a></p>
3963
- * @class AudioInputDeviceChanged
3974
+ * @class AudioInputDeviceChangedEvent
3964
3975
  * @augments Event
3965
3976
  */
3966
- Events.AudioInputDeviceChanged = function AudioInputDeviceChanged(device) {
3977
+ Events.AudioInputDeviceChangedEvent = function AudioInputDeviceChangedEvent(device) {
3967
3978
  return new _Event4.default(_eventNames.default.AUDIO_INPUT_DEVICE_CHANGED, false, {
3968
3979
  device
3969
3980
  });
@@ -8107,7 +8118,7 @@ const logging = (0, _log.default)('StaticConfig');
8107
8118
  */
8108
8119
 
8109
8120
  /** @type builtInConfig */
8110
- const builtInConfig = (0, _cloneDeep.default)({"version":"v2.28.5","buildHash":"383b0af","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"});
8121
+ const builtInConfig = (0, _cloneDeep.default)({"version":"v2.29.0","buildHash":"1f996f6","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"});
8111
8122
  const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
8112
8123
  const liveConfigMap = {
8113
8124
  apiUrl: 'apiURL',
@@ -18690,7 +18701,7 @@ function PublisherFactory(_ref) {
18690
18701
  }
18691
18702
  });
18692
18703
  widgetView.on('videoElementCreated', element => {
18693
- this.dispatchEvent(new Events.MediaStreamAvailable(webRTCStream));
18704
+ this.dispatchEvent(new Events.MediaStreamAvailableEvent(webRTCStream));
18694
18705
  const event = new Events.VideoElementCreatedEvent(element);
18695
18706
  this.dispatchEvent(event);
18696
18707
  });
@@ -19435,7 +19446,7 @@ function PublisherFactory(_ref) {
19435
19446
  * @param {function} callback (Optional) A function that takes in an <code><a href="Error.html">Error</a></code>
19436
19447
  * parameter. Upon successful completion of the method, this <code>error</code> parameter is undefined.
19437
19448
  * An error results if the publisher has no devices to provide the media stream or if the user media
19438
- * request is not supported. <i>Note:</i> this is a beta feature.
19449
+ * request is not supported.
19439
19450
  *
19440
19451
  * @see <a href="OT.html#initPublisher">OT.initPublisher()</a>
19441
19452
  * @see <a href="Stream.html#hasVideo">Stream.hasVideo</a>
@@ -22467,7 +22478,6 @@ function PublisherFactory(_ref) {
22467
22478
  * app from having access to the camera and microphone.
22468
22479
  * <p>
22469
22480
  * This event is also dispatched if the user removes the permissions after previously granting them.
22470
- * This is a beta feature.
22471
22481
  * <p>
22472
22482
  * <i>Note:</i> On macOS 10.15+ (Catalina), to publish a screen-sharing stream
22473
22483
  * the user must grant the browser access to the screen in macOS System Preferences &gt;
@@ -22490,7 +22500,6 @@ function PublisherFactory(_ref) {
22490
22500
  */
22491
22501
 
22492
22502
  /**
22493
- * This is a <b>beta</b> feature.
22494
22503
  * Dispatched when the MediaStream is available.
22495
22504
  * @see Event
22496
22505
  * @name mediaStreamAvailable
@@ -22510,11 +22519,8 @@ function PublisherFactory(_ref) {
22510
22519
  /**
22511
22520
  * Dispatched when the audio input device is changed.
22512
22521
  *
22513
- * <p>
22514
- * This is a beta feature.
22515
- *
22516
22522
  * @see Event
22517
- * @see AudioInputDeviceChanged
22523
+ * @see AudioInputDeviceChangedEvent
22518
22524
  * @name audioInputDeviceChanged
22519
22525
  * @event
22520
22526
  * @memberof Publisher
@@ -22622,8 +22628,6 @@ function PublisherFactory(_ref) {
22622
22628
  * <a href="OT.html#initPublisher">OT.initPublisher()</a>.)</li>
22623
22629
  *
22624
22630
  * </ul>
22625
- * <p>
22626
- * This is a beta feature.
22627
22631
  *
22628
22632
  * @see Event
22629
22633
  * @see <a href="Publisher.html#event:videoDisableWarning">videoDisableWarning</a> event
@@ -22645,8 +22649,6 @@ function PublisherFactory(_ref) {
22645
22649
  * <code>videoDisabledDisplayMode</code> property when calling the
22646
22650
  * <code>OT.initPublisher()</code> method and setting the <code>style</code> property
22647
22651
  * of the <code>properties</code> parameter.
22648
- * <p>
22649
- * This is a beta feature.
22650
22652
  *
22651
22653
  * @see Event
22652
22654
  * @see <a href="Publisher.html#event:videoDisabled">videoDisabled</a> event
@@ -22660,8 +22662,6 @@ function PublisherFactory(_ref) {
22660
22662
  * Dispatched when the Publisher determines that the stream quality has improved
22661
22663
  * to the point at which the video being disabled is not an immediate risk. This event is
22662
22664
  * dispatched after the Publisher object dispatches a <code>videoDisableWarning</code> event.
22663
- * <p>
22664
- * This is a beta feature.
22665
22665
  *
22666
22666
  * @see Event
22667
22667
  * @see <a href="Publisher.html#event:videoDisableWarning">videoDisableWarning</a> event
@@ -22696,9 +22696,6 @@ function PublisherFactory(_ref) {
22696
22696
  * Dispatched when the Publisher resumes sending video to the publisher
22697
22697
  * after video was previously disabled.
22698
22698
  *
22699
- * <p>
22700
- * This is a beta feature.
22701
- *
22702
22699
  * @see Event
22703
22700
  * @see <a href="Publisher.html#event:videoDisabled">videoDisabled</a> event
22704
22701
  * @name videoEnabled
@@ -34640,7 +34637,7 @@ function SubscriberFactory(_ref2) {
34640
34637
  _session2 = _session, sessionInfo = _session2.sessionInfo;
34641
34638
  if (!_exposedWebRTCStream) {
34642
34639
  _exposedWebRTCStream = new MediaStream(webRTCStream);
34643
- _this.dispatchEvent(new Events.MediaStreamAvailable(_exposedWebRTCStream));
34640
+ _this.dispatchEvent(new Events.MediaStreamAvailableEvent(_exposedWebRTCStream));
34644
34641
  }
34645
34642
  _webRTCStream = webRTCStream;
34646
34643
 
@@ -37419,7 +37416,6 @@ function SubscriberFactory(_ref2) {
37419
37416
  */
37420
37417
 
37421
37418
  /**
37422
- * This is a <b>beta</b> feature.
37423
37419
  * Dispatched when the MediaStream is available.
37424
37420
  * @see Event
37425
37421
  * @name mediaStreamAvailable
@@ -37571,11 +37567,11 @@ function SubscriberFactory(_ref2) {
37571
37567
  * Dispatched when either the audio or video quality
37572
37568
  * score has changed. The scores are a heuristic value representing the expected subscriber experience. The values
37573
37569
  * range from 5 to 1, with the integer values corresponding to Excellent | Good | Fair | Poor | Bad.
37574
- * This is a <b>beta</b> feature.
37575
- * @name qualityScoreChanged
37570
+ *
37571
+ * @name qualityScoreChanged
37576
37572
  * @event
37577
37573
  * @memberof Subscriber
37578
- * @see qualityScoreChangedEvent
37574
+ * @see QualityScoreChangedEvent
37579
37575
  */
37580
37576
  return this;
37581
37577
  };
@@ -63534,8 +63530,6 @@ function initPublisherFactory(deps) {
63534
63530
  * <a href="Publisher.html#event:videoDisableWarning">videoDisableWarning</a>,
63535
63531
  * <a href="Publisher.html#event:videoDisableWarningLifted">videoDisableWarningLifted</a>, and
63536
63532
  * <a href="Publisher.html#event:videoEnabled">videoEnabled</a> events.
63537
- * <p>
63538
- * This is a beta feature.
63539
63533
  * </li>
63540
63534
  *
63541
63535
  * <li><code>subscriber</code> (Boolean) &mdash; Whether the stream will use the
@@ -63955,8 +63949,6 @@ function initPublisherFactory(deps) {
63955
63949
  * displayed video is disabled or at risk of being disabled due to poor stream quality),
63956
63950
  * <code>"off"</code> (do not display the icons), and <code>"on"</code> (display the
63957
63951
  * icons). The default setting is <code>"auto"</code>.
63958
- * <p>
63959
- * This is a beta feature.
63960
63952
  * </li>
63961
63953
  * </ul>
63962
63954
  * </li>
@@ -64422,7 +64414,7 @@ function SessionFactory(deps) {
64422
64414
  cpuPressureMonitor.initMonitoring(PressureObserver);
64423
64415
  cpuPressureMonitor.startMonitoring();
64424
64416
  cpuPressureMonitor.on('pressureMonitorEvent', newState => {
64425
- this.dispatchEvent(new Events.CpuPerformanceChanged(newState));
64417
+ this.dispatchEvent(new Events.CpuPerformanceChangedEvent(newState));
64426
64418
  });
64427
64419
  }
64428
64420
 
@@ -67263,6 +67255,16 @@ function SessionFactory(deps) {
67263
67255
  * of streams in a session</a>
67264
67256
  */
67265
67257
 
67258
+ /**
67259
+ * The CPU performance state has changed. This can be set to
67260
+ * one the following: "nominal", "fair", "serious", or "critical".
67261
+ *
67262
+ * @name cpuPerformanceChanged
67263
+ * @event
67264
+ * @memberof Session
67265
+ * @see CpuPerformanceChangedEvent
67266
+ */
67267
+
67266
67268
  /**
67267
67269
  * The client has connected to a Vonage Video API session. This event is dispatched asynchronously
67268
67270
  * in response to a successful call to the <code>connect()</code> method of a Session
@@ -67280,7 +67282,7 @@ function SessionFactory(deps) {
67280
67282
  /**
67281
67283
  * The client has disconnected from the session. This event may be dispatched asynchronously
67282
67284
  * in response to a successful call to the <code>disconnect()</code> method of the Session object.
67283
- * The event may also be dispatched if a session connection is lost inadvertantly, as in the case
67285
+ * The event may also be dispatched if a session connection is lost inadvertently, as in the case
67284
67286
  * of a lost network connection.
67285
67287
  * <p>
67286
67288
  * The default behavior is that all Subscriber objects are unsubscribed and removed from the
@@ -67429,7 +67431,7 @@ function SessionFactory(deps) {
67429
67431
  * console.log("Signal data: " + event.data);
67430
67432
  * });
67431
67433
  * </pre>
67432
- * <p>You can register for signals of a specfied type by adding an event handler for the
67434
+ * <p>You can register for signals of a specified type by adding an event handler for the
67433
67435
  * <code>signal:type</code> event (replacing <code>type</code> with the actual type string
67434
67436
  * to filter on).
67435
67437
  *
@@ -67453,7 +67455,7 @@ function SessionFactory(deps) {
67453
67455
  * </li>
67454
67456
  * </ul>
67455
67457
  * <p>
67456
- * You can register for signals of a specfied type by adding an event handler for the
67458
+ * You can register for signals of a specified type by adding an event handler for the
67457
67459
  * <code>signal:type</code> event (replacing <code>type</code> with the actual type string
67458
67460
  * to filter on). For example, the following code adds an event handler for signals of
67459
67461
  * type "foo":
@@ -69714,12 +69716,13 @@ OT.ArchiveEvent = Events.ArchiveEvent;
69714
69716
  OT.ArchiveUpdatedEvent = Events.ArchiveUpdatedEvent;
69715
69717
  OT.AudioLevelTransformer = _audio_level_transformer.default;
69716
69718
  OT.AudioLevelUpdatedEvent = Events.AudioLevelUpdatedEvent;
69717
- OT.AudioInputDeviceChanged = Events.AudioInputDeviceChanged;
69719
+ OT.AudioInputDeviceChangedEvent = Events.AudioInputDeviceChangedEvent;
69718
69720
  OT.Capabilities = _capabilities.default;
69719
69721
  OT.Chrome = _chrome.default;
69720
69722
  OT.Connection = _connection.default;
69721
69723
  OT.ConnectionCapabilities = OT.Connection.Capabilities;
69722
69724
  OT.ConnectionEvent = Events.ConnectionEvent;
69725
+ OT.CpuPerformanceChangedEvent = Events.CpuPerformanceChangedEvent;
69723
69726
  Object.keys(_logLevels.default).forEach(name => {
69724
69727
  OT[name.toUpperCase()] = _logLevels.default[name].priority;
69725
69728
  });
@@ -69757,6 +69760,7 @@ OT.HAS_REQUIREMENTS = 1;
69757
69760
  OT.IntervalRunner = _interval_runner.default;
69758
69761
  OT.IssueReportedEvent = Events.IssueReportedEvent;
69759
69762
  OT.MediaStoppedEvent = Events.MediaStoppedEvent;
69763
+ OT.MediaStreamAvailableEvent = Events.MediaStreamAvailableEvent;
69760
69764
  OT.Microphone = Microphone;
69761
69765
  OT.NOT_HAS_REQUIREMENTS = 0;
69762
69766
  OT.PeerConnection = PeerConnection;
@@ -95416,7 +95420,7 @@ const createMOSScoreHelper = () => ({
95416
95420
  if (previousVideoScore !== currentVideoScore || previousAudioScore !== currentAudioScore) {
95417
95421
  // Don't emit an empty object
95418
95422
  if (Object.keys(qualityScore).length > 0) {
95419
- subscriber.dispatchEvent(new Events.QualityScoreChanged(qualityScore));
95423
+ subscriber.dispatchEvent(new Events.QualityScoreChangedEvent(qualityScore));
95420
95424
  }
95421
95425
  }
95422
95426
  previousAudioScore = currentAudioScore;
@@ -97805,7 +97809,7 @@ var _default = function _default(deps) {
97805
97809
  _context.next = 9;
97806
97810
  return publisher.setAudioSource(device.deviceId);
97807
97811
  case 9:
97808
- publisher.dispatchEvent(Events.AudioInputDeviceChanged(device));
97812
+ publisher.dispatchEvent(Events.AudioInputDeviceChangedEvent(device));
97809
97813
  case 10:
97810
97814
  case "end":
97811
97815
  return _context.stop();