@opentok/client 2.35.0-alpha.22 → 2.35.0-alpha.23
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 +101 -91
- 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.35.0
|
|
2
|
+
* @license OpenTok.js 2.35.0 b3cd7abe5
|
|
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, 13 May 2026
|
|
8
|
+
* Date: Wed, 13 May 2026 13:03:31 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -5059,6 +5059,7 @@ function SinglePeerConnectionAdapterFactory(deps) {
|
|
|
5059
5059
|
};
|
|
5060
5060
|
|
|
5061
5061
|
// SPC events wrapper for PeerConnection
|
|
5062
|
+
const _onIceRestartAttempt = ev => this.trigger('iceRestartAttempt', ev);
|
|
5062
5063
|
const _onClosed = () => this.trigger('close');
|
|
5063
5064
|
const _onRemoteVideoSupported = supported => this.trigger('remoteVideoSupported', supported);
|
|
5064
5065
|
const _onPeerError = _ref => {
|
|
@@ -5100,6 +5101,7 @@ function SinglePeerConnectionAdapterFactory(deps) {
|
|
|
5100
5101
|
error: _onPeerError,
|
|
5101
5102
|
qos: _onQoS,
|
|
5102
5103
|
iceConnectionStateChange: _onIceConnectionStateChanged,
|
|
5104
|
+
iceRestartAttempt: _onIceRestartAttempt,
|
|
5103
5105
|
remoteVideoSupported: _onRemoteVideoSupported,
|
|
5104
5106
|
decryptFailed: _onDecryptFailed,
|
|
5105
5107
|
decryptRestored: _onDecryptRestored
|
|
@@ -5210,7 +5212,7 @@ function SinglePeerConnectionAdapterFactory(deps) {
|
|
|
5210
5212
|
};
|
|
5211
5213
|
this.remoteStreams = () => _peerConnection.remoteStreams();
|
|
5212
5214
|
this.hasRelayCandidates = () => _peerConnection.hasRelayCandidates();
|
|
5213
|
-
this.iceRestart = () => _peerConnection.iceRestart();
|
|
5215
|
+
this.iceRestart = (reason, forcedRestart) => _peerConnection.iceRestart(reason, forcedRestart);
|
|
5214
5216
|
this.iceConnectionStateIsConnected = () => _peerConnection.iceConnectionStateIsConnected();
|
|
5215
5217
|
this.startDecryption = (connectionId, transceiver) => _peerConnection.startDecryption(connectionId, transceiver);
|
|
5216
5218
|
};
|
|
@@ -6437,6 +6439,10 @@ function PublisherPeerConnectionFactory(deps) {
|
|
|
6437
6439
|
const statsHelpers = getStatsHelpers();
|
|
6438
6440
|
|
|
6439
6441
|
// Private
|
|
6442
|
+
const _onIceRestartAttempt = ev => {
|
|
6443
|
+
_awaitingIceRestart = true;
|
|
6444
|
+
this.trigger('iceRestartAttempt', ev);
|
|
6445
|
+
};
|
|
6440
6446
|
const _onPeerClosed = function _onPeerClosed() {
|
|
6441
6447
|
this.destroy();
|
|
6442
6448
|
if (_awaitingIceRestart) {
|
|
@@ -6622,7 +6628,8 @@ function PublisherPeerConnectionFactory(deps) {
|
|
|
6622
6628
|
close: _onPeerClosed,
|
|
6623
6629
|
error: _onPeerError,
|
|
6624
6630
|
qos: _qos => this.trigger('qos', _qos),
|
|
6625
|
-
iceConnectionStateChange: _onIceConnectionStateChange
|
|
6631
|
+
iceConnectionStateChange: _onIceConnectionStateChange,
|
|
6632
|
+
iceRestartAttempt: _onIceRestartAttempt
|
|
6626
6633
|
}, this);
|
|
6627
6634
|
_peerConnection.addLocalStream(webRTCStream).then(() => {
|
|
6628
6635
|
completion(undefined);
|
|
@@ -6638,11 +6645,9 @@ function PublisherPeerConnectionFactory(deps) {
|
|
|
6638
6645
|
this.getSenders = function () {
|
|
6639
6646
|
return _peerConnection.getSenders();
|
|
6640
6647
|
};
|
|
6641
|
-
this.iceRestart = function () {
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
_peerConnection.iceRestart();
|
|
6645
|
-
}
|
|
6648
|
+
this.iceRestart = function (reason, forcedRestart) {
|
|
6649
|
+
var _peerConnection2;
|
|
6650
|
+
(_peerConnection2 = _peerConnection) == null ? void 0 : _peerConnection2.iceRestart(reason, forcedRestart);
|
|
6646
6651
|
};
|
|
6647
6652
|
this.hasRelayCandidates = () => _peerConnection.hasRelayCandidates();
|
|
6648
6653
|
this.iceConnectionStateIsConnected = function () {
|
|
@@ -20048,6 +20053,10 @@ function SubscriberPeerConnectionFactory(deps) {
|
|
|
20048
20053
|
const _audioTracks = [];
|
|
20049
20054
|
|
|
20050
20055
|
// Private
|
|
20056
|
+
const _onIceRestartAttempt = ev => {
|
|
20057
|
+
_awaitingIceRestart = true;
|
|
20058
|
+
this.trigger('iceRestartAttempt', ev);
|
|
20059
|
+
};
|
|
20051
20060
|
const _onPeerClosed = function _onPeerClosed() {
|
|
20052
20061
|
this.destroy();
|
|
20053
20062
|
if (_awaitingIceRestart) {
|
|
@@ -20239,9 +20248,8 @@ function SubscriberPeerConnectionFactory(deps) {
|
|
|
20239
20248
|
this.hasRelayCandidates = function () {
|
|
20240
20249
|
return _peerConnection.hasRelayCandidates();
|
|
20241
20250
|
};
|
|
20242
|
-
this.iceRestart = function () {
|
|
20243
|
-
|
|
20244
|
-
return _peerConnection.iceRestart();
|
|
20251
|
+
this.iceRestart = function (reason, forcedRestart) {
|
|
20252
|
+
return _peerConnection.iceRestart(reason, forcedRestart);
|
|
20245
20253
|
};
|
|
20246
20254
|
this.iceConnectionStateIsConnected = function () {
|
|
20247
20255
|
return _peerConnection.iceConnectionStateIsConnected();
|
|
@@ -20292,6 +20300,7 @@ function SubscriberPeerConnectionFactory(deps) {
|
|
|
20292
20300
|
error: _onPeerError,
|
|
20293
20301
|
qos: _qos => this.trigger('qos', _qos),
|
|
20294
20302
|
iceConnectionStateChange: _onIceConnectionStateChange,
|
|
20303
|
+
iceRestartAttempt: _onIceRestartAttempt,
|
|
20295
20304
|
remoteVideoSupported: _onRemoteVideoSupported,
|
|
20296
20305
|
decryptFailed: _onDecryptFailed,
|
|
20297
20306
|
decryptRestored: _onDecryptRestored
|
|
@@ -24498,8 +24507,8 @@ function SubscriberFactory(_ref2) {
|
|
|
24498
24507
|
logAnalyticsEvent('Subscribe', variation, payload, options);
|
|
24499
24508
|
}
|
|
24500
24509
|
};
|
|
24501
|
-
const logResubscribe = (variation, payload) => {
|
|
24502
|
-
logAnalyticsEvent('ICERestart', variation, payload);
|
|
24510
|
+
const logResubscribe = (variation, payload, options) => {
|
|
24511
|
+
logAnalyticsEvent('ICERestart', variation, payload, options);
|
|
24503
24512
|
};
|
|
24504
24513
|
const recordQOS = _ref13 => {
|
|
24505
24514
|
var _session$connection$c, _session8, _session8$connection, _properties$preferred, _properties$preferred2, _socket;
|
|
@@ -25223,13 +25232,17 @@ function SubscriberFactory(_ref2) {
|
|
|
25223
25232
|
_subscriberConnectionState = currentConnectionState;
|
|
25224
25233
|
}
|
|
25225
25234
|
};
|
|
25226
|
-
const
|
|
25227
|
-
|
|
25228
|
-
|
|
25229
|
-
|
|
25230
|
-
|
|
25231
|
-
|
|
25232
|
-
|
|
25235
|
+
const onIceRestartAction = (ev, variation, peerConnection, peerId) => {
|
|
25236
|
+
const sourceStreamId = peerConnection.getSourceStreamId();
|
|
25237
|
+
const payload = {
|
|
25238
|
+
isActive: sourceStreamId === _activeSourceStreamId
|
|
25239
|
+
};
|
|
25240
|
+
if (variation === 'Attempt' && ev != null && ev.reason) {
|
|
25241
|
+
payload.reason = ev.reason;
|
|
25242
|
+
}
|
|
25243
|
+
logResubscribe(variation, payload, {
|
|
25244
|
+
peerId,
|
|
25245
|
+
sourceStreamId
|
|
25233
25246
|
});
|
|
25234
25247
|
};
|
|
25235
25248
|
const streamUpdated = event => {
|
|
@@ -25518,7 +25531,7 @@ function SubscriberFactory(_ref2) {
|
|
|
25518
25531
|
return _ref22.apply(this, arguments);
|
|
25519
25532
|
};
|
|
25520
25533
|
}();
|
|
25521
|
-
const setPeerConnectionEvents = (peerConnection, sourceStreamId) => {
|
|
25534
|
+
const setPeerConnectionEvents = (peerConnection, sourceStreamId, peerId) => {
|
|
25522
25535
|
if (_peerConnectionEvents[sourceStreamId]) {
|
|
25523
25536
|
_peerConnectionEvents[sourceStreamId].removeAll();
|
|
25524
25537
|
const onDisconnected = () => {
|
|
@@ -25576,8 +25589,9 @@ function SubscriberFactory(_ref2) {
|
|
|
25576
25589
|
}, _callee13);
|
|
25577
25590
|
})));
|
|
25578
25591
|
peerConnectionEvents.on('iceConnectionStateChange', state => onIceConnectionStateChange(state, peerConnection));
|
|
25579
|
-
peerConnectionEvents.on('
|
|
25580
|
-
peerConnectionEvents.on('
|
|
25592
|
+
peerConnectionEvents.on('iceRestartAttempt', ev => onIceRestartAction(ev, 'Attempt', peerConnection, peerId));
|
|
25593
|
+
peerConnectionEvents.on('iceRestartSuccess', ev => onIceRestartAction(ev, 'Success', peerConnection, peerId));
|
|
25594
|
+
peerConnectionEvents.on('iceRestartFailure', ev => onIceRestartAction(ev, 'Failure', peerConnection, peerId));
|
|
25581
25595
|
peerConnectionEvents.on('remoteVideoSupported', onRemoteVideoSupported);
|
|
25582
25596
|
peerConnectionEvents.on('decryptFailed', () => {
|
|
25583
25597
|
this.trigger('encryptionSecretMismatch');
|
|
@@ -25877,7 +25891,8 @@ function SubscriberFactory(_ref2) {
|
|
|
25877
25891
|
send,
|
|
25878
25892
|
log,
|
|
25879
25893
|
logQoS,
|
|
25880
|
-
sourceStreamId
|
|
25894
|
+
sourceStreamId,
|
|
25895
|
+
peerId
|
|
25881
25896
|
}));
|
|
25882
25897
|
case 6:
|
|
25883
25898
|
case "end":
|
|
@@ -26735,11 +26750,11 @@ function SubscriberFactory(_ref2) {
|
|
|
26735
26750
|
};
|
|
26736
26751
|
this._setupPeerConnection = /*#__PURE__*/function () {
|
|
26737
26752
|
var _ref35 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(_ref34) {
|
|
26738
|
-
var send, log, logQoS, sourceStreamId;
|
|
26753
|
+
var send, log, logQoS, sourceStreamId, peerId;
|
|
26739
26754
|
return _regenerator.default.wrap(function _callee19$(_context19) {
|
|
26740
26755
|
while (1) switch (_context19.prev = _context19.next) {
|
|
26741
26756
|
case 0:
|
|
26742
|
-
send = _ref34.send, log = _ref34.log, logQoS = _ref34.logQoS, sourceStreamId = _ref34.sourceStreamId;
|
|
26757
|
+
send = _ref34.send, log = _ref34.log, logQoS = _ref34.logQoS, sourceStreamId = _ref34.sourceStreamId, peerId = _ref34.peerId;
|
|
26743
26758
|
if (_properties.testNetwork) {
|
|
26744
26759
|
_this.setAudioVolume(0);
|
|
26745
26760
|
}
|
|
@@ -26779,7 +26794,7 @@ function SubscriberFactory(_ref2) {
|
|
|
26779
26794
|
peerConnection.once('iceConnected', _pcConnected.resolve);
|
|
26780
26795
|
peerConnection.once('error', _pcConnected.reject);
|
|
26781
26796
|
peerConnection.on('qos', logQoS);
|
|
26782
|
-
setPeerConnectionEvents(peerConnection, sourceStreamId);
|
|
26797
|
+
setPeerConnectionEvents(peerConnection, sourceStreamId, peerId);
|
|
26783
26798
|
|
|
26784
26799
|
// initialize the peer connection AFTER we've added the event listeners
|
|
26785
26800
|
peerConnection.init(err => {
|
|
@@ -26911,15 +26926,9 @@ function SubscriberFactory(_ref2) {
|
|
|
26911
26926
|
logging.debug('Subscriber: Skipping ice restart, we have no peer connection');
|
|
26912
26927
|
return _context21.abrupt("return");
|
|
26913
26928
|
case 12:
|
|
26914
|
-
logResubscribe('Attempt', {
|
|
26915
|
-
reason
|
|
26916
|
-
});
|
|
26917
26929
|
logging.debug('Subscriber: iceRestart attempt');
|
|
26918
|
-
peerConnection.iceRestart();
|
|
26919
|
-
|
|
26920
|
-
peerConnection.generateOffer();
|
|
26921
|
-
}
|
|
26922
|
-
case 16:
|
|
26930
|
+
peerConnection.iceRestart(reason, forcedRestart);
|
|
26931
|
+
case 14:
|
|
26923
26932
|
case "end":
|
|
26924
26933
|
return _context21.stop();
|
|
26925
26934
|
}
|
|
@@ -41649,7 +41658,7 @@ function staticConfigFactory(_temp) {
|
|
|
41649
41658
|
_ref$axios = _ref.axios,
|
|
41650
41659
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
41651
41660
|
_ref$properties = _ref.properties,
|
|
41652
|
-
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"
|
|
41661
|
+
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"b3cd7abe5","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;
|
|
41653
41662
|
/** @type builtInConfig */
|
|
41654
41663
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
41655
41664
|
/**
|
|
@@ -43878,8 +43887,8 @@ function PublisherFactory(_ref) {
|
|
|
43878
43887
|
logAnalyticsEvent('Publish', variation, payload, logOptions);
|
|
43879
43888
|
}
|
|
43880
43889
|
};
|
|
43881
|
-
const logRepublish = (variation, payload) => {
|
|
43882
|
-
logAnalyticsEvent('ICERestart', variation, payload);
|
|
43890
|
+
const logRepublish = (variation, payload, logOptions) => {
|
|
43891
|
+
logAnalyticsEvent('ICERestart', variation, payload, logOptions);
|
|
43883
43892
|
};
|
|
43884
43893
|
const logHybridSessionTransition = (action, variation, payload) => {
|
|
43885
43894
|
if (variation === 'Attempt') {
|
|
@@ -44398,34 +44407,29 @@ function PublisherFactory(_ref) {
|
|
|
44398
44407
|
var _this$session8, _this$session8$sessio;
|
|
44399
44408
|
return ((_this$session8 = this.session) == null ? void 0 : (_this$session8$sessio = _this$session8.sessionInfo) == null ? void 0 : _this$session8$sessio.isAdaptiveEnabled) && peerConnection.getSourceStreamId() === 'P2P';
|
|
44400
44409
|
};
|
|
44401
|
-
const
|
|
44410
|
+
const onIceRestartAction = (ev, variation, peerConnection) => {
|
|
44402
44411
|
const _getPeerConnectionMet4 = getPeerConnectionMeta(peerConnection),
|
|
44412
|
+
peerId = _getPeerConnectionMet4.peerId,
|
|
44403
44413
|
remoteConnectionId = _getPeerConnectionMet4.remoteConnectionId,
|
|
44404
44414
|
sourceStreamId = _getPeerConnectionMet4.sourceStreamId;
|
|
44405
|
-
|
|
44406
|
-
remoteConnectionId
|
|
44407
|
-
});
|
|
44408
|
-
if (sourceStreamId === 'MANTIS' && activeSourceStreamId === 'P2P') {
|
|
44415
|
+
if (variation === 'Success' && sourceStreamId === 'MANTIS' && activeSourceStreamId === 'P2P') {
|
|
44409
44416
|
_keepSendingRtcpToMantis(true);
|
|
44410
44417
|
}
|
|
44411
|
-
|
|
44412
|
-
|
|
44413
|
-
|
|
44414
|
-
|
|
44415
|
-
|
|
44416
|
-
reason
|
|
44417
|
-
|
|
44418
|
-
|
|
44418
|
+
const payload = {
|
|
44419
|
+
remoteConnectionId,
|
|
44420
|
+
isActive: sourceStreamId === activeSourceStreamId
|
|
44421
|
+
};
|
|
44422
|
+
if (variation === 'Attempt' && ev != null && ev.reason) {
|
|
44423
|
+
payload.reason = ev.reason;
|
|
44424
|
+
}
|
|
44425
|
+
logRepublish(variation, payload, {
|
|
44426
|
+
peerId,
|
|
44427
|
+
sourceStreamId
|
|
44419
44428
|
});
|
|
44420
44429
|
};
|
|
44421
44430
|
const handleDisconnect = peerConnection => {
|
|
44422
44431
|
if (_session._.isSocketConnected()) {
|
|
44423
|
-
|
|
44424
|
-
remoteConnectionId = _getPeerConnectionMet6.remoteConnectionId;
|
|
44425
|
-
logRepublish('Attempt', {
|
|
44426
|
-
remoteConnectionId
|
|
44427
|
-
});
|
|
44428
|
-
peerConnection.iceRestart();
|
|
44432
|
+
peerConnection.iceRestart('peer connection disconnected');
|
|
44429
44433
|
}
|
|
44430
44434
|
};
|
|
44431
44435
|
const handleConnect = /*#__PURE__*/function () {
|
|
@@ -44564,9 +44568,9 @@ function PublisherFactory(_ref) {
|
|
|
44564
44568
|
if (isRoutedToRelayedTransitionComplete(peerConnection)) {
|
|
44565
44569
|
logRoutedToRelayedTransition('Success');
|
|
44566
44570
|
}
|
|
44567
|
-
const
|
|
44568
|
-
peerConnectionId =
|
|
44569
|
-
remoteSubscriberId =
|
|
44571
|
+
const _getPeerConnectionMet5 = getPeerConnectionMeta(peerConnection),
|
|
44572
|
+
peerConnectionId = _getPeerConnectionMet5.peerConnectionId,
|
|
44573
|
+
remoteSubscriberId = _getPeerConnectionMet5.remoteSubscriberId;
|
|
44570
44574
|
(_publisherSenderStats2 = publisherSenderStats) == null ? void 0 : _publisherSenderStats2.addConnection(peerConnection, peerConnectionId, remoteSubscriberId);
|
|
44571
44575
|
if (properties.publishVideo) {
|
|
44572
44576
|
if (videoQualityChangedListenersCount > 0) {
|
|
@@ -44704,8 +44708,9 @@ function PublisherFactory(_ref) {
|
|
|
44704
44708
|
});
|
|
44705
44709
|
},
|
|
44706
44710
|
qos: logQoS,
|
|
44707
|
-
|
|
44708
|
-
|
|
44711
|
+
iceRestartAttempt: ev => onIceRestartAction(ev, 'Attempt', peerConnection),
|
|
44712
|
+
iceRestartSuccess: ev => onIceRestartAction(ev, 'Success', peerConnection),
|
|
44713
|
+
iceRestartFailure: ev => onIceRestartAction(ev, 'Failure', peerConnection),
|
|
44709
44714
|
iceConnectionStateChange: newState => onIceConnectionStateChange(newState, peerConnection),
|
|
44710
44715
|
audioAcquisitionProblem: () => {
|
|
44711
44716
|
audioAcquisitionProblemDetected = true;
|
|
@@ -44726,9 +44731,9 @@ function PublisherFactory(_ref) {
|
|
|
44726
44731
|
peerId: getPeerConnectionMeta(peerConnection).peerId
|
|
44727
44732
|
})),
|
|
44728
44733
|
videoQualityChanged: ev => {
|
|
44729
|
-
const
|
|
44730
|
-
remoteConnectionId =
|
|
44731
|
-
remoteSubscriberId =
|
|
44734
|
+
const _getPeerConnectionMet6 = getPeerConnectionMeta(peerConnection),
|
|
44735
|
+
remoteConnectionId = _getPeerConnectionMet6.remoteConnectionId,
|
|
44736
|
+
remoteSubscriberId = _getPeerConnectionMet6.remoteSubscriberId;
|
|
44732
44737
|
const statsContainer = (0, _assign.default)(remoteConnectionId.match(/^symphony\./) ? {} : {
|
|
44733
44738
|
subscriberId: remoteSubscriberId,
|
|
44734
44739
|
connectionId: remoteConnectionId
|
|
@@ -44957,9 +44962,9 @@ function PublisherFactory(_ref) {
|
|
|
44957
44962
|
results = pcsAndStats.map(_ref22 => {
|
|
44958
44963
|
let pc = _ref22.pc,
|
|
44959
44964
|
stats = _ref22.stats;
|
|
44960
|
-
const
|
|
44961
|
-
remoteConnectionId =
|
|
44962
|
-
remoteSubscriberId =
|
|
44965
|
+
const _getPeerConnectionMet7 = getPeerConnectionMeta(pc),
|
|
44966
|
+
remoteConnectionId = _getPeerConnectionMet7.remoteConnectionId,
|
|
44967
|
+
remoteSubscriberId = _getPeerConnectionMet7.remoteSubscriberId;
|
|
44963
44968
|
return (0, _assign.default)(remoteConnectionId.match(/^symphony\./) ? {} : {
|
|
44964
44969
|
subscriberId: remoteSubscriberId,
|
|
44965
44970
|
connectionId: remoteConnectionId
|
|
@@ -47879,7 +47884,7 @@ function PublisherFactory(_ref) {
|
|
|
47879
47884
|
clearTimeout(_migrationTimeoutId);
|
|
47880
47885
|
const destroyPeerConnection = /*#__PURE__*/function () {
|
|
47881
47886
|
var _ref59 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49(pc) {
|
|
47882
|
-
var
|
|
47887
|
+
var _getPeerConnectionMet8, peerConnectionId;
|
|
47883
47888
|
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
47884
47889
|
while (1) switch (_context49.prev = _context49.next) {
|
|
47885
47890
|
case 0:
|
|
@@ -47890,7 +47895,7 @@ function PublisherFactory(_ref) {
|
|
|
47890
47895
|
_context49.next = 3;
|
|
47891
47896
|
return _publisherStatsHelper.removePeerConnection(pc);
|
|
47892
47897
|
case 3:
|
|
47893
|
-
|
|
47898
|
+
_getPeerConnectionMet8 = getPeerConnectionMeta(pc), peerConnectionId = _getPeerConnectionMet8.peerConnectionId;
|
|
47894
47899
|
delete peerConnectionsAsync[peerConnectionId];
|
|
47895
47900
|
pc.off('iceConnectionStateChange');
|
|
47896
47901
|
pc.destroy();
|
|
@@ -48005,22 +48010,14 @@ function PublisherFactory(_ref) {
|
|
|
48005
48010
|
peerConnection.getDataChannel(label, getOptions, completion);
|
|
48006
48011
|
});
|
|
48007
48012
|
},
|
|
48008
|
-
iceRestart(forcedRestart) {
|
|
48013
|
+
iceRestart(reason, forcedRestart) {
|
|
48009
48014
|
if (forcedRestart === void 0) {
|
|
48010
48015
|
forcedRestart = false;
|
|
48011
48016
|
}
|
|
48012
48017
|
getAllPeerConnections().then(peerConnections => {
|
|
48013
48018
|
peerConnections.forEach(peerConnection => {
|
|
48014
|
-
const _getPeerConnectionMet11 = getPeerConnectionMeta(peerConnection),
|
|
48015
|
-
remoteConnectionId = _getPeerConnectionMet11.remoteConnectionId;
|
|
48016
|
-
logRepublish('Attempt', {
|
|
48017
|
-
remoteConnectionId
|
|
48018
|
-
});
|
|
48019
48019
|
logging.debug('Publisher: ice restart attempt');
|
|
48020
|
-
peerConnection.iceRestart();
|
|
48021
|
-
if (forcedRestart) {
|
|
48022
|
-
peerConnection.generateOffer();
|
|
48023
|
-
}
|
|
48020
|
+
peerConnection.iceRestart(reason, forcedRestart);
|
|
48024
48021
|
});
|
|
48025
48022
|
});
|
|
48026
48023
|
},
|
|
@@ -65924,13 +65921,16 @@ function PeerConnectionFactory(deps) {
|
|
|
65924
65921
|
iceRestartTimeout = null;
|
|
65925
65922
|
}
|
|
65926
65923
|
};
|
|
65927
|
-
const _createOfferWithIceRestart =
|
|
65924
|
+
const _createOfferWithIceRestart = (reason, forcedRestart, recentlyIceRestartNeeded) => {
|
|
65928
65925
|
clearIceRestartTimeout();
|
|
65929
|
-
if (!api.iceConnectionStateIsConnected()) {
|
|
65930
|
-
if (
|
|
65926
|
+
if (forcedRestart || !api.iceConnectionStateIsConnected()) {
|
|
65927
|
+
if (forcedRestart || recentlyIceRestartNeeded) {
|
|
65928
|
+
api.trigger('iceRestartAttempt', {
|
|
65929
|
+
reason
|
|
65930
|
+
});
|
|
65931
65931
|
api.generateOfferAndSend();
|
|
65932
65932
|
} else {
|
|
65933
|
-
debouncedGenerateOfferAndSend();
|
|
65933
|
+
debouncedGenerateOfferAndSend(reason);
|
|
65934
65934
|
}
|
|
65935
65935
|
} else {
|
|
65936
65936
|
logging.debug('iceRestart is going to wait until we disconnect or negotiationNeeded' + ' and then restart ice');
|
|
@@ -65941,20 +65941,25 @@ function PeerConnectionFactory(deps) {
|
|
|
65941
65941
|
};
|
|
65942
65942
|
const _iceRestartNeeded = (() => {
|
|
65943
65943
|
let value = false;
|
|
65944
|
+
let reason;
|
|
65944
65945
|
let lastIceRestartNeededTime = 0;
|
|
65945
65946
|
return {
|
|
65946
65947
|
get() {
|
|
65947
65948
|
return value;
|
|
65948
65949
|
},
|
|
65949
|
-
set(newValueParam) {
|
|
65950
|
+
set(newValueParam, iceRestartReason, forcedRestart) {
|
|
65951
|
+
if (forcedRestart === void 0) {
|
|
65952
|
+
forcedRestart = false;
|
|
65953
|
+
}
|
|
65950
65954
|
const newValue = Boolean(newValueParam);
|
|
65951
65955
|
if (newValue !== value) {
|
|
65952
65956
|
value = newValue;
|
|
65957
|
+
reason = iceRestartReason;
|
|
65953
65958
|
if (value) {
|
|
65954
65959
|
const prevIceRestartNeededTime = lastIceRestartNeededTime;
|
|
65955
65960
|
lastIceRestartNeededTime = Date.now();
|
|
65956
65961
|
const recentlyIceRestartNeeded = lastIceRestartNeededTime - prevIceRestartNeededTime < 10000;
|
|
65957
|
-
_createOfferWithIceRestart(recentlyIceRestartNeeded);
|
|
65962
|
+
_createOfferWithIceRestart(reason, forcedRestart, recentlyIceRestartNeeded);
|
|
65958
65963
|
} else {
|
|
65959
65964
|
clearIceRestartTimeout();
|
|
65960
65965
|
debouncedGenerateOfferAndSend.cancel();
|
|
@@ -65964,7 +65969,7 @@ function PeerConnectionFactory(deps) {
|
|
|
65964
65969
|
run() {
|
|
65965
65970
|
if (value) {
|
|
65966
65971
|
clearIceRestartTimeout();
|
|
65967
|
-
debouncedGenerateOfferAndSend();
|
|
65972
|
+
debouncedGenerateOfferAndSend(reason);
|
|
65968
65973
|
}
|
|
65969
65974
|
return value;
|
|
65970
65975
|
}
|
|
@@ -66665,7 +66670,12 @@ function PeerConnectionFactory(deps) {
|
|
|
66665
66670
|
};
|
|
66666
66671
|
api.generateOffer(offerSender);
|
|
66667
66672
|
};
|
|
66668
|
-
const debouncedGenerateOfferAndSend = debounce(
|
|
66673
|
+
const debouncedGenerateOfferAndSend = debounce(reason => {
|
|
66674
|
+
api.trigger('iceRestartAttempt', {
|
|
66675
|
+
reason
|
|
66676
|
+
});
|
|
66677
|
+
api.generateOfferAndSend();
|
|
66678
|
+
}, 2000);
|
|
66669
66679
|
api.generateOffer = debounce(function (onOfferCreated) {
|
|
66670
66680
|
if (onOfferCreated === void 0) {
|
|
66671
66681
|
onOfferCreated = () => {};
|
|
@@ -66834,7 +66844,7 @@ function PeerConnectionFactory(deps) {
|
|
|
66834
66844
|
setTimeout(tearDownPeerConnection);
|
|
66835
66845
|
}
|
|
66836
66846
|
};
|
|
66837
|
-
api.iceRestart = () => _iceRestartNeeded.set(true);
|
|
66847
|
+
api.iceRestart = (reason, forcedRestart) => _iceRestartNeeded.set(true, reason, forcedRestart);
|
|
66838
66848
|
api.clearFailedTimeout = () => {
|
|
66839
66849
|
if (_transitionToFailedTimeOut) {
|
|
66840
66850
|
clearTimeout(_transitionToFailedTimeOut);
|
|
@@ -71083,7 +71093,7 @@ function SessionFactory(deps) {
|
|
|
71083
71093
|
sessionObjects.publishers.where({
|
|
71084
71094
|
session: this
|
|
71085
71095
|
}).forEach(publisher => {
|
|
71086
|
-
publisher._.iceRestart();
|
|
71096
|
+
publisher._.iceRestart('socket reconnected');
|
|
71087
71097
|
});
|
|
71088
71098
|
if (!((_this$session = this.session) != null && (_this$session$session = _this$session.sessionInfo) != null && _this$session$session.p2pEnabled)) {
|
|
71089
71099
|
sessionObjects.subscribers.where({
|