@opentok/client 2.28.5 → 2.29.0-alpha.1
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.
- package/dist/js/opentok.js +66 -37
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +6 -6
- package/dist/js/opentok.min.js.map +1 -1
- package/package.json +1 -1
package/dist/js/opentok.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license OpenTok.js 2.
|
|
2
|
+
* @license OpenTok.js 2.29.0 dc9a1e9
|
|
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,
|
|
8
|
+
* Date: Fri, 06 Dec 2024 15:12:26 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -3738,32 +3738,45 @@ function EventsFactory(deps) {
|
|
|
3738
3738
|
};
|
|
3739
3739
|
|
|
3740
3740
|
/**
|
|
3741
|
-
* The Session object dispatches a cpuPerformanceChanged event
|
|
3742
|
-
*
|
|
3743
|
-
*
|
|
3744
|
-
*
|
|
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
|
+
* This is a <i>beta</i> feature.
|
|
3745
3746
|
*
|
|
3746
|
-
* @property {
|
|
3747
|
-
* be one the following: "nominal", "fair", "serious", or "critical"
|
|
3747
|
+
* @property {String} cpuPerformanceState The new CPU performance state. The CPU performance state can
|
|
3748
|
+
* be one the following: "nominal", "fair", "serious", or "critical".
|
|
3749
|
+
* (See <a href="https://w3c.github.io/compute-pressure/#pressure-states">this W3C specification</a>.)
|
|
3748
3750
|
*
|
|
3751
|
+
* @see <a href="Session.html#event:cpuPerformanceChanged">Session cpuPerformanceChanged event</a>
|
|
3752
|
+
* @class CpuPerformanceChangedEvent
|
|
3753
|
+
* @augments Event
|
|
3749
3754
|
*/
|
|
3750
|
-
Events.
|
|
3755
|
+
Events.CpuPerformanceChangedEvent = function CpuPerformanceChangedEvent(cpuPerformanceState) {
|
|
3751
3756
|
return new _Event4.default('cpuPerformanceChanged', false, {
|
|
3752
3757
|
cpuPerformanceState
|
|
3753
3758
|
});
|
|
3754
3759
|
};
|
|
3755
3760
|
|
|
3756
3761
|
/**
|
|
3757
|
-
* The Subscriber object dispatches a qualityScoreChanged
|
|
3758
|
-
*
|
|
3759
|
-
*
|
|
3760
|
-
*
|
|
3762
|
+
* The Subscriber object dispatches a <code>qualityScoreChanged</code>
|
|
3763
|
+
* event when either the audio or video quality score changes for the subscriber.
|
|
3764
|
+
* The scores are a heuristic value representing the expected subscriber experience.
|
|
3765
|
+
* The values are integers ranging from 1 to 5, with the values corresponding to
|
|
3766
|
+
* bad, poor, fair, good, and excellent.
|
|
3767
|
+
* This is a <i>beta</i> feature.
|
|
3768
|
+
*
|
|
3769
|
+
* @class QualityScoreChangedEvent
|
|
3770
|
+
* @augments Event
|
|
3771
|
+
* @see <a href="Subscriber.html#event:qualityScoreChanged">Subscriber qualityScoreChanged event</a>
|
|
3761
3772
|
*
|
|
3762
|
-
* @property {
|
|
3763
|
-
*
|
|
3773
|
+
* @property {Object} qualityScore The current quality score for the subscriber.
|
|
3774
|
+
* The event contains two properties: <code>audioQualityScore</code>
|
|
3775
|
+
* and <code>videoQualityScore</code>. These properties are undefined if there
|
|
3776
|
+
* is either no audio or no video.
|
|
3764
3777
|
*
|
|
3765
3778
|
*/
|
|
3766
|
-
Events.
|
|
3779
|
+
Events.QualityScoreChangedEvent = function qualityScoreChanged(qualityScore) {
|
|
3767
3780
|
return new _Event4.default('qualityScoreChanged', false, {
|
|
3768
3781
|
qualityScore
|
|
3769
3782
|
});
|
|
@@ -3798,7 +3811,7 @@ function EventsFactory(deps) {
|
|
|
3798
3811
|
};
|
|
3799
3812
|
|
|
3800
3813
|
/**
|
|
3801
|
-
* This is a <
|
|
3814
|
+
* This is a <i>beta</i> feature.
|
|
3802
3815
|
* Defines an event object for the <code>mediaStreamAvailable</code> event dispatched by both
|
|
3803
3816
|
* the Publisher and Subscriber objects. The Publisher and Subscriber objects both dispatch a <code>mediaStreamAvailable</code>
|
|
3804
3817
|
* 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 +3825,10 @@ function EventsFactory(deps) {
|
|
|
3812
3825
|
* event</a>
|
|
3813
3826
|
* @see <a href="Subscriber.html#event:mediaStreamAvailable">Subscriber mediaStreamAvailable
|
|
3814
3827
|
* event</a>
|
|
3828
|
+
* @class MediaStreamAvailableEvent
|
|
3815
3829
|
* @augments Event
|
|
3816
3830
|
*/
|
|
3817
|
-
Events.
|
|
3831
|
+
Events.MediaStreamAvailableEvent = function MediaStreamAvailableEvent(mediaStream) {
|
|
3818
3832
|
return new _Event4.default('mediaStreamAvailable', false, {
|
|
3819
3833
|
mediaStream
|
|
3820
3834
|
});
|
|
@@ -3954,16 +3968,18 @@ function EventsFactory(deps) {
|
|
|
3954
3968
|
};
|
|
3955
3969
|
|
|
3956
3970
|
/**
|
|
3957
|
-
* Dispatched when the audio input device is changed. This is a <
|
|
3971
|
+
* Dispatched when the audio input device is changed. This is a <i>beta</i> feature.
|
|
3958
3972
|
*
|
|
3959
|
-
*
|
|
3973
|
+
* <p> For more information, see <a href="https://tokbox.com/developer/guides/audio-video/js/#audioInputDeviceChanged">this documentation</a>.
|
|
3974
|
+
* @property {Object} device The audio input device.
|
|
3975
|
+
* This object has a <code>deviceId</code> property and a <code>label</code> property (both strings).
|
|
3960
3976
|
*
|
|
3961
3977
|
* @see <a href="Publisher.html#event:audioInputDeviceChanged">Publisher audioInputDeviceChanged event</a></p>
|
|
3962
3978
|
* @see <a href="Publisher.html#setAudioSource">Publisher.setAudioSource()</a></p>
|
|
3963
|
-
* @class
|
|
3979
|
+
* @class AudioInputDeviceChangedEvent
|
|
3964
3980
|
* @augments Event
|
|
3965
3981
|
*/
|
|
3966
|
-
Events.
|
|
3982
|
+
Events.AudioInputDeviceChangedEvent = function AudioInputDeviceChangedEvent(device) {
|
|
3967
3983
|
return new _Event4.default(_eventNames.default.AUDIO_INPUT_DEVICE_CHANGED, false, {
|
|
3968
3984
|
device
|
|
3969
3985
|
});
|
|
@@ -8107,7 +8123,7 @@ const logging = (0, _log.default)('StaticConfig');
|
|
|
8107
8123
|
*/
|
|
8108
8124
|
|
|
8109
8125
|
/** @type builtInConfig */
|
|
8110
|
-
const builtInConfig = (0, _cloneDeep.default)({"version":"v2.
|
|
8126
|
+
const builtInConfig = (0, _cloneDeep.default)({"version":"v2.29.0","buildHash":"dc9a1e9","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
8127
|
const whitelistAllowedRuntimeProperties = (0, _pick.default)(['apiURL', 'assetURL', 'cdnURL', 'sessionInfoOverrides', 'loggingURL']);
|
|
8112
8128
|
const liveConfigMap = {
|
|
8113
8129
|
apiUrl: 'apiURL',
|
|
@@ -18690,7 +18706,7 @@ function PublisherFactory(_ref) {
|
|
|
18690
18706
|
}
|
|
18691
18707
|
});
|
|
18692
18708
|
widgetView.on('videoElementCreated', element => {
|
|
18693
|
-
this.dispatchEvent(new Events.
|
|
18709
|
+
this.dispatchEvent(new Events.MediaStreamAvailableEvent(webRTCStream));
|
|
18694
18710
|
const event = new Events.VideoElementCreatedEvent(element);
|
|
18695
18711
|
this.dispatchEvent(event);
|
|
18696
18712
|
});
|
|
@@ -22490,7 +22506,7 @@ function PublisherFactory(_ref) {
|
|
|
22490
22506
|
*/
|
|
22491
22507
|
|
|
22492
22508
|
/**
|
|
22493
|
-
* This is a <
|
|
22509
|
+
* This is a <i>beta</i> feature.
|
|
22494
22510
|
* Dispatched when the MediaStream is available.
|
|
22495
22511
|
* @see Event
|
|
22496
22512
|
* @name mediaStreamAvailable
|
|
@@ -22514,7 +22530,7 @@ function PublisherFactory(_ref) {
|
|
|
22514
22530
|
* This is a beta feature.
|
|
22515
22531
|
*
|
|
22516
22532
|
* @see Event
|
|
22517
|
-
* @see
|
|
22533
|
+
* @see AudioInputDeviceChangedEvent
|
|
22518
22534
|
* @name audioInputDeviceChanged
|
|
22519
22535
|
* @event
|
|
22520
22536
|
* @memberof Publisher
|
|
@@ -34640,7 +34656,7 @@ function SubscriberFactory(_ref2) {
|
|
|
34640
34656
|
_session2 = _session, sessionInfo = _session2.sessionInfo;
|
|
34641
34657
|
if (!_exposedWebRTCStream) {
|
|
34642
34658
|
_exposedWebRTCStream = new MediaStream(webRTCStream);
|
|
34643
|
-
_this.dispatchEvent(new Events.
|
|
34659
|
+
_this.dispatchEvent(new Events.MediaStreamAvailableEvent(_exposedWebRTCStream));
|
|
34644
34660
|
}
|
|
34645
34661
|
_webRTCStream = webRTCStream;
|
|
34646
34662
|
|
|
@@ -37419,7 +37435,7 @@ function SubscriberFactory(_ref2) {
|
|
|
37419
37435
|
*/
|
|
37420
37436
|
|
|
37421
37437
|
/**
|
|
37422
|
-
* This is a <
|
|
37438
|
+
* This is a <i>beta</i> feature.
|
|
37423
37439
|
* Dispatched when the MediaStream is available.
|
|
37424
37440
|
* @see Event
|
|
37425
37441
|
* @name mediaStreamAvailable
|
|
@@ -37571,11 +37587,11 @@ function SubscriberFactory(_ref2) {
|
|
|
37571
37587
|
* Dispatched when either the audio or video quality
|
|
37572
37588
|
* score has changed. The scores are a heuristic value representing the expected subscriber experience. The values
|
|
37573
37589
|
* range from 5 to 1, with the integer values corresponding to Excellent | Good | Fair | Poor | Bad.
|
|
37574
|
-
* This is a <
|
|
37590
|
+
* This is a <i>beta</i> feature.
|
|
37575
37591
|
* @name qualityScoreChanged
|
|
37576
37592
|
* @event
|
|
37577
37593
|
* @memberof Subscriber
|
|
37578
|
-
* @see
|
|
37594
|
+
* @see QualityScoreChangedEvent
|
|
37579
37595
|
*/
|
|
37580
37596
|
return this;
|
|
37581
37597
|
};
|
|
@@ -64422,7 +64438,7 @@ function SessionFactory(deps) {
|
|
|
64422
64438
|
cpuPressureMonitor.initMonitoring(PressureObserver);
|
|
64423
64439
|
cpuPressureMonitor.startMonitoring();
|
|
64424
64440
|
cpuPressureMonitor.on('pressureMonitorEvent', newState => {
|
|
64425
|
-
this.dispatchEvent(new Events.
|
|
64441
|
+
this.dispatchEvent(new Events.CpuPerformanceChangedEvent(newState));
|
|
64426
64442
|
});
|
|
64427
64443
|
}
|
|
64428
64444
|
|
|
@@ -67263,6 +67279,17 @@ function SessionFactory(deps) {
|
|
|
67263
67279
|
* of streams in a session</a>
|
|
67264
67280
|
*/
|
|
67265
67281
|
|
|
67282
|
+
/**
|
|
67283
|
+
* The CPU performance state has changed. This can be set to
|
|
67284
|
+
* one the following: "nominal", "fair", "serious", or "critical".
|
|
67285
|
+
* This is a <i>beta</i> feature.
|
|
67286
|
+
*
|
|
67287
|
+
* @name cpuPerformanceChanged
|
|
67288
|
+
* @event
|
|
67289
|
+
* @memberof Session
|
|
67290
|
+
* @see CpuPerformanceChangedEvent
|
|
67291
|
+
*/
|
|
67292
|
+
|
|
67266
67293
|
/**
|
|
67267
67294
|
* The client has connected to a Vonage Video API session. This event is dispatched asynchronously
|
|
67268
67295
|
* in response to a successful call to the <code>connect()</code> method of a Session
|
|
@@ -67280,7 +67307,7 @@ function SessionFactory(deps) {
|
|
|
67280
67307
|
/**
|
|
67281
67308
|
* The client has disconnected from the session. This event may be dispatched asynchronously
|
|
67282
67309
|
* 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
|
|
67310
|
+
* The event may also be dispatched if a session connection is lost inadvertently, as in the case
|
|
67284
67311
|
* of a lost network connection.
|
|
67285
67312
|
* <p>
|
|
67286
67313
|
* The default behavior is that all Subscriber objects are unsubscribed and removed from the
|
|
@@ -67429,7 +67456,7 @@ function SessionFactory(deps) {
|
|
|
67429
67456
|
* console.log("Signal data: " + event.data);
|
|
67430
67457
|
* });
|
|
67431
67458
|
* </pre>
|
|
67432
|
-
* <p>You can register for signals of a
|
|
67459
|
+
* <p>You can register for signals of a specified type by adding an event handler for the
|
|
67433
67460
|
* <code>signal:type</code> event (replacing <code>type</code> with the actual type string
|
|
67434
67461
|
* to filter on).
|
|
67435
67462
|
*
|
|
@@ -67453,7 +67480,7 @@ function SessionFactory(deps) {
|
|
|
67453
67480
|
* </li>
|
|
67454
67481
|
* </ul>
|
|
67455
67482
|
* <p>
|
|
67456
|
-
* You can register for signals of a
|
|
67483
|
+
* You can register for signals of a specified type by adding an event handler for the
|
|
67457
67484
|
* <code>signal:type</code> event (replacing <code>type</code> with the actual type string
|
|
67458
67485
|
* to filter on). For example, the following code adds an event handler for signals of
|
|
67459
67486
|
* type "foo":
|
|
@@ -69714,12 +69741,13 @@ OT.ArchiveEvent = Events.ArchiveEvent;
|
|
|
69714
69741
|
OT.ArchiveUpdatedEvent = Events.ArchiveUpdatedEvent;
|
|
69715
69742
|
OT.AudioLevelTransformer = _audio_level_transformer.default;
|
|
69716
69743
|
OT.AudioLevelUpdatedEvent = Events.AudioLevelUpdatedEvent;
|
|
69717
|
-
OT.
|
|
69744
|
+
OT.AudioInputDeviceChangedEvent = Events.AudioInputDeviceChangedEvent;
|
|
69718
69745
|
OT.Capabilities = _capabilities.default;
|
|
69719
69746
|
OT.Chrome = _chrome.default;
|
|
69720
69747
|
OT.Connection = _connection.default;
|
|
69721
69748
|
OT.ConnectionCapabilities = OT.Connection.Capabilities;
|
|
69722
69749
|
OT.ConnectionEvent = Events.ConnectionEvent;
|
|
69750
|
+
OT.CpuPerformanceChangedEvent = Events.CpuPerformanceChangedEvent;
|
|
69723
69751
|
Object.keys(_logLevels.default).forEach(name => {
|
|
69724
69752
|
OT[name.toUpperCase()] = _logLevels.default[name].priority;
|
|
69725
69753
|
});
|
|
@@ -69757,6 +69785,7 @@ OT.HAS_REQUIREMENTS = 1;
|
|
|
69757
69785
|
OT.IntervalRunner = _interval_runner.default;
|
|
69758
69786
|
OT.IssueReportedEvent = Events.IssueReportedEvent;
|
|
69759
69787
|
OT.MediaStoppedEvent = Events.MediaStoppedEvent;
|
|
69788
|
+
OT.MediaStreamAvailableEvent = Events.MediaStreamAvailableEvent;
|
|
69760
69789
|
OT.Microphone = Microphone;
|
|
69761
69790
|
OT.NOT_HAS_REQUIREMENTS = 0;
|
|
69762
69791
|
OT.PeerConnection = PeerConnection;
|
|
@@ -95416,7 +95445,7 @@ const createMOSScoreHelper = () => ({
|
|
|
95416
95445
|
if (previousVideoScore !== currentVideoScore || previousAudioScore !== currentAudioScore) {
|
|
95417
95446
|
// Don't emit an empty object
|
|
95418
95447
|
if (Object.keys(qualityScore).length > 0) {
|
|
95419
|
-
subscriber.dispatchEvent(new Events.
|
|
95448
|
+
subscriber.dispatchEvent(new Events.QualityScoreChangedEvent(qualityScore));
|
|
95420
95449
|
}
|
|
95421
95450
|
}
|
|
95422
95451
|
previousAudioScore = currentAudioScore;
|
|
@@ -97805,7 +97834,7 @@ var _default = function _default(deps) {
|
|
|
97805
97834
|
_context.next = 9;
|
|
97806
97835
|
return publisher.setAudioSource(device.deviceId);
|
|
97807
97836
|
case 9:
|
|
97808
|
-
publisher.dispatchEvent(Events.
|
|
97837
|
+
publisher.dispatchEvent(Events.AudioInputDeviceChangedEvent(device));
|
|
97809
97838
|
case 10:
|
|
97810
97839
|
case "end":
|
|
97811
97840
|
return _context.stop();
|