@opentok/client 2.36.0-alpha.14 → 2.36.0-alpha.15
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 +74 -30
- 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 895d7e807
|
|
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: Wed, 29 Jul 2026 10:
|
|
8
|
+
* Date: Wed, 29 Jul 2026 10:30:07 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -9863,29 +9863,17 @@ var _interopRequireDefault = __webpack_require__(95709);
|
|
|
9863
9863
|
exports.__esModule = true;
|
|
9864
9864
|
exports["default"] = void 0;
|
|
9865
9865
|
var _getProtocolFromPriority = _interopRequireDefault(__webpack_require__(85045));
|
|
9866
|
-
var _default =
|
|
9867
|
-
|
|
9868
|
-
|
|
9869
|
-
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
const localCandidateId = activeCandidatePair.localCandidateId;
|
|
9874
|
-
if (localCandidateId) {
|
|
9875
|
-
const localCandidate = stats.get(localCandidateId);
|
|
9876
|
-
if (localCandidate) {
|
|
9877
|
-
const relayProtocol = localCandidate.relayProtocol,
|
|
9878
|
-
priority = localCandidate.priority;
|
|
9879
|
-
if (relayProtocol) {
|
|
9880
|
-
const RELAY_PROTOCOL = relayProtocol.toUpperCase();
|
|
9881
|
-
localRelayProtocol = `TURN/${RELAY_PROTOCOL}`;
|
|
9882
|
-
} else {
|
|
9883
|
-
localRelayProtocol = (0, _getProtocolFromPriority.default)(priority);
|
|
9884
|
-
}
|
|
9885
|
-
}
|
|
9866
|
+
var _default = localCandidate => {
|
|
9867
|
+
if (localCandidate) {
|
|
9868
|
+
const relayProtocol = localCandidate.relayProtocol,
|
|
9869
|
+
priority = localCandidate.priority;
|
|
9870
|
+
if (relayProtocol) {
|
|
9871
|
+
const RELAY_PROTOCOL = relayProtocol.toUpperCase();
|
|
9872
|
+
return `TURN/${RELAY_PROTOCOL}`;
|
|
9886
9873
|
}
|
|
9874
|
+
return (0, _getProtocolFromPriority.default)(priority);
|
|
9887
9875
|
}
|
|
9888
|
-
return
|
|
9876
|
+
return '';
|
|
9889
9877
|
};
|
|
9890
9878
|
exports["default"] = _default;
|
|
9891
9879
|
|
|
@@ -14472,6 +14460,40 @@ const getAddress = res => {
|
|
|
14472
14460
|
const ip = res.ipAddress || res.address || res.ip;
|
|
14473
14461
|
return `${ip}:${port}`;
|
|
14474
14462
|
};
|
|
14463
|
+
const getCandidatesInfo = (activeCandidatePair, stats) => {
|
|
14464
|
+
let localRelayProtocol;
|
|
14465
|
+
let localCandidateType;
|
|
14466
|
+
let localAddress;
|
|
14467
|
+
let transportType;
|
|
14468
|
+
let remoteCandidateType;
|
|
14469
|
+
let remoteAddress;
|
|
14470
|
+
const localCandidateId = activeCandidatePair.localCandidateId,
|
|
14471
|
+
remoteCandidateId = activeCandidatePair.remoteCandidateId;
|
|
14472
|
+
if (localCandidateId) {
|
|
14473
|
+
const localCandidate = stats.get(localCandidateId);
|
|
14474
|
+
if (localCandidate) {
|
|
14475
|
+
localRelayProtocol = (0, _getLocalRelayProtocol.default)(localCandidate);
|
|
14476
|
+
localCandidateType = localCandidate.candidateType;
|
|
14477
|
+
localAddress = getAddress(localCandidate);
|
|
14478
|
+
transportType = localCandidate.protocol || localCandidate.transport;
|
|
14479
|
+
}
|
|
14480
|
+
}
|
|
14481
|
+
if (remoteCandidateId) {
|
|
14482
|
+
const remoteCandidate = stats.get(remoteCandidateId);
|
|
14483
|
+
if (remoteCandidate) {
|
|
14484
|
+
remoteCandidateType = remoteCandidate.candidateType;
|
|
14485
|
+
remoteAddress = getAddress(remoteCandidate);
|
|
14486
|
+
}
|
|
14487
|
+
}
|
|
14488
|
+
return {
|
|
14489
|
+
localRelayProtocol,
|
|
14490
|
+
localCandidateType,
|
|
14491
|
+
localAddress,
|
|
14492
|
+
transportType,
|
|
14493
|
+
remoteCandidateType,
|
|
14494
|
+
remoteAddress
|
|
14495
|
+
};
|
|
14496
|
+
};
|
|
14475
14497
|
|
|
14476
14498
|
// Get Stats using the older API. Used by Chrome up until v58.
|
|
14477
14499
|
function parseStatsOldAPI(statsCache, prevStats, currentStats, isPublisher, completion) {
|
|
@@ -14791,15 +14813,27 @@ function parseStatsNewAPI(statsCache, prevStats, currentStats, isPublisher, comp
|
|
|
14791
14813
|
srtpCipher = res.srtpCipher;
|
|
14792
14814
|
currentStats.srtpCipher = srtpCipher;
|
|
14793
14815
|
if (selectedCandidatePairId) {
|
|
14794
|
-
|
|
14816
|
+
const activeCandidatePair = stats.get(selectedCandidatePairId);
|
|
14817
|
+
if (activeCandidatePair) {
|
|
14818
|
+
var _getCandidatesInfo = getCandidatesInfo(activeCandidatePair, stats);
|
|
14819
|
+
localRelayProtocol = _getCandidatesInfo.localRelayProtocol;
|
|
14820
|
+
localCandidateType = _getCandidatesInfo.localCandidateType;
|
|
14821
|
+
localAddress = _getCandidatesInfo.localAddress;
|
|
14822
|
+
transportType = _getCandidatesInfo.transportType;
|
|
14823
|
+
remoteCandidateType = _getCandidatesInfo.remoteCandidateType;
|
|
14824
|
+
remoteAddress = _getCandidatesInfo.remoteAddress;
|
|
14825
|
+
}
|
|
14795
14826
|
}
|
|
14796
14827
|
} else if (strippedType === 'localcandidate') {
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14828
|
+
var _localRelayProtocol, _localCandidateType, _localAddress, _transportType;
|
|
14829
|
+
(_localRelayProtocol = localRelayProtocol) != null ? _localRelayProtocol : localRelayProtocol = (0, _getLocalRelayProtocol.default)(res);
|
|
14830
|
+
(_localCandidateType = localCandidateType) != null ? _localCandidateType : localCandidateType = res.candidateType;
|
|
14831
|
+
(_localAddress = localAddress) != null ? _localAddress : localAddress = getAddress(res);
|
|
14832
|
+
(_transportType = transportType) != null ? _transportType : transportType = res.protocol || res.transport;
|
|
14800
14833
|
} else if (strippedType === 'remotecandidate') {
|
|
14801
|
-
|
|
14802
|
-
|
|
14834
|
+
var _remoteCandidateType, _remoteAddress;
|
|
14835
|
+
(_remoteCandidateType = remoteCandidateType) != null ? _remoteCandidateType : remoteCandidateType = res.candidateType;
|
|
14836
|
+
(_remoteAddress = remoteAddress) != null ? _remoteAddress : remoteAddress = getAddress(res);
|
|
14803
14837
|
} else if (strippedType === 'track' && lowercaseId.indexOf('video') !== 0) {
|
|
14804
14838
|
frameWidth = res.frameWidth;
|
|
14805
14839
|
frameHeight = res.frameHeight;
|
|
@@ -14819,6 +14853,15 @@ function parseStatsNewAPI(statsCache, prevStats, currentStats, isPublisher, comp
|
|
|
14819
14853
|
const estimatedStat = `video${isPublisher ? 'Sent' : 'Recv'}EstimatedBandwidth`;
|
|
14820
14854
|
currentStats[estimatedStat] = parseInt(res.availableOutgoingBitrate, 10);
|
|
14821
14855
|
}
|
|
14856
|
+
if (res.selected) {
|
|
14857
|
+
var _getCandidatesInfo2 = getCandidatesInfo(res, stats);
|
|
14858
|
+
localRelayProtocol = _getCandidatesInfo2.localRelayProtocol;
|
|
14859
|
+
localCandidateType = _getCandidatesInfo2.localCandidateType;
|
|
14860
|
+
localAddress = _getCandidatesInfo2.localAddress;
|
|
14861
|
+
transportType = _getCandidatesInfo2.transportType;
|
|
14862
|
+
remoteCandidateType = _getCandidatesInfo2.remoteCandidateType;
|
|
14863
|
+
remoteAddress = _getCandidatesInfo2.remoteAddress;
|
|
14864
|
+
}
|
|
14822
14865
|
}
|
|
14823
14866
|
};
|
|
14824
14867
|
|
|
@@ -39823,7 +39866,7 @@ function staticConfigFactory(_temp) {
|
|
|
39823
39866
|
_ref$axios = _ref.axios,
|
|
39824
39867
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
39825
39868
|
_ref$properties = _ref.properties,
|
|
39826
|
-
properties = _ref$properties === void 0 ? {"version":"v2.36.0","buildHash":"
|
|
39869
|
+
properties = _ref$properties === void 0 ? {"version":"v2.36.0","buildHash":"895d7e807","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;
|
|
39827
39870
|
/** @type builtInConfig */
|
|
39828
39871
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
39829
39872
|
/**
|
|
@@ -94782,6 +94825,7 @@ module.exports = isString;
|
|
|
94782
94825
|
exports.__esModule = true;
|
|
94783
94826
|
exports["default"] = void 0;
|
|
94784
94827
|
var _default = priority => {
|
|
94828
|
+
if (typeof priority !== 'number') return '';
|
|
94785
94829
|
switch (priority >> 24) {
|
|
94786
94830
|
// eslint-disable-line no-bitwise
|
|
94787
94831
|
case 0:
|