@opentok/client 2.36.0-alpha.16 → 2.36.0-alpha.17
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 +161 -74
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +4 -4
- 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.36.0
|
|
2
|
+
* @license OpenTok.js 2.36.0 738cef185
|
|
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: Thu, 30 Jul 2026 10:15:47 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -39872,7 +39872,7 @@ function staticConfigFactory(_temp) {
|
|
|
39872
39872
|
_ref$axios = _ref.axios,
|
|
39873
39873
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
39874
39874
|
_ref$properties = _ref.properties,
|
|
39875
|
-
properties = _ref$properties === void 0 ? {"version":"v2.36.0","buildHash":"
|
|
39875
|
+
properties = _ref$properties === void 0 ? {"version":"v2.36.0","buildHash":"738cef185","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;
|
|
39876
39876
|
/** @type builtInConfig */
|
|
39877
39877
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
39878
39878
|
/**
|
|
@@ -41461,7 +41461,7 @@ var _promiseDelay = _interopRequireDefault(__webpack_require__(66395));
|
|
|
41461
41461
|
var _env = _interopRequireDefault(__webpack_require__(28628));
|
|
41462
41462
|
var _networkStatus = _interopRequireDefault(__webpack_require__(83655));
|
|
41463
41463
|
var _deviceHelpers = _interopRequireDefault(__webpack_require__(78092));
|
|
41464
|
-
var _blockCallsUntilComplete =
|
|
41464
|
+
var _blockCallsUntilComplete = _interopRequireWildcard(__webpack_require__(86266));
|
|
41465
41465
|
var _interval_runner = _interopRequireDefault(__webpack_require__(55605));
|
|
41466
41466
|
var _exception_codes = _interopRequireDefault(__webpack_require__(90529));
|
|
41467
41467
|
var _ot_error_class = _interopRequireDefault(__webpack_require__(4960));
|
|
@@ -44423,45 +44423,58 @@ function PublisherFactory(_ref) {
|
|
|
44423
44423
|
let currentDeviceId;
|
|
44424
44424
|
let currentVideoFilter;
|
|
44425
44425
|
let currentAudioFilter;
|
|
44426
|
-
this._toggleVideo = (0, _blockCallsUntilComplete.
|
|
44426
|
+
this._toggleVideo = (0, _blockCallsUntilComplete.queueLatestCall)( /*#__PURE__*/function () {
|
|
44427
44427
|
var _ref40 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(shouldHaveVideo, videoDimensions) {
|
|
44428
44428
|
var _vidDevices$find;
|
|
44429
44429
|
var vidDevices, oldTrack, oldTrackDeviceId, newTrack, videoFilter, originalVideoTrack, _originalVideoTrack;
|
|
44430
44430
|
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
44431
44431
|
while (1) switch (_context28.prev = _context28.next) {
|
|
44432
44432
|
case 0:
|
|
44433
|
+
if (properties.publisherAudioFallbackEnabled || getStatsCalled || networkConditionChangedListenersCount > 0) {
|
|
44434
|
+
resetCongestionLevelEstimationOnPeerConnection(shouldHaveVideo);
|
|
44435
|
+
if (shouldHaveVideo === false && audioFallbackCoordinator && audioFallbackCoordinator.getState() !== _audioFallbackVideoStates.default.ACTIVE_VIDEO) {
|
|
44436
|
+
// We will reset audio fallback state now, but rumor doesn't expect the message until we re-enable the video
|
|
44437
|
+
// so we flag the message as pending
|
|
44438
|
+
pendingRumorAudioFallbackMessage = true;
|
|
44439
|
+
resetAudioFallbackState();
|
|
44440
|
+
}
|
|
44441
|
+
}
|
|
44442
|
+
|
|
44443
|
+
// we don't need to worry about the camera if we're screensharing or using
|
|
44444
|
+
// a custom video track
|
|
44445
|
+
// if we add support for switching between screen and camera this may cause issues
|
|
44433
44446
|
if (!(isScreenSharing || isCustomVideoTrack || isTrackManuallyStopped)) {
|
|
44434
|
-
_context28.next =
|
|
44447
|
+
_context28.next = 3;
|
|
44435
44448
|
break;
|
|
44436
44449
|
}
|
|
44437
44450
|
return _context28.abrupt("return");
|
|
44438
|
-
case
|
|
44439
|
-
_context28.next =
|
|
44451
|
+
case 3:
|
|
44452
|
+
_context28.next = 5;
|
|
44440
44453
|
return getVideoDevices();
|
|
44441
|
-
case
|
|
44454
|
+
case 5:
|
|
44442
44455
|
vidDevices = _context28.sent;
|
|
44443
44456
|
oldTrack = getCurrentTrack();
|
|
44444
44457
|
if (oldTrack) {
|
|
44445
|
-
_context28.next =
|
|
44458
|
+
_context28.next = 9;
|
|
44446
44459
|
break;
|
|
44447
44460
|
}
|
|
44448
44461
|
throw otError(Errors.NOT_SUPPORTED, new Error('Publisher._toggleVideo cannot toggleVideo when you have no video source.'));
|
|
44449
|
-
case
|
|
44462
|
+
case 9:
|
|
44450
44463
|
// oldTrackDeviceId is undefined when it comes from a canvasTracks, i.e.: it is currently muted
|
|
44451
44464
|
oldTrackDeviceId = (_vidDevices$find = vidDevices.find(device => device.label === oldTrack.label)) == null ? void 0 : _vidDevices$find.deviceId;
|
|
44452
44465
|
if (isNewTrackNeeded(shouldHaveVideo, oldTrackDeviceId)) {
|
|
44453
|
-
_context28.next =
|
|
44466
|
+
_context28.next = 12;
|
|
44454
44467
|
break;
|
|
44455
44468
|
}
|
|
44456
44469
|
return _context28.abrupt("return");
|
|
44457
|
-
case
|
|
44470
|
+
case 12:
|
|
44458
44471
|
if (!(oldTrack.readyState === 'ended')) {
|
|
44459
|
-
_context28.next =
|
|
44472
|
+
_context28.next = 15;
|
|
44460
44473
|
break;
|
|
44461
44474
|
}
|
|
44462
44475
|
isTrackManuallyStopped = true;
|
|
44463
44476
|
return _context28.abrupt("return");
|
|
44464
|
-
case
|
|
44477
|
+
case 15:
|
|
44465
44478
|
if (shouldHaveVideo && OTHelpers.env.isAndroid && (OTHelpers.env.isChrome || OTHelpers.env.isSamsung)) {
|
|
44466
44479
|
// On Chrome on Android you need to stop the previous video track OPENTOK-37206
|
|
44467
44480
|
if (oldTrack && oldTrack.stop) {
|
|
@@ -44469,18 +44482,18 @@ function PublisherFactory(_ref) {
|
|
|
44469
44482
|
}
|
|
44470
44483
|
}
|
|
44471
44484
|
if (shouldHaveVideo) {
|
|
44472
|
-
_context28.next =
|
|
44485
|
+
_context28.next = 32;
|
|
44473
44486
|
break;
|
|
44474
44487
|
}
|
|
44475
|
-
_context28.prev =
|
|
44488
|
+
_context28.prev = 17;
|
|
44476
44489
|
newTrack = (0, _createCanvasVideoTrack.default)(videoDimensions);
|
|
44477
|
-
_context28.next =
|
|
44490
|
+
_context28.next = 24;
|
|
44478
44491
|
break;
|
|
44479
|
-
case
|
|
44480
|
-
_context28.prev =
|
|
44481
|
-
_context28.t0 = _context28["catch"](
|
|
44492
|
+
case 21:
|
|
44493
|
+
_context28.prev = 21;
|
|
44494
|
+
_context28.t0 = _context28["catch"](17);
|
|
44482
44495
|
return _context28.abrupt("return");
|
|
44483
|
-
case
|
|
44496
|
+
case 24:
|
|
44484
44497
|
if (oldTrackDeviceId) {
|
|
44485
44498
|
// store the current deviceId to reacquire the video later
|
|
44486
44499
|
currentDeviceId = oldTrackDeviceId;
|
|
@@ -44488,102 +44501,102 @@ function PublisherFactory(_ref) {
|
|
|
44488
44501
|
setCurrentTrackDeviceId(newTrack.label);
|
|
44489
44502
|
videoFilter = mediaProcessor.getVideoFilter();
|
|
44490
44503
|
if (!videoFilter) {
|
|
44491
|
-
_context28.next =
|
|
44504
|
+
_context28.next = 31;
|
|
44492
44505
|
break;
|
|
44493
44506
|
}
|
|
44494
44507
|
// Save the current video filter because we want to make sure it
|
|
44495
44508
|
// gets enabled when the user publishes video again
|
|
44496
44509
|
currentVideoFilter = videoFilter;
|
|
44497
|
-
_context28.next =
|
|
44510
|
+
_context28.next = 31;
|
|
44498
44511
|
return destroyMediaProcessor();
|
|
44499
|
-
case
|
|
44512
|
+
case 31:
|
|
44500
44513
|
if (_videoMediaProcessorConnector) {
|
|
44501
44514
|
_videoMediaProcessorConnector.destroy();
|
|
44502
44515
|
_videoMediaProcessorConnector.stopOriginalTrack();
|
|
44503
44516
|
}
|
|
44504
|
-
case
|
|
44517
|
+
case 32:
|
|
44505
44518
|
if (!(currentDeviceId && vidDevices.findIndex(device => device.deviceId === currentDeviceId) === -1)) {
|
|
44506
|
-
_context28.next =
|
|
44519
|
+
_context28.next = 34;
|
|
44507
44520
|
break;
|
|
44508
44521
|
}
|
|
44509
44522
|
throw otError(Errors.NO_DEVICES_FOUND, new Error('Previous device no longer available - deviceId not found'));
|
|
44510
|
-
case
|
|
44523
|
+
case 34:
|
|
44511
44524
|
privateEvents.emit('streamDestroy');
|
|
44512
44525
|
if (!shouldHaveVideo) {
|
|
44513
|
-
_context28.next =
|
|
44526
|
+
_context28.next = 65;
|
|
44514
44527
|
break;
|
|
44515
44528
|
}
|
|
44516
44529
|
if (!hasTrackFromDevice(currentDeviceId)) {
|
|
44517
|
-
_context28.next =
|
|
44530
|
+
_context28.next = 38;
|
|
44518
44531
|
break;
|
|
44519
44532
|
}
|
|
44520
44533
|
return _context28.abrupt("return");
|
|
44521
|
-
case
|
|
44522
|
-
_context28.prev =
|
|
44523
|
-
_context28.next =
|
|
44534
|
+
case 38:
|
|
44535
|
+
_context28.prev = 38;
|
|
44536
|
+
_context28.next = 41;
|
|
44524
44537
|
return getTrackFromDeviceId(currentDeviceId);
|
|
44525
|
-
case
|
|
44538
|
+
case 41:
|
|
44526
44539
|
newTrack = _context28.sent;
|
|
44527
|
-
_context28.next =
|
|
44540
|
+
_context28.next = 48;
|
|
44528
44541
|
break;
|
|
44529
|
-
case
|
|
44530
|
-
_context28.prev =
|
|
44531
|
-
_context28.t1 = _context28["catch"](
|
|
44542
|
+
case 44:
|
|
44543
|
+
_context28.prev = 44;
|
|
44544
|
+
_context28.t1 = _context28["catch"](38);
|
|
44532
44545
|
logging.error(`Error getting new track for current device(${currentDeviceId}): ${_context28.t1}`);
|
|
44533
44546
|
throw _context28.t1;
|
|
44534
|
-
case
|
|
44547
|
+
case 48:
|
|
44535
44548
|
if (newTrack) {
|
|
44536
|
-
_context28.next =
|
|
44549
|
+
_context28.next = 51;
|
|
44537
44550
|
break;
|
|
44538
44551
|
}
|
|
44539
44552
|
logging.error('Failed to enable video. It was not possible to get a new track from the camera');
|
|
44540
44553
|
return _context28.abrupt("return");
|
|
44541
|
-
case
|
|
44554
|
+
case 51:
|
|
44542
44555
|
if (!currentVideoFilter) {
|
|
44543
|
-
_context28.next =
|
|
44556
|
+
_context28.next = 60;
|
|
44544
44557
|
break;
|
|
44545
44558
|
}
|
|
44546
44559
|
originalVideoTrack = mediaProcessor.getOriginalVideoTrack();
|
|
44547
|
-
_context28.next =
|
|
44560
|
+
_context28.next = 55;
|
|
44548
44561
|
return mediaProcessor.setVideoFilter(currentVideoFilter, true);
|
|
44549
|
-
case
|
|
44550
|
-
_context28.next =
|
|
44562
|
+
case 55:
|
|
44563
|
+
_context28.next = 57;
|
|
44551
44564
|
return mediaProcessor.setMediaStream(webRTCStream);
|
|
44552
|
-
case
|
|
44553
|
-
_context28.next =
|
|
44565
|
+
case 57:
|
|
44566
|
+
_context28.next = 59;
|
|
44554
44567
|
return mediaProcessor.setVideoTrack(newTrack);
|
|
44555
|
-
case 58:
|
|
44556
|
-
newTrack = _context28.sent;
|
|
44557
44568
|
case 59:
|
|
44569
|
+
newTrack = _context28.sent;
|
|
44570
|
+
case 60:
|
|
44558
44571
|
if (!_videoMediaProcessorConnector) {
|
|
44559
|
-
_context28.next =
|
|
44572
|
+
_context28.next = 65;
|
|
44560
44573
|
break;
|
|
44561
44574
|
}
|
|
44562
44575
|
originalVideoTrack = _videoMediaProcessorConnector.originalTrack;
|
|
44563
|
-
_context28.next =
|
|
44576
|
+
_context28.next = 64;
|
|
44564
44577
|
return _videoMediaProcessorConnector.setTrack(newTrack);
|
|
44565
|
-
case 63:
|
|
44566
|
-
newTrack = _context28.sent;
|
|
44567
44578
|
case 64:
|
|
44568
|
-
|
|
44569
|
-
|
|
44579
|
+
newTrack = _context28.sent;
|
|
44580
|
+
case 65:
|
|
44581
|
+
_context28.prev = 65;
|
|
44582
|
+
_context28.next = 68;
|
|
44570
44583
|
return replaceTrackAndUpdate(oldTrack, newTrack);
|
|
44571
|
-
case
|
|
44584
|
+
case 68:
|
|
44572
44585
|
// We stop the original track as a final step because whatever effects
|
|
44573
44586
|
// were applied to it should remain in effect until the new track is
|
|
44574
44587
|
// set
|
|
44575
44588
|
(_originalVideoTrack = originalVideoTrack) == null ? void 0 : _originalVideoTrack.stop();
|
|
44576
|
-
_context28.next =
|
|
44589
|
+
_context28.next = 74;
|
|
44577
44590
|
break;
|
|
44578
|
-
case
|
|
44579
|
-
_context28.prev =
|
|
44580
|
-
_context28.t2 = _context28["catch"](
|
|
44591
|
+
case 71:
|
|
44592
|
+
_context28.prev = 71;
|
|
44593
|
+
_context28.t2 = _context28["catch"](65);
|
|
44581
44594
|
throw _context28.t2;
|
|
44582
|
-
case
|
|
44595
|
+
case 74:
|
|
44583
44596
|
case "end":
|
|
44584
44597
|
return _context28.stop();
|
|
44585
44598
|
}
|
|
44586
|
-
}, _callee28, null, [[
|
|
44599
|
+
}, _callee28, null, [[17, 21], [38, 44], [65, 71]]);
|
|
44587
44600
|
}));
|
|
44588
44601
|
return function (_x20, _x21) {
|
|
44589
44602
|
return _ref40.apply(this, arguments);
|
|
@@ -44817,18 +44830,9 @@ function PublisherFactory(_ref) {
|
|
|
44817
44830
|
// Save videoDimensions to not alter video size between mute states.
|
|
44818
44831
|
videoDimensions = getVideoDimensions();
|
|
44819
44832
|
properties.publishVideo = value;
|
|
44820
|
-
|
|
44821
|
-
resetCongestionLevelEstimationOnPeerConnection(value);
|
|
44822
|
-
if (value === false && audioFallbackCoordinator && audioFallbackCoordinator.getState() !== _audioFallbackVideoStates.default.ACTIVE_VIDEO) {
|
|
44823
|
-
// We will reset audio fallback state now, but rumor doesn't expect the message until we re-enable the video
|
|
44824
|
-
// so we flag the message as pending
|
|
44825
|
-
pendingRumorAudioFallbackMessage = true;
|
|
44826
|
-
resetAudioFallbackState();
|
|
44827
|
-
}
|
|
44828
|
-
}
|
|
44829
|
-
_context32.next = 5;
|
|
44833
|
+
_context32.next = 4;
|
|
44830
44834
|
return Promise.all([_this._toggleVideo(properties.publishVideo, videoDimensions), updateVideo()]);
|
|
44831
|
-
case
|
|
44835
|
+
case 4:
|
|
44832
44836
|
case "end":
|
|
44833
44837
|
return _context32.stop();
|
|
44834
44838
|
}
|
|
@@ -96153,14 +96157,16 @@ module.exports = assign;
|
|
|
96153
96157
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
96154
96158
|
|
|
96155
96159
|
"use strict";
|
|
96160
|
+
/* provided dependency */ var Promise = __webpack_require__(86964);
|
|
96156
96161
|
|
|
96157
96162
|
|
|
96158
96163
|
var _interopRequireDefault = __webpack_require__(95709);
|
|
96159
96164
|
exports.__esModule = true;
|
|
96160
96165
|
exports["default"] = blockCallsUntilComplete;
|
|
96166
|
+
exports.queueLatestCall = queueLatestCall;
|
|
96161
96167
|
var _regenerator = _interopRequireDefault(__webpack_require__(92207));
|
|
96162
96168
|
var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(79092));
|
|
96163
|
-
// Block subsequent calls to an async function until the previous call has completed
|
|
96169
|
+
// Block subsequent calls to an async function until the previous call has completed.
|
|
96164
96170
|
// Throws an error if you call the function too soon.
|
|
96165
96171
|
function blockCallsUntilComplete(fn) {
|
|
96166
96172
|
let blocked = false;
|
|
@@ -96204,6 +96210,87 @@ function blockCallsUntilComplete(fn) {
|
|
|
96204
96210
|
return blocker;
|
|
96205
96211
|
}();
|
|
96206
96212
|
}
|
|
96213
|
+
function callSafely(fn, context, args) {
|
|
96214
|
+
try {
|
|
96215
|
+
return Promise.resolve(fn.apply(context, args));
|
|
96216
|
+
} catch (err) {
|
|
96217
|
+
return Promise.reject(err);
|
|
96218
|
+
}
|
|
96219
|
+
}
|
|
96220
|
+
|
|
96221
|
+
// Like blockCallsUntilComplete, but instead of throwing when called while busy,
|
|
96222
|
+
// it queues at most one pending call. Whether a call gets queued or skipped
|
|
96223
|
+
// is decided purely by its first (boolean) argument — if it matches the flag
|
|
96224
|
+
// of the call currently in flight, this call is redundant and just resolves
|
|
96225
|
+
// with that call's result. Any other arguments are only used once a call
|
|
96226
|
+
// actually runs; they play no part in the queue/skip decision.
|
|
96227
|
+
function queueLatestCall(fn) {
|
|
96228
|
+
let current = null; // promise of the call currently executing, or null when idle
|
|
96229
|
+
let runningFlag = null; // boolean flag of the call currently executing
|
|
96230
|
+
let queued = null; // the one call waiting its turn: { context, args, resolve, reject, promise }
|
|
96231
|
+
|
|
96232
|
+
function run(context, args) {
|
|
96233
|
+
runningFlag = args[0];
|
|
96234
|
+
// eslint-disable-next-line no-use-before-define
|
|
96235
|
+
current = callSafely(fn, context, args).finally(settle);
|
|
96236
|
+
return current;
|
|
96237
|
+
}
|
|
96238
|
+
function settle() {
|
|
96239
|
+
if (!queued) {
|
|
96240
|
+
current = null;
|
|
96241
|
+
runningFlag = null;
|
|
96242
|
+
return;
|
|
96243
|
+
}
|
|
96244
|
+
const _queued = queued,
|
|
96245
|
+
context = _queued.context,
|
|
96246
|
+
args = _queued.args,
|
|
96247
|
+
resolve = _queued.resolve,
|
|
96248
|
+
reject = _queued.reject;
|
|
96249
|
+
queued = null;
|
|
96250
|
+
run(context, args).then(resolve, reject);
|
|
96251
|
+
}
|
|
96252
|
+
return function (flag) {
|
|
96253
|
+
const context = this;
|
|
96254
|
+
for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
96255
|
+
rest[_key2 - 1] = arguments[_key2];
|
|
96256
|
+
}
|
|
96257
|
+
const args = [flag, ...rest];
|
|
96258
|
+
if (!current) {
|
|
96259
|
+
return run(context, args);
|
|
96260
|
+
}
|
|
96261
|
+
if (flag === runningFlag) {
|
|
96262
|
+
// Same flag as the call already in flight — anything queued behind
|
|
96263
|
+
// it is now moot, since we'd just end up back at this same state.
|
|
96264
|
+
if (queued) {
|
|
96265
|
+
current.then(queued.resolve, queued.reject);
|
|
96266
|
+
queued = null;
|
|
96267
|
+
}
|
|
96268
|
+
return current;
|
|
96269
|
+
}
|
|
96270
|
+
|
|
96271
|
+
// Only the most recent pending call matters, so replace whatever was
|
|
96272
|
+
// waiting before it — this is also what keeps its `rest` args current.
|
|
96273
|
+
if (queued) {
|
|
96274
|
+
queued.context = context;
|
|
96275
|
+
queued.args = args;
|
|
96276
|
+
return queued.promise;
|
|
96277
|
+
}
|
|
96278
|
+
let resolve;
|
|
96279
|
+
let reject;
|
|
96280
|
+
const promise = new Promise((res, rej) => {
|
|
96281
|
+
resolve = res;
|
|
96282
|
+
reject = rej;
|
|
96283
|
+
});
|
|
96284
|
+
queued = {
|
|
96285
|
+
context,
|
|
96286
|
+
args,
|
|
96287
|
+
resolve,
|
|
96288
|
+
reject,
|
|
96289
|
+
promise
|
|
96290
|
+
};
|
|
96291
|
+
return promise;
|
|
96292
|
+
};
|
|
96293
|
+
}
|
|
96207
96294
|
|
|
96208
96295
|
/***/ }),
|
|
96209
96296
|
|