@opentok/client 2.35.0-alpha.42 → 2.35.0-alpha.44
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 +69 -47
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +3 -3
- 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.35.0
|
|
2
|
+
* @license OpenTok.js 2.35.0 d4f617f15
|
|
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:
|
|
8
|
+
* Date: Wed, 03 Jun 2026 07:40:00 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -23830,7 +23830,8 @@ var _networkConditionChecker = _interopRequireDefault(__webpack_require__(75710)
|
|
|
23830
23830
|
var _languageCodes = __webpack_require__(38891);
|
|
23831
23831
|
var _setDeprecatedProperty = _interopRequireDefault(__webpack_require__(53235));
|
|
23832
23832
|
var _pendingCalls = __webpack_require__(4295);
|
|
23833
|
-
|
|
23833
|
+
var _rateLimitedRunner = _interopRequireDefault(__webpack_require__(37773));
|
|
23834
|
+
const _excluded = ["AudioLevelMeter", "AudioLevelTransformer", "BackingBar", "Chrome", "env", "Errors", "Events", "ExceptionCodes", "audioLevelSamplerFactory", "getStatsHelpers", "hasAudioOutputLevelStatCapability", "hasRemoteStreamsWithWebAudio", "interpretPeerConnectionError", "logging", "MuteButton", "NamePanel", "otError", "OTErrorClass", "OTHelpers", "StylableComponent", "SubscriberPeerConnection", "SubscribingState", "VideoDisabledIndicator", "AudioBlockedIndicator", "VideoUnsupportedIndicator", "createSendMethod", "parseIceServers", "createVideoQualityWatcher", "document", "WidgetView", "createAudioConnector", "ResizeObserverPolyfill", "MediaStream", "AMRStateDurations", "createMOSScoreHelper", "createRateLimitedRunner"],
|
|
23834
23835
|
_excluded2 = ["senderStats", "senderQualityRestrictions"];
|
|
23835
23836
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23836
23837
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -23943,6 +23944,8 @@ function SubscriberFactory(_ref2) {
|
|
|
23943
23944
|
AMRStateDurations = _ref3.AMRStateDurations,
|
|
23944
23945
|
_ref3$createMOSScoreH = _ref3.createMOSScoreHelper,
|
|
23945
23946
|
createMOSScoreHelper = _ref3$createMOSScoreH === void 0 ? _MOSScoreHelper.default : _ref3$createMOSScoreH,
|
|
23947
|
+
_ref3$createRateLimit = _ref3.createRateLimitedRunner,
|
|
23948
|
+
createRateLimitedRunner = _ref3$createRateLimit === void 0 ? _rateLimitedRunner.default : _ref3$createRateLimit,
|
|
23946
23949
|
deps = (0, _objectWithoutPropertiesLoose2.default)(_ref3, _excluded);
|
|
23947
23950
|
const BIND_VIDEO_DELAY_MAX = 30000;
|
|
23948
23951
|
const BIND_VIDEO_DELAY_WARNING = 15000;
|
|
@@ -24723,7 +24726,7 @@ function SubscriberFactory(_ref2) {
|
|
|
24723
24726
|
if (_audioLevelMeter) {
|
|
24724
24727
|
_audioLevelMeter.audioOnly(_widgetView.audioOnly());
|
|
24725
24728
|
}
|
|
24726
|
-
|
|
24729
|
+
setAudioVolume(_audioVolume);
|
|
24727
24730
|
this.trigger('loaded', this);
|
|
24728
24731
|
};
|
|
24729
24732
|
const isAudioOn = () => _stream && _stream.hasAudio && _isSubscribingToAudio && this.getAudioVolume() > 0 && !this.isAudioBlocked();
|
|
@@ -25897,6 +25900,7 @@ function SubscriberFactory(_ref2) {
|
|
|
25897
25900
|
_state.set('Destroyed');
|
|
25898
25901
|
_videoQualityWatcher.destroy();
|
|
25899
25902
|
amrState.destroy();
|
|
25903
|
+
logSetAudioVolumeLimitedRunner.destroy();
|
|
25900
25904
|
_preDisconnectStats = {
|
|
25901
25905
|
sessionId: _session.sessionId,
|
|
25902
25906
|
connectionId: (_session10 = _session) != null && _session10.isConnected() ? (_session11 = _session) == null ? void 0 : (_session11$connection = _session11.connection) == null ? void 0 : _session11$connection.connectionId : null,
|
|
@@ -26332,7 +26336,7 @@ function SubscriberFactory(_ref2) {
|
|
|
26332
26336
|
});
|
|
26333
26337
|
});
|
|
26334
26338
|
};
|
|
26335
|
-
function
|
|
26339
|
+
function applyAudioVolume(audioVolume) {
|
|
26336
26340
|
const video = _widgetView && _widgetView.video();
|
|
26337
26341
|
if (video) {
|
|
26338
26342
|
try {
|
|
@@ -26350,66 +26354,84 @@ function SubscriberFactory(_ref2) {
|
|
|
26350
26354
|
_chrome.muteButton.muted(audioVolume === 0);
|
|
26351
26355
|
}
|
|
26352
26356
|
}
|
|
26353
|
-
|
|
26354
|
-
/**
|
|
26355
|
-
* Sets the audio volume, between 0 and 100, of the Subscriber.
|
|
26356
|
-
*
|
|
26357
|
-
* <p>You can set the initial volume when you call the <code>Session.subscribe()</code>
|
|
26358
|
-
* method. Pass a <code>audioVolume</code> property of the <code>properties</code> parameter
|
|
26359
|
-
* of the method.</p>
|
|
26360
|
-
*
|
|
26361
|
-
* @param {Number} value The audio volume, between 0 and 100.
|
|
26362
|
-
*
|
|
26363
|
-
* @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
|
|
26364
|
-
* following:
|
|
26365
|
-
*
|
|
26366
|
-
* <pre>mySubscriber.setAudioVolume(50).setStyle(newStyle);</pre>
|
|
26367
|
-
*
|
|
26368
|
-
* @see <a href="#getAudioVolume">getAudioVolume()</a>
|
|
26369
|
-
* @see <a href="Session.html#subscribe">Session.subscribe()</a>
|
|
26370
|
-
* @method #setAudioVolume
|
|
26371
|
-
* @memberOf Subscriber
|
|
26372
|
-
*/
|
|
26373
|
-
|
|
26374
|
-
this.setAudioVolume = requestedVolume => {
|
|
26357
|
+
function setAudioVolume(requestedVolume) {
|
|
26375
26358
|
const volume = normalizeAudioVolume(requestedVolume);
|
|
26376
|
-
logAnalyticsEvent('setAudioVolume', 'Attempt', {
|
|
26377
|
-
audioVolume: volume
|
|
26378
|
-
});
|
|
26379
26359
|
if (isNaN(volume)) {
|
|
26380
26360
|
logging.error('OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100');
|
|
26381
|
-
|
|
26382
|
-
|
|
26383
|
-
|
|
26384
|
-
|
|
26361
|
+
return {
|
|
26362
|
+
volume,
|
|
26363
|
+
error: 'value should be an integer between 0 and 100'
|
|
26364
|
+
};
|
|
26385
26365
|
}
|
|
26386
26366
|
if (volume !== requestedVolume) {
|
|
26387
26367
|
logging.warn('OT.Subscriber.setAudioVolume: value should be an integer between 0 and 100');
|
|
26388
26368
|
}
|
|
26389
26369
|
if (volume === _audioVolume) {
|
|
26390
|
-
|
|
26391
|
-
|
|
26392
|
-
|
|
26370
|
+
applyAudioVolume(_audioVolume);
|
|
26371
|
+
return {
|
|
26372
|
+
volume,
|
|
26393
26373
|
message: 'Requested volume is same as already set audioVolume'
|
|
26394
|
-
}
|
|
26395
|
-
return this;
|
|
26374
|
+
};
|
|
26396
26375
|
}
|
|
26397
26376
|
if (_audioVolume > 0) {
|
|
26398
26377
|
_latestPositiveVolume = _audioVolume;
|
|
26399
26378
|
}
|
|
26400
26379
|
_audioVolume = volume;
|
|
26401
|
-
|
|
26380
|
+
applyAudioVolume(_audioVolume);
|
|
26402
26381
|
if (_audioVolume > 0 && !_isSubscribingToAudio) {
|
|
26403
26382
|
// in Firefox (and others) we don't stop subscribing to audio when muted, however if we are 'unmuting' and in
|
|
26404
26383
|
// the subscribeToAudio: false state we should subscribe to audio again
|
|
26405
26384
|
|
|
26406
26385
|
// subscribeToAudio is going to call us with _latestPositiveVolume so we'll update it here
|
|
26407
26386
|
_latestPositiveVolume = _audioVolume;
|
|
26408
|
-
|
|
26387
|
+
_subscriber.subscribeToAudio(true, 'internal');
|
|
26409
26388
|
}
|
|
26410
|
-
|
|
26411
|
-
|
|
26389
|
+
return {
|
|
26390
|
+
volume
|
|
26391
|
+
};
|
|
26392
|
+
}
|
|
26393
|
+
const logSetAudioVolumeLimitedRunner = createRateLimitedRunner(result => {
|
|
26394
|
+
const volume = result.volume,
|
|
26395
|
+
error = result.error,
|
|
26396
|
+
message = result.message;
|
|
26397
|
+
logAnalyticsEvent('setAudioVolume', 'Attempt', {
|
|
26398
|
+
audioVolume: volume
|
|
26412
26399
|
});
|
|
26400
|
+
if (error) {
|
|
26401
|
+
logAnalyticsEvent('setAudioVolume', 'Failure', {
|
|
26402
|
+
message: error
|
|
26403
|
+
});
|
|
26404
|
+
} else {
|
|
26405
|
+
logAnalyticsEvent('setAudioVolume', 'Success', {
|
|
26406
|
+
audioVolume: volume,
|
|
26407
|
+
message
|
|
26408
|
+
});
|
|
26409
|
+
}
|
|
26410
|
+
});
|
|
26411
|
+
|
|
26412
|
+
/**
|
|
26413
|
+
* Sets the audio volume, between 0 and 100, of the Subscriber.
|
|
26414
|
+
*
|
|
26415
|
+
* <p>You can set the initial volume when you call the <code>Session.subscribe()</code>
|
|
26416
|
+
* method. Pass a <code>audioVolume</code> property of the <code>properties</code> parameter
|
|
26417
|
+
* of the method.</p>
|
|
26418
|
+
*
|
|
26419
|
+
* @param {Number} value The audio volume, between 0 and 100.
|
|
26420
|
+
*
|
|
26421
|
+
* @return {Subscriber} The Subscriber object. This lets you chain method calls, as in the
|
|
26422
|
+
* following:
|
|
26423
|
+
*
|
|
26424
|
+
* <pre>mySubscriber.setAudioVolume(50).setStyle(newStyle);</pre>
|
|
26425
|
+
*
|
|
26426
|
+
* @see <a href="#getAudioVolume">getAudioVolume()</a>
|
|
26427
|
+
* @see <a href="Session.html#subscribe">Session.subscribe()</a>
|
|
26428
|
+
* @method #setAudioVolume
|
|
26429
|
+
* @memberOf Subscriber
|
|
26430
|
+
*/
|
|
26431
|
+
|
|
26432
|
+
this.setAudioVolume = requestedVolume => {
|
|
26433
|
+
const result = setAudioVolume(requestedVolume);
|
|
26434
|
+
logSetAudioVolumeLimitedRunner.run(result);
|
|
26413
26435
|
return this;
|
|
26414
26436
|
};
|
|
26415
26437
|
|
|
@@ -26500,7 +26522,7 @@ function SubscriberFactory(_ref2) {
|
|
|
26500
26522
|
});
|
|
26501
26523
|
const attemptStart = Date.now();
|
|
26502
26524
|
if (changed) {
|
|
26503
|
-
|
|
26525
|
+
setAudioVolume(value ? _latestPositiveVolume : 0);
|
|
26504
26526
|
}
|
|
26505
26527
|
if (_audioConnector.audioMediaProcessorConnector) {
|
|
26506
26528
|
if (_isSubscribingToAudio) {
|
|
@@ -26936,7 +26958,7 @@ function SubscriberFactory(_ref2) {
|
|
|
26936
26958
|
case 0:
|
|
26937
26959
|
send = _ref34.send, log = _ref34.log, logQoS = _ref34.logQoS, sourceStreamId = _ref34.sourceStreamId, peerId = _ref34.peerId;
|
|
26938
26960
|
if (_properties.testNetwork) {
|
|
26939
|
-
|
|
26961
|
+
setAudioVolume(0);
|
|
26940
26962
|
}
|
|
26941
26963
|
if (getAllPeerConnections().length === 0) {
|
|
26942
26964
|
// @todo The subscribers states should be something like:
|
|
@@ -27304,7 +27326,7 @@ function SubscriberFactory(_ref2) {
|
|
|
27304
27326
|
_isVideoManuallyMuted = !_properties.subscribeToVideo;
|
|
27305
27327
|
_properties.subscribeToAudio = (0, _castToBoolean.default)(_properties.subscribeToAudio, true);
|
|
27306
27328
|
this.subscribeToAudio(_properties.subscribeToAudio, 'internal');
|
|
27307
|
-
|
|
27329
|
+
setAudioVolume(determineAudioVolume(_properties));
|
|
27308
27330
|
_widgetView = new Subscriber.WidgetView(targetElement, Object.assign({}, _properties, {
|
|
27309
27331
|
widgetType: 'subscriber'
|
|
27310
27332
|
}));
|
|
@@ -41932,7 +41954,7 @@ function staticConfigFactory(_temp) {
|
|
|
41932
41954
|
_ref$axios = _ref.axios,
|
|
41933
41955
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
41934
41956
|
_ref$properties = _ref.properties,
|
|
41935
|
-
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"
|
|
41957
|
+
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"d4f617f15","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;
|
|
41936
41958
|
/** @type builtInConfig */
|
|
41937
41959
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
41938
41960
|
/**
|