@opentok/client 2.35.0-alpha.54 → 2.35.0-alpha.56
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 +513 -409
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +7 -7
- 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 3dc50499e
|
|
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, 17 Jun 2026 13:06:50 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -8502,6 +8502,7 @@ var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(79092));
|
|
|
8502
8502
|
var _createClass2 = _interopRequireDefault(__webpack_require__(65044));
|
|
8503
8503
|
var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(41972));
|
|
8504
8504
|
var _inheritsLoose2 = _interopRequireDefault(__webpack_require__(20310));
|
|
8505
|
+
var _uuid = _interopRequireDefault(__webpack_require__(68414));
|
|
8505
8506
|
var _logEvents = _interopRequireDefault(__webpack_require__(32901));
|
|
8506
8507
|
var _socketCloseCodes = __webpack_require__(1155);
|
|
8507
8508
|
var _Timer = _interopRequireDefault(__webpack_require__(44299));
|
|
@@ -8540,7 +8541,7 @@ var _default = _ref => {
|
|
|
8540
8541
|
_this._pingWarningTimer = void 0;
|
|
8541
8542
|
_this._disconnectTimer = void 0;
|
|
8542
8543
|
_this._missedAckTimer = void 0;
|
|
8543
|
-
_this._queuedMessages =
|
|
8544
|
+
_this._queuedMessages = new Map();
|
|
8544
8545
|
_this._draining = false;
|
|
8545
8546
|
_this._analytics = new AnalyticsHelper();
|
|
8546
8547
|
_this._logAnalyticsEvent = _ref2 => {
|
|
@@ -8595,8 +8596,9 @@ var _default = _ref => {
|
|
|
8595
8596
|
_this._resetDisconnectTimer();
|
|
8596
8597
|
_this._connectTimer.clear();
|
|
8597
8598
|
if (from === 'reconnecting') {
|
|
8598
|
-
|
|
8599
|
-
_this._queuedMessages =
|
|
8599
|
+
const queuedMessages = _this._queuedMessages;
|
|
8600
|
+
_this._queuedMessages = new Map();
|
|
8601
|
+
queuedMessages.forEach(msg => _this.send(msg));
|
|
8600
8602
|
_this.emit('reconnected');
|
|
8601
8603
|
_this._logAnalyticsEvent({
|
|
8602
8604
|
action: 'WebSocket:reconnect',
|
|
@@ -8850,7 +8852,8 @@ var _default = _ref => {
|
|
|
8850
8852
|
_proto.send = function send(_ref13) {
|
|
8851
8853
|
let data = _ref13.data,
|
|
8852
8854
|
retryAfterReconnect = _ref13.retryAfterReconnect,
|
|
8853
|
-
expectAck = _ref13.expectAck
|
|
8855
|
+
expectAck = _ref13.expectAck,
|
|
8856
|
+
transactionId = _ref13.transactionId;
|
|
8854
8857
|
// send deviates from WebSocket a little in that it returns a status instead of nothing.
|
|
8855
8858
|
|
|
8856
8859
|
if (this.readyState === ReconnectableSocket.OPEN) {
|
|
@@ -8884,7 +8887,7 @@ var _default = _ref => {
|
|
|
8884
8887
|
}
|
|
8885
8888
|
}
|
|
8886
8889
|
if (retryAfterReconnect) {
|
|
8887
|
-
this._queuedMessages.
|
|
8890
|
+
this._queuedMessages.set(transactionId != null ? transactionId : (0, _uuid.default)(), {
|
|
8888
8891
|
data,
|
|
8889
8892
|
retryAfterReconnect,
|
|
8890
8893
|
expectAck
|
|
@@ -8896,6 +8899,9 @@ var _default = _ref => {
|
|
|
8896
8899
|
}
|
|
8897
8900
|
return sendMessage();
|
|
8898
8901
|
};
|
|
8902
|
+
_proto.cancel = function cancel(transactionId) {
|
|
8903
|
+
this._queuedMessages.delete(transactionId);
|
|
8904
|
+
};
|
|
8899
8905
|
_proto.close = function close(code, reason) {
|
|
8900
8906
|
if (this.readyState === ReconnectableSocket.CLOSING) {
|
|
8901
8907
|
throw new Error('Can not call close on a closing ReconnectableSocket');
|
|
@@ -18324,7 +18330,8 @@ var _default = _ref => {
|
|
|
18324
18330
|
const status = this._socket.send({
|
|
18325
18331
|
data: rumorMessage.serialize(),
|
|
18326
18332
|
retryAfterReconnect: false,
|
|
18327
|
-
expectAck: true
|
|
18333
|
+
expectAck: true,
|
|
18334
|
+
transactionId: rumorMessage.transactionId
|
|
18328
18335
|
});
|
|
18329
18336
|
if (status === 'dropped' && !retryAfterReconnect) {
|
|
18330
18337
|
const error = new Error('Not connected.');
|
|
@@ -18339,6 +18346,11 @@ var _default = _ref => {
|
|
|
18339
18346
|
timestamp: Date.now()
|
|
18340
18347
|
});
|
|
18341
18348
|
};
|
|
18349
|
+
_proto.cancel = function cancel(transactionId) {
|
|
18350
|
+
this._pendingMessages.delete(transactionId);
|
|
18351
|
+
this._receivedTransactionIDs.add(transactionId);
|
|
18352
|
+
this._socket.cancel(transactionId);
|
|
18353
|
+
};
|
|
18342
18354
|
_proto.subscribe = function subscribe(topics) {
|
|
18343
18355
|
this._socket.send({
|
|
18344
18356
|
data: _RumorMessage.default.Subscribe(topics).serialize(),
|
|
@@ -26833,6 +26845,10 @@ function RaptorSocketFactory(deps) {
|
|
|
26833
26845
|
});
|
|
26834
26846
|
return transactionId;
|
|
26835
26847
|
};
|
|
26848
|
+
const cancelTransactionId = transactionId => {
|
|
26849
|
+
_dispatcher.cancelCallback(transactionId);
|
|
26850
|
+
this._rumor.cancel(transactionId);
|
|
26851
|
+
};
|
|
26836
26852
|
|
|
26837
26853
|
/**
|
|
26838
26854
|
* Like publish, but automaitcally serializes the message parameter
|
|
@@ -26885,9 +26901,12 @@ function RaptorSocketFactory(deps) {
|
|
|
26885
26901
|
customProperties
|
|
26886
26902
|
};
|
|
26887
26903
|
const message = RaptorMessage.streams.create(streamCreateOpts);
|
|
26888
|
-
this.publish(message, {}, true, (error, message) => {
|
|
26904
|
+
const transactionId = this.publish(message, {}, true, (error, message) => {
|
|
26889
26905
|
completion(error, streamId, message);
|
|
26890
26906
|
});
|
|
26907
|
+
return () => {
|
|
26908
|
+
cancelTransactionId(transactionId);
|
|
26909
|
+
};
|
|
26891
26910
|
};
|
|
26892
26911
|
this.streamDestroy = function (streamId, sourceStreamId) {
|
|
26893
26912
|
this.publish(RaptorMessage.streams.destroy(_apiKey, _sessionId, streamId, sourceStreamId), {}, true);
|
|
@@ -39183,7 +39202,7 @@ function staticConfigFactory(_temp) {
|
|
|
39183
39202
|
_ref$axios = _ref.axios,
|
|
39184
39203
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
39185
39204
|
_ref$properties = _ref.properties,
|
|
39186
|
-
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"
|
|
39205
|
+
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"3dc50499e","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;
|
|
39187
39206
|
/** @type builtInConfig */
|
|
39188
39207
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
39189
39208
|
/**
|
|
@@ -39715,6 +39734,9 @@ const Dispatcher = function Dispatcher() {
|
|
|
39715
39734
|
Dispatcher.prototype.registerCallback = function (transactionId, completion) {
|
|
39716
39735
|
this.callbacks[transactionId] = completion;
|
|
39717
39736
|
};
|
|
39737
|
+
Dispatcher.prototype.cancelCallback = function (transactionId) {
|
|
39738
|
+
delete this.callbacks[transactionId];
|
|
39739
|
+
};
|
|
39718
39740
|
Dispatcher.prototype.triggerCallback = function (transactionId) {
|
|
39719
39741
|
/* , arg1, arg2, argN-1, argN */
|
|
39720
39742
|
if (!transactionId) {
|
|
@@ -40992,6 +41014,7 @@ function PublisherFactory(_ref) {
|
|
|
40992
41014
|
let _preferredWidth;
|
|
40993
41015
|
let _preferredHeight;
|
|
40994
41016
|
let _preferredFrameRate;
|
|
41017
|
+
let _suppressVideoDimensionsSignaling = false;
|
|
40995
41018
|
let _targetScalabilityMode;
|
|
40996
41019
|
let _peerId;
|
|
40997
41020
|
let _raptorUri;
|
|
@@ -42403,38 +42426,43 @@ function PublisherFactory(_ref) {
|
|
|
42403
42426
|
shouldAllowAudio,
|
|
42404
42427
|
logAnalyticsEvent
|
|
42405
42428
|
});
|
|
42406
|
-
const reset = ()
|
|
42429
|
+
const reset = function reset(afterPublishError) {
|
|
42407
42430
|
var _publisherSenderStats3;
|
|
42408
|
-
|
|
42431
|
+
if (afterPublishError === void 0) {
|
|
42432
|
+
afterPublishError = false;
|
|
42433
|
+
}
|
|
42434
|
+
_this.off('publishComplete', refreshAudioVideoUI);
|
|
42409
42435
|
if (chromeMixin) {
|
|
42410
42436
|
chromeMixin.reset();
|
|
42411
42437
|
}
|
|
42412
42438
|
streamCleanupJobs.releaseAll();
|
|
42413
42439
|
streamReadyJobs.empty();
|
|
42414
|
-
const disconnectPromise =
|
|
42415
|
-
|
|
42416
|
-
|
|
42417
|
-
|
|
42418
|
-
|
|
42419
|
-
widgetView
|
|
42420
|
-
|
|
42421
|
-
|
|
42422
|
-
|
|
42423
|
-
|
|
42440
|
+
const disconnectPromise = _this.disconnect();
|
|
42441
|
+
if (!afterPublishError) {
|
|
42442
|
+
microphone = null;
|
|
42443
|
+
cleanupLocalStream();
|
|
42444
|
+
webRTCStream = null;
|
|
42445
|
+
if (widgetView) {
|
|
42446
|
+
widgetView.destroy();
|
|
42447
|
+
widgetView = null;
|
|
42448
|
+
}
|
|
42449
|
+
if (mediaProcessor.getVideoFilter()) {
|
|
42450
|
+
destroyMediaProcessor();
|
|
42451
|
+
}
|
|
42452
|
+
_this.id = null;
|
|
42453
|
+
loaded = false;
|
|
42424
42454
|
}
|
|
42425
|
-
if (
|
|
42426
|
-
|
|
42455
|
+
if (_this.session) {
|
|
42456
|
+
_this._.unpublishFromSession(_this.session, 'reset', afterPublishError);
|
|
42427
42457
|
}
|
|
42428
42458
|
amrAudioTrackProcessor.destroy();
|
|
42429
42459
|
(_publisherSenderStats3 = publisherSenderStats) == null ? void 0 : _publisherSenderStats3.destroy();
|
|
42430
42460
|
publisherSenderStats = null;
|
|
42431
|
-
|
|
42432
|
-
|
|
42433
|
-
|
|
42434
|
-
this.session = null;
|
|
42435
|
-
this.streamId = null;
|
|
42461
|
+
_this.stream = null;
|
|
42462
|
+
_this.session = null;
|
|
42463
|
+
_this.streamId = null;
|
|
42436
42464
|
if (!state.isDestroyed()) {
|
|
42437
|
-
state.set('NotPublishing');
|
|
42465
|
+
state.set(loaded ? 'MediaBound' : 'NotPublishing');
|
|
42438
42466
|
}
|
|
42439
42467
|
return disconnectPromise;
|
|
42440
42468
|
};
|
|
@@ -42614,7 +42642,7 @@ function PublisherFactory(_ref) {
|
|
|
42614
42642
|
initials: properties.initials
|
|
42615
42643
|
}
|
|
42616
42644
|
};
|
|
42617
|
-
this.session._.streamCreate(streamOptions, completionHandler);
|
|
42645
|
+
return this.session._.streamCreate(streamOptions, completionHandler);
|
|
42618
42646
|
};
|
|
42619
42647
|
const _stopSendingRtpToMantis = /*#__PURE__*/function () {
|
|
42620
42648
|
var _ref24 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
@@ -42991,7 +43019,7 @@ function PublisherFactory(_ref) {
|
|
|
42991
43019
|
if (!properties.publishVideo) {
|
|
42992
43020
|
return;
|
|
42993
43021
|
}
|
|
42994
|
-
if (_this.stream) {
|
|
43022
|
+
if (_this.stream && !_suppressVideoDimensionsSignaling) {
|
|
42995
43023
|
_this.stream.setVideoDimensions(newValue.width, newValue.height);
|
|
42996
43024
|
}
|
|
42997
43025
|
_this.dispatchEvent(new Events.VideoDimensionsChangedEvent(_this, oldValue, newValue));
|
|
@@ -45437,6 +45465,20 @@ function PublisherFactory(_ref) {
|
|
|
45437
45465
|
this._setScalableVideoLayers(properties.scalableVideoLayers);
|
|
45438
45466
|
configureScalabilityMode().catch(() => {});
|
|
45439
45467
|
|
|
45468
|
+
// Propagate any preferred resolution/frameRate set before publish via signaling
|
|
45469
|
+
if (this.stream && (_preferredWidth || _preferredHeight || _preferredFrameRate)) {
|
|
45470
|
+
const _getPreferredVideoTra = getPreferredVideoTrackSettings(),
|
|
45471
|
+
width = _getPreferredVideoTra.width,
|
|
45472
|
+
height = _getPreferredVideoTra.height,
|
|
45473
|
+
actualFrameRate = _getPreferredVideoTra.frameRate;
|
|
45474
|
+
if (width && height && (_preferredWidth || _preferredHeight)) {
|
|
45475
|
+
this.stream.setVideoDimensions(width, height);
|
|
45476
|
+
}
|
|
45477
|
+
if (actualFrameRate && _preferredFrameRate) {
|
|
45478
|
+
this.stream.setVideoFrameRate(actualFrameRate);
|
|
45479
|
+
}
|
|
45480
|
+
}
|
|
45481
|
+
|
|
45440
45482
|
// See OPENTOK-45935
|
|
45441
45483
|
// Some users reuse the publisher when disconnecting and reconnecting
|
|
45442
45484
|
// to a session. This re-synchronizes the state of the stream channels.
|
|
@@ -45473,7 +45515,7 @@ function PublisherFactory(_ref) {
|
|
|
45473
45515
|
});
|
|
45474
45516
|
throw publicError;
|
|
45475
45517
|
};
|
|
45476
|
-
|
|
45518
|
+
let cancelStreamCreate;
|
|
45477
45519
|
const streamCreatedPromise = loadedPromise.then(() => session._.getVideoCodecsCompatible(webRTCStream)).then(videoCodecsCompatible => {
|
|
45478
45520
|
logging.debug('publishToSession: loaded');
|
|
45479
45521
|
// Bail if this.session is gone, it means we were unpublished
|
|
@@ -45546,7 +45588,8 @@ function PublisherFactory(_ref) {
|
|
|
45546
45588
|
this._.streamChannels = streamChannels;
|
|
45547
45589
|
logging.debug('publishToSession: creating rumor stream id');
|
|
45548
45590
|
return new Promise((resolve, reject) => {
|
|
45549
|
-
_createStream(null, (messagingError, streamId, message) => {
|
|
45591
|
+
cancelStreamCreate = _createStream(null, (messagingError, streamId, message) => {
|
|
45592
|
+
cancelStreamCreate = null;
|
|
45550
45593
|
if (messagingError) {
|
|
45551
45594
|
reject(processMessagingError(messagingError));
|
|
45552
45595
|
return;
|
|
@@ -45573,9 +45616,29 @@ function PublisherFactory(_ref) {
|
|
|
45573
45616
|
this.trigger('publishComplete', err);
|
|
45574
45617
|
throw err;
|
|
45575
45618
|
});
|
|
45576
|
-
return Promise.all([streamCreatedPromise, completedPromise])
|
|
45619
|
+
return Promise.all([streamCreatedPromise, completedPromise]).catch( /*#__PURE__*/function () {
|
|
45620
|
+
var _ref59 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(err) {
|
|
45621
|
+
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
45622
|
+
while (1) switch (_context48.prev = _context48.next) {
|
|
45623
|
+
case 0:
|
|
45624
|
+
cancelStreamCreate == null ? void 0 : cancelStreamCreate();
|
|
45625
|
+
cancelStreamCreate = null;
|
|
45626
|
+
_context48.next = 4;
|
|
45627
|
+
return reset(true).catch(() => {});
|
|
45628
|
+
case 4:
|
|
45629
|
+
throw err;
|
|
45630
|
+
case 5:
|
|
45631
|
+
case "end":
|
|
45632
|
+
return _context48.stop();
|
|
45633
|
+
}
|
|
45634
|
+
}, _callee48);
|
|
45635
|
+
}));
|
|
45636
|
+
return function (_x39) {
|
|
45637
|
+
return _ref59.apply(this, arguments);
|
|
45638
|
+
};
|
|
45639
|
+
}());
|
|
45577
45640
|
},
|
|
45578
|
-
unpublishFromSession: (session, reason) => {
|
|
45641
|
+
unpublishFromSession: (session, reason, afterPublishError) => {
|
|
45579
45642
|
if (!this.session || session.id !== this.session.id) {
|
|
45580
45643
|
if (reason === 'unpublished') {
|
|
45581
45644
|
const selfSessionText = this.session && this.session.id || 'no session';
|
|
@@ -45613,7 +45676,7 @@ function PublisherFactory(_ref) {
|
|
|
45613
45676
|
}
|
|
45614
45677
|
this.session = null;
|
|
45615
45678
|
logAnalyticsEvent('unpublish', 'Success');
|
|
45616
|
-
this._.streamDestroyed(reason);
|
|
45679
|
+
this._.streamDestroyed(reason, afterPublishError);
|
|
45617
45680
|
return this;
|
|
45618
45681
|
},
|
|
45619
45682
|
unpublishStreamFromSession: (stream, session, reason) => {
|
|
@@ -45624,11 +45687,11 @@ function PublisherFactory(_ref) {
|
|
|
45624
45687
|
return this._.unpublishFromSession(session, reason);
|
|
45625
45688
|
},
|
|
45626
45689
|
startMigration: function () {
|
|
45627
|
-
var _startMigration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
45690
|
+
var _startMigration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee49() {
|
|
45628
45691
|
var _publisherSenderStats4, _this$session23, _this$session23$sessi;
|
|
45629
45692
|
var relayedPeerConnection, onCreateStreamError;
|
|
45630
|
-
return _regenerator.default.wrap(function
|
|
45631
|
-
while (1) switch (
|
|
45693
|
+
return _regenerator.default.wrap(function _callee49$(_context49) {
|
|
45694
|
+
while (1) switch (_context49.prev = _context49.next) {
|
|
45632
45695
|
case 0:
|
|
45633
45696
|
state.set('Migrating');
|
|
45634
45697
|
logAnalyticsEvent('SessionMigration', 'Attempt');
|
|
@@ -45636,10 +45699,10 @@ function PublisherFactory(_ref) {
|
|
|
45636
45699
|
|
|
45637
45700
|
// Update sender method in P2P PC because it needs to use the new Rumor. No need for
|
|
45638
45701
|
// Mantis PC since a new PC will be created.
|
|
45639
|
-
|
|
45702
|
+
_context49.next = 5;
|
|
45640
45703
|
return getP2pPeerConnection();
|
|
45641
45704
|
case 5:
|
|
45642
|
-
relayedPeerConnection =
|
|
45705
|
+
relayedPeerConnection = _context49.sent;
|
|
45643
45706
|
relayedPeerConnection == null ? void 0 : relayedPeerConnection.setSendMessage(createSendMessage('P2P'));
|
|
45644
45707
|
(_publisherSenderStats4 = publisherSenderStats) == null ? void 0 : _publisherSenderStats4.setSocket(_this.session._.getSocket());
|
|
45645
45708
|
onCreateStreamError = error => {
|
|
@@ -45648,23 +45711,23 @@ function PublisherFactory(_ref) {
|
|
|
45648
45711
|
}
|
|
45649
45712
|
};
|
|
45650
45713
|
if (!((_this$session23 = _this.session) != null && (_this$session23$sessi = _this$session23.sessionInfo) != null && _this$session23$sessi.p2pEnabled)) {
|
|
45651
|
-
|
|
45714
|
+
_context49.next = 13;
|
|
45652
45715
|
break;
|
|
45653
45716
|
}
|
|
45654
45717
|
_createStream('P2P', onCreateStreamError);
|
|
45655
|
-
|
|
45718
|
+
_context49.next = 17;
|
|
45656
45719
|
break;
|
|
45657
45720
|
case 13:
|
|
45658
|
-
|
|
45721
|
+
_context49.next = 15;
|
|
45659
45722
|
return getMantisPeerConnection();
|
|
45660
45723
|
case 15:
|
|
45661
|
-
_previousPeerConnection =
|
|
45724
|
+
_previousPeerConnection = _context49.sent;
|
|
45662
45725
|
_createStream('MANTIS', onCreateStreamError);
|
|
45663
45726
|
case 17:
|
|
45664
45727
|
case "end":
|
|
45665
|
-
return
|
|
45728
|
+
return _context49.stop();
|
|
45666
45729
|
}
|
|
45667
|
-
},
|
|
45730
|
+
}, _callee49);
|
|
45668
45731
|
}));
|
|
45669
45732
|
function startMigration() {
|
|
45670
45733
|
return _startMigration.apply(this, arguments);
|
|
@@ -45675,16 +45738,16 @@ function PublisherFactory(_ref) {
|
|
|
45675
45738
|
var _this$session24, _this$session24$sessi;
|
|
45676
45739
|
clearTimeout(_migrationTimeoutId);
|
|
45677
45740
|
const destroyPeerConnection = /*#__PURE__*/function () {
|
|
45678
|
-
var
|
|
45741
|
+
var _ref60 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(pc) {
|
|
45679
45742
|
var _getPeerConnectionMet8, peerConnectionId;
|
|
45680
|
-
return _regenerator.default.wrap(function
|
|
45681
|
-
while (1) switch (
|
|
45743
|
+
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
45744
|
+
while (1) switch (_context50.prev = _context50.next) {
|
|
45682
45745
|
case 0:
|
|
45683
45746
|
if (!pc) {
|
|
45684
|
-
|
|
45747
|
+
_context50.next = 7;
|
|
45685
45748
|
break;
|
|
45686
45749
|
}
|
|
45687
|
-
|
|
45750
|
+
_context50.next = 3;
|
|
45688
45751
|
return _publisherStatsHelper.removePeerConnection(pc);
|
|
45689
45752
|
case 3:
|
|
45690
45753
|
_getPeerConnectionMet8 = getPeerConnectionMeta(pc), peerConnectionId = _getPeerConnectionMet8.peerConnectionId;
|
|
@@ -45693,12 +45756,12 @@ function PublisherFactory(_ref) {
|
|
|
45693
45756
|
pc.destroy();
|
|
45694
45757
|
case 7:
|
|
45695
45758
|
case "end":
|
|
45696
|
-
return
|
|
45759
|
+
return _context50.stop();
|
|
45697
45760
|
}
|
|
45698
|
-
},
|
|
45761
|
+
}, _callee50);
|
|
45699
45762
|
}));
|
|
45700
|
-
return function destroyPeerConnection(
|
|
45701
|
-
return
|
|
45763
|
+
return function destroyPeerConnection(_x40) {
|
|
45764
|
+
return _ref60.apply(this, arguments);
|
|
45702
45765
|
};
|
|
45703
45766
|
}();
|
|
45704
45767
|
|
|
@@ -45714,7 +45777,7 @@ function PublisherFactory(_ref) {
|
|
|
45714
45777
|
state.set('Publishing');
|
|
45715
45778
|
logAnalyticsEvent('SessionMigration', 'Success');
|
|
45716
45779
|
},
|
|
45717
|
-
streamDestroyed: reason => {
|
|
45780
|
+
streamDestroyed: (reason, afterPublishError) => {
|
|
45718
45781
|
if (['reset'].indexOf(reason) < 0) {
|
|
45719
45782
|
// We're back to being a stand-alone publisher again.
|
|
45720
45783
|
if (!state.isDestroyed()) {
|
|
@@ -45723,7 +45786,7 @@ function PublisherFactory(_ref) {
|
|
|
45723
45786
|
}
|
|
45724
45787
|
const event = new Events.StreamEvent('streamDestroyed', this.stream, reason, true);
|
|
45725
45788
|
this.dispatchEventOnce(event, this.streamId);
|
|
45726
|
-
if (!event.isDefaultPrevented()) {
|
|
45789
|
+
if (!event.isDefaultPrevented() && !afterPublishError) {
|
|
45727
45790
|
this.destroy();
|
|
45728
45791
|
}
|
|
45729
45792
|
this.streamId = null;
|
|
@@ -45738,55 +45801,55 @@ function PublisherFactory(_ref) {
|
|
|
45738
45801
|
return webRTCStream;
|
|
45739
45802
|
},
|
|
45740
45803
|
switchTracks() {
|
|
45741
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
45804
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee51() {
|
|
45742
45805
|
var stream;
|
|
45743
|
-
return _regenerator.default.wrap(function
|
|
45744
|
-
while (1) switch (
|
|
45806
|
+
return _regenerator.default.wrap(function _callee51$(_context51) {
|
|
45807
|
+
while (1) switch (_context51.prev = _context51.next) {
|
|
45745
45808
|
case 0:
|
|
45746
|
-
|
|
45747
|
-
|
|
45809
|
+
_context51.prev = 0;
|
|
45810
|
+
_context51.next = 3;
|
|
45748
45811
|
return getUserMedia().catch(userMediaError);
|
|
45749
45812
|
case 3:
|
|
45750
|
-
stream =
|
|
45751
|
-
|
|
45813
|
+
stream = _context51.sent;
|
|
45814
|
+
_context51.next = 10;
|
|
45752
45815
|
break;
|
|
45753
45816
|
case 6:
|
|
45754
|
-
|
|
45755
|
-
|
|
45756
|
-
logging.error(`OT.Publisher.switchTracks failed to getUserMedia: ${
|
|
45757
|
-
throw
|
|
45817
|
+
_context51.prev = 6;
|
|
45818
|
+
_context51.t0 = _context51["catch"](0);
|
|
45819
|
+
logging.error(`OT.Publisher.switchTracks failed to getUserMedia: ${_context51.t0}`);
|
|
45820
|
+
throw _context51.t0;
|
|
45758
45821
|
case 10:
|
|
45759
45822
|
setNewStream(stream);
|
|
45760
|
-
|
|
45823
|
+
_context51.prev = 11;
|
|
45761
45824
|
bindVideo();
|
|
45762
|
-
|
|
45825
|
+
_context51.next = 21;
|
|
45763
45826
|
break;
|
|
45764
45827
|
case 15:
|
|
45765
|
-
|
|
45766
|
-
|
|
45767
|
-
if (!(
|
|
45768
|
-
|
|
45828
|
+
_context51.prev = 15;
|
|
45829
|
+
_context51.t1 = _context51["catch"](11);
|
|
45830
|
+
if (!(_context51.t1 instanceof _cancel.CancellationError)) {
|
|
45831
|
+
_context51.next = 19;
|
|
45769
45832
|
break;
|
|
45770
45833
|
}
|
|
45771
|
-
return
|
|
45834
|
+
return _context51.abrupt("return");
|
|
45772
45835
|
case 19:
|
|
45773
|
-
logging.error('Error while binding video',
|
|
45774
|
-
throw
|
|
45836
|
+
logging.error('Error while binding video', _context51.t1);
|
|
45837
|
+
throw _context51.t1;
|
|
45775
45838
|
case 21:
|
|
45776
|
-
|
|
45839
|
+
_context51.prev = 21;
|
|
45777
45840
|
replaceTracks();
|
|
45778
|
-
|
|
45841
|
+
_context51.next = 29;
|
|
45779
45842
|
break;
|
|
45780
45843
|
case 25:
|
|
45781
|
-
|
|
45782
|
-
|
|
45783
|
-
logging.error('Error replacing tracks',
|
|
45784
|
-
throw
|
|
45844
|
+
_context51.prev = 25;
|
|
45845
|
+
_context51.t2 = _context51["catch"](21);
|
|
45846
|
+
logging.error('Error replacing tracks', _context51.t2);
|
|
45847
|
+
throw _context51.t2;
|
|
45785
45848
|
case 29:
|
|
45786
45849
|
case "end":
|
|
45787
|
-
return
|
|
45850
|
+
return _context51.stop();
|
|
45788
45851
|
}
|
|
45789
|
-
},
|
|
45852
|
+
}, _callee51, null, [[0, 6], [11, 15], [21, 25]]);
|
|
45790
45853
|
}))();
|
|
45791
45854
|
},
|
|
45792
45855
|
getDataChannel(label, getOptions, completion) {
|
|
@@ -45818,27 +45881,27 @@ function PublisherFactory(_ref) {
|
|
|
45818
45881
|
},
|
|
45819
45882
|
demoOnlyCycleVideo: this.cycleVideo,
|
|
45820
45883
|
testOnlyGetFramesEncoded() {
|
|
45821
|
-
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
45884
|
+
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee52() {
|
|
45822
45885
|
var peerConnections;
|
|
45823
|
-
return _regenerator.default.wrap(function
|
|
45824
|
-
while (1) switch (
|
|
45886
|
+
return _regenerator.default.wrap(function _callee52$(_context52) {
|
|
45887
|
+
while (1) switch (_context52.prev = _context52.next) {
|
|
45825
45888
|
case 0:
|
|
45826
|
-
|
|
45889
|
+
_context52.next = 2;
|
|
45827
45890
|
return getAllPeerConnections();
|
|
45828
45891
|
case 2:
|
|
45829
|
-
peerConnections =
|
|
45892
|
+
peerConnections = _context52.sent;
|
|
45830
45893
|
if (peerConnections.length) {
|
|
45831
|
-
|
|
45894
|
+
_context52.next = 5;
|
|
45832
45895
|
break;
|
|
45833
45896
|
}
|
|
45834
45897
|
throw new Error('No established PeerConnections yet');
|
|
45835
45898
|
case 5:
|
|
45836
|
-
return
|
|
45899
|
+
return _context52.abrupt("return", peerConnections[0]._testOnlyGetFramesEncoded());
|
|
45837
45900
|
case 6:
|
|
45838
45901
|
case "end":
|
|
45839
|
-
return
|
|
45902
|
+
return _context52.stop();
|
|
45840
45903
|
}
|
|
45841
|
-
},
|
|
45904
|
+
}, _callee52);
|
|
45842
45905
|
}))();
|
|
45843
45906
|
},
|
|
45844
45907
|
onStreamAvailable,
|
|
@@ -45867,47 +45930,47 @@ function PublisherFactory(_ref) {
|
|
|
45867
45930
|
}
|
|
45868
45931
|
}.bind(this),
|
|
45869
45932
|
setCongestionLevel: function () {
|
|
45870
|
-
var _setCongestionLevel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
45933
|
+
var _setCongestionLevel = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee53(level, peerId) {
|
|
45871
45934
|
var pcs;
|
|
45872
|
-
return _regenerator.default.wrap(function
|
|
45873
|
-
while (1) switch (
|
|
45935
|
+
return _regenerator.default.wrap(function _callee53$(_context53) {
|
|
45936
|
+
while (1) switch (_context53.prev = _context53.next) {
|
|
45874
45937
|
case 0:
|
|
45875
45938
|
if (!audioFallbackCoordinator) {
|
|
45876
|
-
|
|
45939
|
+
_context53.next = 15;
|
|
45877
45940
|
break;
|
|
45878
45941
|
}
|
|
45879
45942
|
if (!peerId) {
|
|
45880
|
-
|
|
45943
|
+
_context53.next = 8;
|
|
45881
45944
|
break;
|
|
45882
45945
|
}
|
|
45883
|
-
|
|
45946
|
+
_context53.next = 4;
|
|
45884
45947
|
return getPeerConnectionById(peerId);
|
|
45885
45948
|
case 4:
|
|
45886
|
-
|
|
45887
|
-
|
|
45888
|
-
|
|
45949
|
+
_context53.t1 = _context53.sent;
|
|
45950
|
+
_context53.t0 = [_context53.t1];
|
|
45951
|
+
_context53.next = 11;
|
|
45889
45952
|
break;
|
|
45890
45953
|
case 8:
|
|
45891
|
-
|
|
45954
|
+
_context53.next = 10;
|
|
45892
45955
|
return getAllPeerConnections();
|
|
45893
45956
|
case 10:
|
|
45894
|
-
|
|
45957
|
+
_context53.t0 = _context53.sent;
|
|
45895
45958
|
case 11:
|
|
45896
|
-
pcs =
|
|
45959
|
+
pcs = _context53.t0;
|
|
45897
45960
|
pcs.forEach(pc => {
|
|
45898
45961
|
pc.setCongestionLevel(level);
|
|
45899
45962
|
});
|
|
45900
|
-
|
|
45963
|
+
_context53.next = 16;
|
|
45901
45964
|
break;
|
|
45902
45965
|
case 15:
|
|
45903
45966
|
logging.warn('Audio Fallback is not enabled');
|
|
45904
45967
|
case 16:
|
|
45905
45968
|
case "end":
|
|
45906
|
-
return
|
|
45969
|
+
return _context53.stop();
|
|
45907
45970
|
}
|
|
45908
|
-
},
|
|
45971
|
+
}, _callee53);
|
|
45909
45972
|
}));
|
|
45910
|
-
function setCongestionLevel(
|
|
45973
|
+
function setCongestionLevel(_x41, _x42) {
|
|
45911
45974
|
return _setCongestionLevel.apply(this, arguments);
|
|
45912
45975
|
}
|
|
45913
45976
|
return setCongestionLevel;
|
|
@@ -46307,10 +46370,10 @@ function PublisherFactory(_ref) {
|
|
|
46307
46370
|
* If there is an error, the promise is rejected and no new video filter is set.
|
|
46308
46371
|
*/
|
|
46309
46372
|
this.applyVideoFilter = /*#__PURE__*/function () {
|
|
46310
|
-
var
|
|
46373
|
+
var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(videoFilter, avoidOriginalTrackLeak) {
|
|
46311
46374
|
var sanitizedVideoFilter, isSupported, message, _webRTCStream$getVide2, originalVideoTrack, filteredVideoTrack;
|
|
46312
|
-
return _regenerator.default.wrap(function
|
|
46313
|
-
while (1) switch (
|
|
46375
|
+
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
46376
|
+
while (1) switch (_context54.prev = _context54.next) {
|
|
46314
46377
|
case 0:
|
|
46315
46378
|
if (avoidOriginalTrackLeak === void 0) {
|
|
46316
46379
|
avoidOriginalTrackLeak = false;
|
|
@@ -46319,28 +46382,28 @@ function PublisherFactory(_ref) {
|
|
|
46319
46382
|
logAnalyticsEvent('applyVideoFilter', 'Attempt', {
|
|
46320
46383
|
videoFilter: sanitizedVideoFilter
|
|
46321
46384
|
});
|
|
46322
|
-
|
|
46385
|
+
_context54.prev = 3;
|
|
46323
46386
|
if (!_videoMediaProcessorConnector) {
|
|
46324
|
-
|
|
46387
|
+
_context54.next = 6;
|
|
46325
46388
|
break;
|
|
46326
46389
|
}
|
|
46327
46390
|
throw otError(Errors.NOT_SUPPORTED, new Error('Cannot apply video filter when videoMediaProcessorConnector is set.'));
|
|
46328
46391
|
case 6:
|
|
46329
46392
|
isSupported = MediaProcessor.isSupported('video');
|
|
46330
46393
|
if (isSupported) {
|
|
46331
|
-
|
|
46394
|
+
_context54.next = 9;
|
|
46332
46395
|
break;
|
|
46333
46396
|
}
|
|
46334
46397
|
throw otError(Errors.NOT_SUPPORTED, new Error('Browser does not support video filters (Insertable Streams and Worker APIs are required)'));
|
|
46335
46398
|
case 9:
|
|
46336
46399
|
if (mediaProcessor.isValidVideoFilter(videoFilter)) {
|
|
46337
|
-
|
|
46400
|
+
_context54.next = 11;
|
|
46338
46401
|
break;
|
|
46339
46402
|
}
|
|
46340
46403
|
throw otError(Errors.INVALID_PARAMETER, new Error('Video filter has invalid configuration'));
|
|
46341
46404
|
case 11:
|
|
46342
46405
|
if (webRTCStream) {
|
|
46343
|
-
|
|
46406
|
+
_context54.next = 16;
|
|
46344
46407
|
break;
|
|
46345
46408
|
}
|
|
46346
46409
|
message = 'Ignoring. No mediaStream';
|
|
@@ -46348,53 +46411,53 @@ function PublisherFactory(_ref) {
|
|
|
46348
46411
|
message
|
|
46349
46412
|
});
|
|
46350
46413
|
logging.warn(message);
|
|
46351
|
-
return
|
|
46414
|
+
return _context54.abrupt("return");
|
|
46352
46415
|
case 16:
|
|
46353
46416
|
if (!isScreenSharing) {
|
|
46354
|
-
|
|
46417
|
+
_context54.next = 18;
|
|
46355
46418
|
break;
|
|
46356
46419
|
}
|
|
46357
46420
|
throw otError(Errors.INVALID_PARAMETER, new Error('Video filters can not be applied to screen share'));
|
|
46358
46421
|
case 18:
|
|
46359
46422
|
enableMediaProcessorLogging();
|
|
46360
46423
|
if (properties.publishVideo) {
|
|
46361
|
-
|
|
46424
|
+
_context54.next = 23;
|
|
46362
46425
|
break;
|
|
46363
46426
|
}
|
|
46364
46427
|
currentVideoFilter = videoFilter;
|
|
46365
46428
|
logAnalyticsEvent('applyVideoFilter', 'Success', {
|
|
46366
46429
|
videoFilter: sanitizedVideoFilter
|
|
46367
46430
|
});
|
|
46368
|
-
return
|
|
46431
|
+
return _context54.abrupt("return");
|
|
46369
46432
|
case 23:
|
|
46370
46433
|
if (!mediaProcessor.getVideoFilter()) {
|
|
46371
|
-
|
|
46434
|
+
_context54.next = 38;
|
|
46372
46435
|
break;
|
|
46373
46436
|
}
|
|
46374
46437
|
if (!mediaProcessor.canUpdateVideoFilter(videoFilter.type)) {
|
|
46375
|
-
|
|
46438
|
+
_context54.next = 36;
|
|
46376
46439
|
break;
|
|
46377
46440
|
}
|
|
46378
|
-
|
|
46379
|
-
|
|
46441
|
+
_context54.prev = 25;
|
|
46442
|
+
_context54.next = 28;
|
|
46380
46443
|
return mediaProcessor.updateVideoFilter(videoFilter);
|
|
46381
46444
|
case 28:
|
|
46382
46445
|
currentVideoFilter = videoFilter;
|
|
46383
46446
|
logAnalyticsEvent('applyVideoFilter', 'Success', {
|
|
46384
46447
|
videoFilter: sanitizedVideoFilter
|
|
46385
46448
|
});
|
|
46386
|
-
return
|
|
46449
|
+
return _context54.abrupt("return");
|
|
46387
46450
|
case 33:
|
|
46388
|
-
|
|
46389
|
-
|
|
46390
|
-
logging.warn(`Error updating video filter: ${
|
|
46451
|
+
_context54.prev = 33;
|
|
46452
|
+
_context54.t0 = _context54["catch"](25);
|
|
46453
|
+
logging.warn(`Error updating video filter: ${_context54.t0}`);
|
|
46391
46454
|
case 36:
|
|
46392
|
-
|
|
46455
|
+
_context54.next = 38;
|
|
46393
46456
|
return _this.clearVideoFilter();
|
|
46394
46457
|
case 38:
|
|
46395
46458
|
_webRTCStream$getVide2 = webRTCStream.getVideoTracks(), originalVideoTrack = _webRTCStream$getVide2[0];
|
|
46396
46459
|
if (originalVideoTrack) {
|
|
46397
|
-
|
|
46460
|
+
_context54.next = 44;
|
|
46398
46461
|
break;
|
|
46399
46462
|
}
|
|
46400
46463
|
message = 'Ignoring. No video';
|
|
@@ -46402,33 +46465,33 @@ function PublisherFactory(_ref) {
|
|
|
46402
46465
|
message
|
|
46403
46466
|
});
|
|
46404
46467
|
logging.warn(message);
|
|
46405
|
-
return
|
|
46468
|
+
return _context54.abrupt("return");
|
|
46406
46469
|
case 44:
|
|
46407
|
-
|
|
46470
|
+
_context54.next = 46;
|
|
46408
46471
|
return mediaProcessor.setVideoFilter(videoFilter, avoidOriginalTrackLeak);
|
|
46409
46472
|
case 46:
|
|
46410
|
-
|
|
46473
|
+
_context54.next = 48;
|
|
46411
46474
|
return mediaProcessor.setMediaStream(webRTCStream);
|
|
46412
46475
|
case 48:
|
|
46413
|
-
filteredVideoTrack =
|
|
46476
|
+
filteredVideoTrack = _context54.sent;
|
|
46414
46477
|
if (!filteredVideoTrack) {
|
|
46415
|
-
|
|
46478
|
+
_context54.next = 53;
|
|
46416
46479
|
break;
|
|
46417
46480
|
}
|
|
46418
46481
|
filteredVideoTrackId = filteredVideoTrack.id;
|
|
46419
|
-
|
|
46482
|
+
_context54.next = 53;
|
|
46420
46483
|
return replaceTrackAndUpdate(originalVideoTrack, filteredVideoTrack);
|
|
46421
46484
|
case 53:
|
|
46422
|
-
|
|
46485
|
+
_context54.next = 60;
|
|
46423
46486
|
break;
|
|
46424
46487
|
case 55:
|
|
46425
|
-
|
|
46426
|
-
|
|
46427
|
-
logging.error(`Error applying video filter: ${
|
|
46488
|
+
_context54.prev = 55;
|
|
46489
|
+
_context54.t1 = _context54["catch"](3);
|
|
46490
|
+
logging.error(`Error applying video filter: ${_context54.t1}`);
|
|
46428
46491
|
logAnalyticsEvent('applyVideoFilter', 'Failure', {
|
|
46429
|
-
message:
|
|
46492
|
+
message: _context54.t1.message
|
|
46430
46493
|
});
|
|
46431
|
-
throw
|
|
46494
|
+
throw _context54.t1;
|
|
46432
46495
|
case 60:
|
|
46433
46496
|
currentVideoFilter = videoFilter;
|
|
46434
46497
|
logAnalyticsEvent('applyVideoFilter', 'Success', {
|
|
@@ -46436,12 +46499,12 @@ function PublisherFactory(_ref) {
|
|
|
46436
46499
|
});
|
|
46437
46500
|
case 62:
|
|
46438
46501
|
case "end":
|
|
46439
|
-
return
|
|
46502
|
+
return _context54.stop();
|
|
46440
46503
|
}
|
|
46441
|
-
},
|
|
46504
|
+
}, _callee54, null, [[3, 55], [25, 33]]);
|
|
46442
46505
|
}));
|
|
46443
|
-
return function (
|
|
46444
|
-
return
|
|
46506
|
+
return function (_x43, _x44) {
|
|
46507
|
+
return _ref61.apply(this, arguments);
|
|
46445
46508
|
};
|
|
46446
46509
|
}();
|
|
46447
46510
|
|
|
@@ -46548,35 +46611,35 @@ function PublisherFactory(_ref) {
|
|
|
46548
46611
|
* If there is an error, the promise is rejected and no new video filter is set.
|
|
46549
46612
|
*/
|
|
46550
46613
|
this.applyAudioFilter = /*#__PURE__*/function () {
|
|
46551
|
-
var
|
|
46614
|
+
var _ref62 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(audioFilter) {
|
|
46552
46615
|
var isSupported, message, _getNoiseSuppressionC, assetsDirBaseUrl, vonageNoiseSuppression, noiseSuppressionConnector;
|
|
46553
|
-
return _regenerator.default.wrap(function
|
|
46554
|
-
while (1) switch (
|
|
46616
|
+
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
46617
|
+
while (1) switch (_context55.prev = _context55.next) {
|
|
46555
46618
|
case 0:
|
|
46556
46619
|
logAnalyticsEvent('applyAudioFilter', 'Attempt', {
|
|
46557
46620
|
audioFilter
|
|
46558
46621
|
});
|
|
46559
46622
|
isSupported = MediaProcessor.isSupported('audio');
|
|
46560
46623
|
if (isSupported) {
|
|
46561
|
-
|
|
46624
|
+
_context55.next = 4;
|
|
46562
46625
|
break;
|
|
46563
46626
|
}
|
|
46564
46627
|
throw otError(Errors.NOT_SUPPORTED, new Error('Browser does not support audio filters (Insertable Streams and Worker APIs are required)'));
|
|
46565
46628
|
case 4:
|
|
46566
46629
|
if ((0, _isValidAudioFilter.default)(audioFilter)) {
|
|
46567
|
-
|
|
46630
|
+
_context55.next = 6;
|
|
46568
46631
|
break;
|
|
46569
46632
|
}
|
|
46570
46633
|
throw otError(Errors.INVALID_PARAMETER, new Error('Audio filter has invalid configuration'));
|
|
46571
46634
|
case 6:
|
|
46572
46635
|
if (!_audioMediaProcessorConnector) {
|
|
46573
|
-
|
|
46636
|
+
_context55.next = 8;
|
|
46574
46637
|
break;
|
|
46575
46638
|
}
|
|
46576
46639
|
throw otError(Errors.NOT_SUPPORTED, new Error('Cannot apply audio filter when audioMediaProcessorConnector is set.'));
|
|
46577
46640
|
case 8:
|
|
46578
46641
|
if (webRTCStream) {
|
|
46579
|
-
|
|
46642
|
+
_context55.next = 13;
|
|
46580
46643
|
break;
|
|
46581
46644
|
}
|
|
46582
46645
|
message = 'Ignoring. No mediaStream';
|
|
@@ -46584,68 +46647,68 @@ function PublisherFactory(_ref) {
|
|
|
46584
46647
|
message
|
|
46585
46648
|
});
|
|
46586
46649
|
logging.warn(message);
|
|
46587
|
-
return
|
|
46650
|
+
return _context55.abrupt("return");
|
|
46588
46651
|
case 13:
|
|
46589
46652
|
if (properties.publishAudio) {
|
|
46590
|
-
|
|
46653
|
+
_context55.next = 17;
|
|
46591
46654
|
break;
|
|
46592
46655
|
}
|
|
46593
46656
|
currentAudioFilter = audioFilter;
|
|
46594
46657
|
logAnalyticsEvent('applyAudioFilter', 'Success', {
|
|
46595
46658
|
audioFilter
|
|
46596
46659
|
});
|
|
46597
|
-
return
|
|
46660
|
+
return _context55.abrupt("return");
|
|
46598
46661
|
case 17:
|
|
46599
46662
|
if (!_this.getAudioFilter()) {
|
|
46600
|
-
|
|
46663
|
+
_context55.next = 20;
|
|
46601
46664
|
break;
|
|
46602
46665
|
}
|
|
46603
|
-
|
|
46666
|
+
_context55.next = 20;
|
|
46604
46667
|
return _this.clearAudioFilter();
|
|
46605
46668
|
case 20:
|
|
46606
|
-
|
|
46669
|
+
_context55.prev = 20;
|
|
46607
46670
|
if (!(audioFilter.type === 'advancedNoiseSuppression')) {
|
|
46608
|
-
|
|
46671
|
+
_context55.next = 32;
|
|
46609
46672
|
break;
|
|
46610
46673
|
}
|
|
46611
46674
|
_getNoiseSuppressionC = (0, _getDefaultConfig.default)({
|
|
46612
46675
|
proxyUrl: (0, _proxyUrl.getProxyUrl)()
|
|
46613
46676
|
}), assetsDirBaseUrl = _getNoiseSuppressionC.assetsDirBaseUrl;
|
|
46614
46677
|
vonageNoiseSuppression = createVonageNoiseSuppression();
|
|
46615
|
-
|
|
46678
|
+
_context55.next = 26;
|
|
46616
46679
|
return vonageNoiseSuppression.init({
|
|
46617
46680
|
assetsDirBaseUrl
|
|
46618
46681
|
});
|
|
46619
46682
|
case 26:
|
|
46620
|
-
|
|
46683
|
+
_context55.next = 28;
|
|
46621
46684
|
return vonageNoiseSuppression.getConnector();
|
|
46622
46685
|
case 28:
|
|
46623
|
-
noiseSuppressionConnector =
|
|
46624
|
-
|
|
46686
|
+
noiseSuppressionConnector = _context55.sent;
|
|
46687
|
+
_context55.next = 31;
|
|
46625
46688
|
return _setAudioMediaProcessorConnector(noiseSuppressionConnector);
|
|
46626
46689
|
case 31:
|
|
46627
46690
|
currentAudioFilter = audioFilter;
|
|
46628
46691
|
case 32:
|
|
46629
|
-
|
|
46692
|
+
_context55.next = 39;
|
|
46630
46693
|
break;
|
|
46631
46694
|
case 34:
|
|
46632
|
-
|
|
46633
|
-
|
|
46634
|
-
logging.error(`Error applying audio filter: ${
|
|
46695
|
+
_context55.prev = 34;
|
|
46696
|
+
_context55.t0 = _context55["catch"](20);
|
|
46697
|
+
logging.error(`Error applying audio filter: ${_context55.t0}`);
|
|
46635
46698
|
logAnalyticsEvent('applyAudioFilter', 'Failure', {
|
|
46636
|
-
message:
|
|
46699
|
+
message: _context55.t0.message
|
|
46637
46700
|
});
|
|
46638
|
-
throw
|
|
46701
|
+
throw _context55.t0;
|
|
46639
46702
|
case 39:
|
|
46640
46703
|
logAnalyticsEvent('applyAudioFilter', 'Success');
|
|
46641
46704
|
case 40:
|
|
46642
46705
|
case "end":
|
|
46643
|
-
return
|
|
46706
|
+
return _context55.stop();
|
|
46644
46707
|
}
|
|
46645
|
-
},
|
|
46708
|
+
}, _callee55, null, [[20, 34]]);
|
|
46646
46709
|
}));
|
|
46647
|
-
return function (
|
|
46648
|
-
return
|
|
46710
|
+
return function (_x45) {
|
|
46711
|
+
return _ref62.apply(this, arguments);
|
|
46649
46712
|
};
|
|
46650
46713
|
}();
|
|
46651
46714
|
|
|
@@ -46666,22 +46729,22 @@ function PublisherFactory(_ref) {
|
|
|
46666
46729
|
* @return {Promise} A promise that resolves when the operation completes successfully.
|
|
46667
46730
|
* If there is an error, the promise is rejected.
|
|
46668
46731
|
*/
|
|
46669
|
-
this.clearAudioFilter = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
46732
|
+
this.clearAudioFilter = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee56() {
|
|
46670
46733
|
var message;
|
|
46671
|
-
return _regenerator.default.wrap(function
|
|
46672
|
-
while (1) switch (
|
|
46734
|
+
return _regenerator.default.wrap(function _callee56$(_context56) {
|
|
46735
|
+
while (1) switch (_context56.prev = _context56.next) {
|
|
46673
46736
|
case 0:
|
|
46674
46737
|
logAnalyticsEvent('clearAudioFilter', 'Attempt');
|
|
46675
46738
|
if (!(!properties.publishAudio && _this.getAudioFilter())) {
|
|
46676
|
-
|
|
46739
|
+
_context56.next = 5;
|
|
46677
46740
|
break;
|
|
46678
46741
|
}
|
|
46679
46742
|
currentAudioFilter = null;
|
|
46680
46743
|
logAnalyticsEvent('clearAudioFilter', 'Success');
|
|
46681
|
-
return
|
|
46744
|
+
return _context56.abrupt("return");
|
|
46682
46745
|
case 5:
|
|
46683
46746
|
if (MediaProcessor.isSupported('audio')) {
|
|
46684
|
-
|
|
46747
|
+
_context56.next = 10;
|
|
46685
46748
|
break;
|
|
46686
46749
|
}
|
|
46687
46750
|
message = 'Ignoring. "clearAudioFilter" not supported.';
|
|
@@ -46689,10 +46752,10 @@ function PublisherFactory(_ref) {
|
|
|
46689
46752
|
message
|
|
46690
46753
|
});
|
|
46691
46754
|
logging.warn(message);
|
|
46692
|
-
return
|
|
46755
|
+
return _context56.abrupt("return");
|
|
46693
46756
|
case 10:
|
|
46694
46757
|
if (_this.getAudioFilter()) {
|
|
46695
|
-
|
|
46758
|
+
_context56.next = 15;
|
|
46696
46759
|
break;
|
|
46697
46760
|
}
|
|
46698
46761
|
message = 'Ignoring. No audio filter applied';
|
|
@@ -46700,10 +46763,10 @@ function PublisherFactory(_ref) {
|
|
|
46700
46763
|
message
|
|
46701
46764
|
});
|
|
46702
46765
|
logging.debug(message);
|
|
46703
|
-
return
|
|
46766
|
+
return _context56.abrupt("return");
|
|
46704
46767
|
case 15:
|
|
46705
46768
|
if (webRTCStream) {
|
|
46706
|
-
|
|
46769
|
+
_context56.next = 20;
|
|
46707
46770
|
break;
|
|
46708
46771
|
}
|
|
46709
46772
|
message = 'Ignoring. No mediaStream';
|
|
@@ -46711,29 +46774,29 @@ function PublisherFactory(_ref) {
|
|
|
46711
46774
|
message
|
|
46712
46775
|
});
|
|
46713
46776
|
logging.warn(message);
|
|
46714
|
-
return
|
|
46777
|
+
return _context56.abrupt("return");
|
|
46715
46778
|
case 20:
|
|
46716
|
-
|
|
46717
|
-
|
|
46779
|
+
_context56.prev = 20;
|
|
46780
|
+
_context56.next = 23;
|
|
46718
46781
|
return _setAudioMediaProcessorConnector(null);
|
|
46719
46782
|
case 23:
|
|
46720
46783
|
currentAudioFilter = null;
|
|
46721
|
-
|
|
46784
|
+
_context56.next = 30;
|
|
46722
46785
|
break;
|
|
46723
46786
|
case 26:
|
|
46724
|
-
|
|
46725
|
-
|
|
46787
|
+
_context56.prev = 26;
|
|
46788
|
+
_context56.t0 = _context56["catch"](20);
|
|
46726
46789
|
logAnalyticsEvent('clearAudioFilter', 'Failure', {
|
|
46727
|
-
error:
|
|
46790
|
+
error: _context56.t0
|
|
46728
46791
|
});
|
|
46729
|
-
return
|
|
46792
|
+
return _context56.abrupt("return");
|
|
46730
46793
|
case 30:
|
|
46731
46794
|
logAnalyticsEvent('clearAudioFilter', 'Success');
|
|
46732
46795
|
case 31:
|
|
46733
46796
|
case "end":
|
|
46734
|
-
return
|
|
46797
|
+
return _context56.stop();
|
|
46735
46798
|
}
|
|
46736
|
-
},
|
|
46799
|
+
}, _callee56, null, [[20, 26]]);
|
|
46737
46800
|
}));
|
|
46738
46801
|
|
|
46739
46802
|
/**
|
|
@@ -46828,16 +46891,16 @@ function PublisherFactory(_ref) {
|
|
|
46828
46891
|
* If there is an error, the promise is rejected and no connector is set.
|
|
46829
46892
|
*/
|
|
46830
46893
|
this.setVideoMediaProcessorConnector = /*#__PURE__*/function () {
|
|
46831
|
-
var
|
|
46894
|
+
var _ref64 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(mediaProcessorConnector) {
|
|
46832
46895
|
var _webRTCStream$getVide3, filteredVideoTrack, videoTrack, _webRTCStream$getVide4, originalVideoTrack, message;
|
|
46833
|
-
return _regenerator.default.wrap(function
|
|
46834
|
-
while (1) switch (
|
|
46896
|
+
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
46897
|
+
while (1) switch (_context57.prev = _context57.next) {
|
|
46835
46898
|
case 0:
|
|
46836
46899
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Attempt', {
|
|
46837
46900
|
message: mediaProcessorConnector ? 'setting the connector' : 'clearing the connector'
|
|
46838
46901
|
});
|
|
46839
46902
|
if (!_this.getVideoFilter()) {
|
|
46840
|
-
|
|
46903
|
+
_context57.next = 4;
|
|
46841
46904
|
break;
|
|
46842
46905
|
}
|
|
46843
46906
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Failure', {
|
|
@@ -46846,16 +46909,16 @@ function PublisherFactory(_ref) {
|
|
|
46846
46909
|
throw otError(Errors.NOT_SUPPORTED, new Error('setVideoMediaProcessorConnector: Cannot use this method when videoFilter is set.'));
|
|
46847
46910
|
case 4:
|
|
46848
46911
|
if (!_videoMediaProcessorConnector) {
|
|
46849
|
-
|
|
46912
|
+
_context57.next = 15;
|
|
46850
46913
|
break;
|
|
46851
46914
|
}
|
|
46852
46915
|
_webRTCStream$getVide3 = webRTCStream.getVideoTracks(), filteredVideoTrack = _webRTCStream$getVide3[0];
|
|
46853
|
-
|
|
46916
|
+
_context57.next = 8;
|
|
46854
46917
|
return getTrackFromDeviceId(currentDeviceId);
|
|
46855
46918
|
case 8:
|
|
46856
|
-
videoTrack =
|
|
46919
|
+
videoTrack = _context57.sent;
|
|
46857
46920
|
filteredVideoTrackId = null;
|
|
46858
|
-
|
|
46921
|
+
_context57.next = 12;
|
|
46859
46922
|
return replaceTrackAndUpdate(filteredVideoTrack, videoTrack);
|
|
46860
46923
|
case 12:
|
|
46861
46924
|
_videoMediaProcessorConnector.destroy();
|
|
@@ -46863,16 +46926,16 @@ function PublisherFactory(_ref) {
|
|
|
46863
46926
|
_videoMediaProcessorConnector = null;
|
|
46864
46927
|
case 15:
|
|
46865
46928
|
if (mediaProcessorConnector) {
|
|
46866
|
-
|
|
46929
|
+
_context57.next = 18;
|
|
46867
46930
|
break;
|
|
46868
46931
|
}
|
|
46869
46932
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Success', {
|
|
46870
46933
|
message: 'clearing the connector'
|
|
46871
46934
|
});
|
|
46872
|
-
return
|
|
46935
|
+
return _context57.abrupt("return");
|
|
46873
46936
|
case 18:
|
|
46874
46937
|
if (MediaProcessorConnector.isValidConnector(mediaProcessorConnector)) {
|
|
46875
|
-
|
|
46938
|
+
_context57.next = 21;
|
|
46876
46939
|
break;
|
|
46877
46940
|
}
|
|
46878
46941
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Failure', {
|
|
@@ -46883,7 +46946,7 @@ function PublisherFactory(_ref) {
|
|
|
46883
46946
|
_videoMediaProcessorConnector = new MediaProcessorConnector(mediaProcessorConnector);
|
|
46884
46947
|
_webRTCStream$getVide4 = webRTCStream.getVideoTracks(), originalVideoTrack = _webRTCStream$getVide4[0];
|
|
46885
46948
|
if (originalVideoTrack) {
|
|
46886
|
-
|
|
46949
|
+
_context57.next = 29;
|
|
46887
46950
|
break;
|
|
46888
46951
|
}
|
|
46889
46952
|
message = 'Connector not set as no video track is present.';
|
|
@@ -46892,38 +46955,38 @@ function PublisherFactory(_ref) {
|
|
|
46892
46955
|
});
|
|
46893
46956
|
logging.warn(`setVideoMediaProcessorConnector: ${message}`);
|
|
46894
46957
|
_videoMediaProcessorConnector = null;
|
|
46895
|
-
return
|
|
46958
|
+
return _context57.abrupt("return");
|
|
46896
46959
|
case 29:
|
|
46897
|
-
|
|
46898
|
-
|
|
46960
|
+
_context57.prev = 29;
|
|
46961
|
+
_context57.next = 32;
|
|
46899
46962
|
return _videoMediaProcessorConnector.setTrack(originalVideoTrack);
|
|
46900
46963
|
case 32:
|
|
46901
|
-
filteredVideoTrack =
|
|
46964
|
+
filteredVideoTrack = _context57.sent;
|
|
46902
46965
|
filteredVideoTrackId = filteredVideoTrack.id;
|
|
46903
|
-
|
|
46966
|
+
_context57.next = 36;
|
|
46904
46967
|
return replaceTrackAndUpdate(originalVideoTrack, filteredVideoTrack);
|
|
46905
46968
|
case 36:
|
|
46906
|
-
|
|
46969
|
+
_context57.next = 44;
|
|
46907
46970
|
break;
|
|
46908
46971
|
case 38:
|
|
46909
|
-
|
|
46910
|
-
|
|
46972
|
+
_context57.prev = 38;
|
|
46973
|
+
_context57.t0 = _context57["catch"](29);
|
|
46911
46974
|
_videoMediaProcessorConnector = null;
|
|
46912
|
-
logging.error(`setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: ${
|
|
46975
|
+
logging.error(`setVideoMediaProcessorConnector: Error getting track from MediaProcessorConnector: ${_context57.t0}`);
|
|
46913
46976
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Failure', {
|
|
46914
|
-
message:
|
|
46977
|
+
message: _context57.t0.message
|
|
46915
46978
|
});
|
|
46916
|
-
throw
|
|
46979
|
+
throw _context57.t0;
|
|
46917
46980
|
case 44:
|
|
46918
46981
|
logAnalyticsEvent('setVideoMediaProcessorConnector', 'Success');
|
|
46919
46982
|
case 45:
|
|
46920
46983
|
case "end":
|
|
46921
|
-
return
|
|
46984
|
+
return _context57.stop();
|
|
46922
46985
|
}
|
|
46923
|
-
},
|
|
46986
|
+
}, _callee57, null, [[29, 38]]);
|
|
46924
46987
|
}));
|
|
46925
|
-
return function (
|
|
46926
|
-
return
|
|
46988
|
+
return function (_x46) {
|
|
46989
|
+
return _ref64.apply(this, arguments);
|
|
46927
46990
|
};
|
|
46928
46991
|
}();
|
|
46929
46992
|
|
|
@@ -46987,71 +47050,71 @@ function PublisherFactory(_ref) {
|
|
|
46987
47050
|
* If there is an error, the promise is rejected and no connector is set.
|
|
46988
47051
|
*/
|
|
46989
47052
|
this.setAudioMediaProcessorConnector = /*#__PURE__*/function () {
|
|
46990
|
-
var
|
|
46991
|
-
return _regenerator.default.wrap(function
|
|
46992
|
-
while (1) switch (
|
|
47053
|
+
var _ref65 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(mediaProcessorConnector) {
|
|
47054
|
+
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
47055
|
+
while (1) switch (_context58.prev = _context58.next) {
|
|
46993
47056
|
case 0:
|
|
46994
47057
|
logAnalyticsEvent('setAudioMediaProcessorConnector', 'Attempt', {
|
|
46995
47058
|
message: mediaProcessorConnector ? 'setting the connector' : 'clearing the connector'
|
|
46996
47059
|
});
|
|
46997
|
-
|
|
46998
|
-
|
|
47060
|
+
_context58.prev = 1;
|
|
47061
|
+
_context58.next = 4;
|
|
46999
47062
|
return _setAudioMediaProcessorConnector(mediaProcessorConnector);
|
|
47000
47063
|
case 4:
|
|
47001
47064
|
logAnalyticsEvent('setAudioMediaProcessorConnector', 'Success', {
|
|
47002
47065
|
message: mediaProcessorConnector ? undefined : 'clearing the connector'
|
|
47003
47066
|
});
|
|
47004
|
-
|
|
47067
|
+
_context58.next = 11;
|
|
47005
47068
|
break;
|
|
47006
47069
|
case 7:
|
|
47007
|
-
|
|
47008
|
-
|
|
47070
|
+
_context58.prev = 7;
|
|
47071
|
+
_context58.t0 = _context58["catch"](1);
|
|
47009
47072
|
logAnalyticsEvent('setAudioMediaProcessorConnector', 'Failure', {
|
|
47010
|
-
message:
|
|
47073
|
+
message: _context58.t0.message
|
|
47011
47074
|
});
|
|
47012
|
-
throw
|
|
47075
|
+
throw _context58.t0;
|
|
47013
47076
|
case 11:
|
|
47014
47077
|
case "end":
|
|
47015
|
-
return
|
|
47078
|
+
return _context58.stop();
|
|
47016
47079
|
}
|
|
47017
|
-
},
|
|
47080
|
+
}, _callee58, null, [[1, 7]]);
|
|
47018
47081
|
}));
|
|
47019
|
-
return function (
|
|
47020
|
-
return
|
|
47082
|
+
return function (_x47) {
|
|
47083
|
+
return _ref65.apply(this, arguments);
|
|
47021
47084
|
};
|
|
47022
47085
|
}();
|
|
47023
47086
|
const _setAudioMediaProcessorConnector = /*#__PURE__*/function () {
|
|
47024
|
-
var
|
|
47087
|
+
var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(mediaProcessorConnector) {
|
|
47025
47088
|
var message, _webRTCStream$getAudi, filteredAudioTrack, _webRTCStream$getAudi2, originalAudioTrack;
|
|
47026
|
-
return _regenerator.default.wrap(function
|
|
47027
|
-
while (1) switch (
|
|
47089
|
+
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
47090
|
+
while (1) switch (_context59.prev = _context59.next) {
|
|
47028
47091
|
case 0:
|
|
47029
47092
|
if (!(_this.getAudioFilter() && mediaProcessorConnector)) {
|
|
47030
|
-
|
|
47093
|
+
_context59.next = 3;
|
|
47031
47094
|
break;
|
|
47032
47095
|
}
|
|
47033
47096
|
message = 'Tried to set audio MediaProcessorConnector when audio filter applied.';
|
|
47034
47097
|
throw otError(Errors.NOT_SUPPORTED, new Error(message));
|
|
47035
47098
|
case 3:
|
|
47036
47099
|
if (!_audioMediaProcessorConnector) {
|
|
47037
|
-
|
|
47100
|
+
_context59.next = 9;
|
|
47038
47101
|
break;
|
|
47039
47102
|
}
|
|
47040
47103
|
_webRTCStream$getAudi = webRTCStream.getAudioTracks(), filteredAudioTrack = _webRTCStream$getAudi[0];
|
|
47041
|
-
|
|
47104
|
+
_context59.next = 7;
|
|
47042
47105
|
return replaceAudioTrack(filteredAudioTrack, _audioMediaProcessorConnector.originalTrack);
|
|
47043
47106
|
case 7:
|
|
47044
47107
|
_audioMediaProcessorConnector.destroy();
|
|
47045
47108
|
_audioMediaProcessorConnector = null;
|
|
47046
47109
|
case 9:
|
|
47047
47110
|
if (mediaProcessorConnector) {
|
|
47048
|
-
|
|
47111
|
+
_context59.next = 11;
|
|
47049
47112
|
break;
|
|
47050
47113
|
}
|
|
47051
|
-
return
|
|
47114
|
+
return _context59.abrupt("return");
|
|
47052
47115
|
case 11:
|
|
47053
47116
|
if (MediaProcessorConnector.isValidConnector(mediaProcessorConnector)) {
|
|
47054
|
-
|
|
47117
|
+
_context59.next = 14;
|
|
47055
47118
|
break;
|
|
47056
47119
|
}
|
|
47057
47120
|
message = 'Invalid MediaProcessorConnector';
|
|
@@ -47059,7 +47122,7 @@ function PublisherFactory(_ref) {
|
|
|
47059
47122
|
case 14:
|
|
47060
47123
|
_webRTCStream$getAudi2 = webRTCStream.getAudioTracks(), originalAudioTrack = _webRTCStream$getAudi2[0];
|
|
47061
47124
|
if (originalAudioTrack) {
|
|
47062
|
-
|
|
47125
|
+
_context59.next = 20;
|
|
47063
47126
|
break;
|
|
47064
47127
|
}
|
|
47065
47128
|
message = 'Connector not set as no audio track is present.';
|
|
@@ -47068,30 +47131,30 @@ function PublisherFactory(_ref) {
|
|
|
47068
47131
|
throw new Error(message);
|
|
47069
47132
|
case 20:
|
|
47070
47133
|
_audioMediaProcessorConnector = new MediaProcessorConnector(mediaProcessorConnector);
|
|
47071
|
-
|
|
47072
|
-
|
|
47134
|
+
_context59.prev = 21;
|
|
47135
|
+
_context59.next = 24;
|
|
47073
47136
|
return _audioMediaProcessorConnector.setTrack(originalAudioTrack);
|
|
47074
47137
|
case 24:
|
|
47075
|
-
filteredAudioTrack =
|
|
47076
|
-
|
|
47138
|
+
filteredAudioTrack = _context59.sent;
|
|
47139
|
+
_context59.next = 27;
|
|
47077
47140
|
return replaceAudioTrack(_this._getAudioSource(), filteredAudioTrack);
|
|
47078
47141
|
case 27:
|
|
47079
|
-
|
|
47142
|
+
_context59.next = 34;
|
|
47080
47143
|
break;
|
|
47081
47144
|
case 29:
|
|
47082
|
-
|
|
47083
|
-
|
|
47145
|
+
_context59.prev = 29;
|
|
47146
|
+
_context59.t0 = _context59["catch"](21);
|
|
47084
47147
|
_audioMediaProcessorConnector = null;
|
|
47085
|
-
logging.error(`setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: ${
|
|
47086
|
-
throw
|
|
47148
|
+
logging.error(`setAudioMediaProcessorConnector: Error getting track from MediaProcessorConnector: ${_context59.t0}`);
|
|
47149
|
+
throw _context59.t0;
|
|
47087
47150
|
case 34:
|
|
47088
47151
|
case "end":
|
|
47089
|
-
return
|
|
47152
|
+
return _context59.stop();
|
|
47090
47153
|
}
|
|
47091
|
-
},
|
|
47154
|
+
}, _callee59, null, [[21, 29]]);
|
|
47092
47155
|
}));
|
|
47093
|
-
return function _setAudioMediaProcessorConnector(
|
|
47094
|
-
return
|
|
47156
|
+
return function _setAudioMediaProcessorConnector(_x48) {
|
|
47157
|
+
return _ref66.apply(this, arguments);
|
|
47095
47158
|
};
|
|
47096
47159
|
}();
|
|
47097
47160
|
|
|
@@ -47112,22 +47175,22 @@ function PublisherFactory(_ref) {
|
|
|
47112
47175
|
* @return {Promise} A promise that resolves when the operation completes successfully.
|
|
47113
47176
|
* If there is an error, the promise is rejected.
|
|
47114
47177
|
*/
|
|
47115
|
-
this.clearVideoFilter = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
47178
|
+
this.clearVideoFilter = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
47116
47179
|
var message, oldVideoFilter, _webRTCStream$getVide5, filteredVideoTrack, videoTrack;
|
|
47117
|
-
return _regenerator.default.wrap(function
|
|
47118
|
-
while (1) switch (
|
|
47180
|
+
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
47181
|
+
while (1) switch (_context60.prev = _context60.next) {
|
|
47119
47182
|
case 0:
|
|
47120
47183
|
logAnalyticsEvent('clearVideoFilter', 'Attempt');
|
|
47121
47184
|
if (!(!properties.publishVideo && !mediaProcessor.getVideoFilter())) {
|
|
47122
|
-
|
|
47185
|
+
_context60.next = 5;
|
|
47123
47186
|
break;
|
|
47124
47187
|
}
|
|
47125
47188
|
currentVideoFilter = null;
|
|
47126
47189
|
logAnalyticsEvent('clearVideoFilter', 'Success');
|
|
47127
|
-
return
|
|
47190
|
+
return _context60.abrupt("return");
|
|
47128
47191
|
case 5:
|
|
47129
47192
|
if (!(!mediaProcessor.getVideoFilter() && !currentVideoFilter)) {
|
|
47130
|
-
|
|
47193
|
+
_context60.next = 10;
|
|
47131
47194
|
break;
|
|
47132
47195
|
}
|
|
47133
47196
|
message = 'Ignoring. No video filter applied';
|
|
@@ -47135,10 +47198,10 @@ function PublisherFactory(_ref) {
|
|
|
47135
47198
|
message
|
|
47136
47199
|
});
|
|
47137
47200
|
logging.debug(message);
|
|
47138
|
-
return
|
|
47201
|
+
return _context60.abrupt("return");
|
|
47139
47202
|
case 10:
|
|
47140
47203
|
if (MediaProcessor.isSupported('video')) {
|
|
47141
|
-
|
|
47204
|
+
_context60.next = 15;
|
|
47142
47205
|
break;
|
|
47143
47206
|
}
|
|
47144
47207
|
message = 'Ignoring. "clearVideoFilter" not supported.';
|
|
@@ -47146,10 +47209,10 @@ function PublisherFactory(_ref) {
|
|
|
47146
47209
|
message
|
|
47147
47210
|
});
|
|
47148
47211
|
logging.warn(message);
|
|
47149
|
-
return
|
|
47212
|
+
return _context60.abrupt("return");
|
|
47150
47213
|
case 15:
|
|
47151
47214
|
if (webRTCStream) {
|
|
47152
|
-
|
|
47215
|
+
_context60.next = 20;
|
|
47153
47216
|
break;
|
|
47154
47217
|
}
|
|
47155
47218
|
message = 'Ignoring. No mediaStream';
|
|
@@ -47157,44 +47220,44 @@ function PublisherFactory(_ref) {
|
|
|
47157
47220
|
message
|
|
47158
47221
|
});
|
|
47159
47222
|
logging.warn(message);
|
|
47160
|
-
return
|
|
47223
|
+
return _context60.abrupt("return");
|
|
47161
47224
|
case 20:
|
|
47162
47225
|
oldVideoFilter = currentVideoFilter;
|
|
47163
47226
|
currentVideoFilter = null;
|
|
47164
47227
|
_webRTCStream$getVide5 = webRTCStream.getVideoTracks(), filteredVideoTrack = _webRTCStream$getVide5[0];
|
|
47165
|
-
|
|
47166
|
-
|
|
47228
|
+
_context60.prev = 23;
|
|
47229
|
+
_context60.next = 26;
|
|
47167
47230
|
return getTrackFromDeviceId(currentDeviceId);
|
|
47168
47231
|
case 26:
|
|
47169
|
-
videoTrack =
|
|
47170
|
-
|
|
47232
|
+
videoTrack = _context60.sent;
|
|
47233
|
+
_context60.next = 33;
|
|
47171
47234
|
break;
|
|
47172
47235
|
case 29:
|
|
47173
|
-
|
|
47174
|
-
|
|
47175
|
-
logging.error(
|
|
47176
|
-
return
|
|
47236
|
+
_context60.prev = 29;
|
|
47237
|
+
_context60.t0 = _context60["catch"](23);
|
|
47238
|
+
logging.error(_context60.t0);
|
|
47239
|
+
return _context60.abrupt("return");
|
|
47177
47240
|
case 33:
|
|
47178
47241
|
if (videoTrack) {
|
|
47179
|
-
|
|
47242
|
+
_context60.next = 36;
|
|
47180
47243
|
break;
|
|
47181
47244
|
}
|
|
47182
47245
|
logging.warn('Failed to clear filter because there is no video track.');
|
|
47183
|
-
return
|
|
47246
|
+
return _context60.abrupt("return");
|
|
47184
47247
|
case 36:
|
|
47185
47248
|
filteredVideoTrackId = null;
|
|
47186
|
-
|
|
47187
|
-
|
|
47249
|
+
_context60.prev = 37;
|
|
47250
|
+
_context60.next = 40;
|
|
47188
47251
|
return replaceTrackAndUpdate(filteredVideoTrack, videoTrack);
|
|
47189
47252
|
case 40:
|
|
47190
|
-
|
|
47253
|
+
_context60.next = 42;
|
|
47191
47254
|
return destroyMediaProcessor();
|
|
47192
47255
|
case 42:
|
|
47193
|
-
|
|
47256
|
+
_context60.next = 47;
|
|
47194
47257
|
break;
|
|
47195
47258
|
case 44:
|
|
47196
|
-
|
|
47197
|
-
|
|
47259
|
+
_context60.prev = 44;
|
|
47260
|
+
_context60.t1 = _context60["catch"](37);
|
|
47198
47261
|
// Restore the previous filter since this call has failed. This way, this function can be
|
|
47199
47262
|
// called again if needed.
|
|
47200
47263
|
currentVideoFilter = oldVideoFilter;
|
|
@@ -47202,29 +47265,29 @@ function PublisherFactory(_ref) {
|
|
|
47202
47265
|
logAnalyticsEvent('clearVideoFilter', 'Success');
|
|
47203
47266
|
case 48:
|
|
47204
47267
|
case "end":
|
|
47205
|
-
return
|
|
47268
|
+
return _context60.stop();
|
|
47206
47269
|
}
|
|
47207
|
-
},
|
|
47270
|
+
}, _callee60, null, [[23, 29], [37, 44]]);
|
|
47208
47271
|
}));
|
|
47209
47272
|
const applySetMaxBitrateToPeerConnection = /*#__PURE__*/function () {
|
|
47210
|
-
var
|
|
47273
|
+
var _ref68 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(peerConnection) {
|
|
47211
47274
|
var maxBitrateHasChanged, isPreset;
|
|
47212
|
-
return _regenerator.default.wrap(function
|
|
47213
|
-
while (1) switch (
|
|
47275
|
+
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
47276
|
+
while (1) switch (_context61.prev = _context61.next) {
|
|
47214
47277
|
case 0:
|
|
47215
|
-
|
|
47278
|
+
_context61.next = 2;
|
|
47216
47279
|
return peerConnection.setMaxBitrate(_videoMaxBitrateSetting);
|
|
47217
47280
|
case 2:
|
|
47218
|
-
maxBitrateHasChanged =
|
|
47281
|
+
maxBitrateHasChanged = _context61.sent;
|
|
47219
47282
|
if (!maxBitrateHasChanged) {
|
|
47220
|
-
|
|
47283
|
+
_context61.next = 8;
|
|
47221
47284
|
break;
|
|
47222
47285
|
}
|
|
47223
47286
|
if (!(_videoMaxBitrateSetting === 0)) {
|
|
47224
|
-
|
|
47287
|
+
_context61.next = 6;
|
|
47225
47288
|
break;
|
|
47226
47289
|
}
|
|
47227
|
-
return
|
|
47290
|
+
return _context61.abrupt("return");
|
|
47228
47291
|
case 6:
|
|
47229
47292
|
isPreset = typeof _videoMaxBitrateSetting === 'string';
|
|
47230
47293
|
if (isPreset) {
|
|
@@ -47236,12 +47299,12 @@ function PublisherFactory(_ref) {
|
|
|
47236
47299
|
}
|
|
47237
47300
|
case 8:
|
|
47238
47301
|
case "end":
|
|
47239
|
-
return
|
|
47302
|
+
return _context61.stop();
|
|
47240
47303
|
}
|
|
47241
|
-
},
|
|
47304
|
+
}, _callee61);
|
|
47242
47305
|
}));
|
|
47243
|
-
return function applySetMaxBitrateToPeerConnection(
|
|
47244
|
-
return
|
|
47306
|
+
return function applySetMaxBitrateToPeerConnection(_x49) {
|
|
47307
|
+
return _ref68.apply(this, arguments);
|
|
47245
47308
|
};
|
|
47246
47309
|
}();
|
|
47247
47310
|
|
|
@@ -47269,16 +47332,16 @@ function PublisherFactory(_ref) {
|
|
|
47269
47332
|
*/
|
|
47270
47333
|
this.getVideoBitratePreset = () => properties.videoBitratePreset;
|
|
47271
47334
|
const setMaxVideoBitrateToPublisher = /*#__PURE__*/function () {
|
|
47272
|
-
var
|
|
47335
|
+
var _ref69 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63(peerConnection) {
|
|
47273
47336
|
var logOptions, applyMaxBitrate, peerConnections;
|
|
47274
|
-
return _regenerator.default.wrap(function
|
|
47275
|
-
while (1) switch (
|
|
47337
|
+
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
47338
|
+
while (1) switch (_context63.prev = _context63.next) {
|
|
47276
47339
|
case 0:
|
|
47277
47340
|
if (!(_videoMaxBitrateSetting === undefined)) {
|
|
47278
|
-
|
|
47341
|
+
_context63.next = 2;
|
|
47279
47342
|
break;
|
|
47280
47343
|
}
|
|
47281
|
-
return
|
|
47344
|
+
return _context63.abrupt("return");
|
|
47282
47345
|
case 2:
|
|
47283
47346
|
if (isNaN(_videoMaxBitrateSetting)) {
|
|
47284
47347
|
logOptions = {
|
|
@@ -47294,57 +47357,57 @@ function PublisherFactory(_ref) {
|
|
|
47294
47357
|
logOptions.NearestResolution = (0, _getSpatialResolution.default)(_this.videoWidth(), _this.videoHeight());
|
|
47295
47358
|
logAnalyticsEvent('SetMaxVideoBitrateOnRtpSender', 'Attempt', {}, logOptions);
|
|
47296
47359
|
applyMaxBitrate = /*#__PURE__*/function () {
|
|
47297
|
-
var
|
|
47298
|
-
return _regenerator.default.wrap(function
|
|
47299
|
-
while (1) switch (
|
|
47360
|
+
var _ref70 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62(pc) {
|
|
47361
|
+
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
47362
|
+
while (1) switch (_context62.prev = _context62.next) {
|
|
47300
47363
|
case 0:
|
|
47301
|
-
|
|
47302
|
-
|
|
47364
|
+
_context62.prev = 0;
|
|
47365
|
+
_context62.next = 3;
|
|
47303
47366
|
return applySetMaxBitrateToPeerConnection(pc);
|
|
47304
47367
|
case 3:
|
|
47305
47368
|
logAnalyticsEvent('SetMaxVideoBitrateOnRtpSender', 'Success', {}, logOptions);
|
|
47306
|
-
|
|
47369
|
+
_context62.next = 11;
|
|
47307
47370
|
break;
|
|
47308
47371
|
case 6:
|
|
47309
|
-
|
|
47310
|
-
|
|
47311
|
-
logOptions.failureReason =
|
|
47372
|
+
_context62.prev = 6;
|
|
47373
|
+
_context62.t0 = _context62["catch"](0);
|
|
47374
|
+
logOptions.failureReason = _context62.t0.message;
|
|
47312
47375
|
logAnalyticsEvent('SetMaxVideoBitrateOnRtpSender', 'Failure', {}, logOptions);
|
|
47313
47376
|
throw otError(Errors.UNEXPECTED_ERROR_CODE, new Error('An unexpected error was encountered'));
|
|
47314
47377
|
case 11:
|
|
47315
47378
|
case "end":
|
|
47316
|
-
return
|
|
47379
|
+
return _context62.stop();
|
|
47317
47380
|
}
|
|
47318
|
-
},
|
|
47381
|
+
}, _callee62, null, [[0, 6]]);
|
|
47319
47382
|
}));
|
|
47320
|
-
return function applyMaxBitrate(
|
|
47321
|
-
return
|
|
47383
|
+
return function applyMaxBitrate(_x51) {
|
|
47384
|
+
return _ref70.apply(this, arguments);
|
|
47322
47385
|
};
|
|
47323
47386
|
}();
|
|
47324
47387
|
if (!peerConnection) {
|
|
47325
|
-
|
|
47388
|
+
_context63.next = 11;
|
|
47326
47389
|
break;
|
|
47327
47390
|
}
|
|
47328
|
-
|
|
47391
|
+
_context63.next = 9;
|
|
47329
47392
|
return applyMaxBitrate(peerConnection);
|
|
47330
47393
|
case 9:
|
|
47331
|
-
|
|
47394
|
+
_context63.next = 16;
|
|
47332
47395
|
break;
|
|
47333
47396
|
case 11:
|
|
47334
|
-
|
|
47397
|
+
_context63.next = 13;
|
|
47335
47398
|
return getAllPeerConnections();
|
|
47336
47399
|
case 13:
|
|
47337
|
-
peerConnections =
|
|
47338
|
-
|
|
47400
|
+
peerConnections = _context63.sent;
|
|
47401
|
+
_context63.next = 16;
|
|
47339
47402
|
return Promise.all(peerConnections.map(applyMaxBitrate));
|
|
47340
47403
|
case 16:
|
|
47341
47404
|
case "end":
|
|
47342
|
-
return
|
|
47405
|
+
return _context63.stop();
|
|
47343
47406
|
}
|
|
47344
|
-
},
|
|
47407
|
+
}, _callee63);
|
|
47345
47408
|
}));
|
|
47346
|
-
return function setMaxVideoBitrateToPublisher(
|
|
47347
|
-
return
|
|
47409
|
+
return function setMaxVideoBitrateToPublisher(_x50) {
|
|
47410
|
+
return _ref69.apply(this, arguments);
|
|
47348
47411
|
};
|
|
47349
47412
|
}();
|
|
47350
47413
|
const applyVideoConstraintsTo = track => {
|
|
@@ -47364,9 +47427,17 @@ function PublisherFactory(_ref) {
|
|
|
47364
47427
|
};
|
|
47365
47428
|
return (0, _videoConstraints.default)(track, constraints);
|
|
47366
47429
|
};
|
|
47430
|
+
|
|
47431
|
+
// Returns the settings of the most authoritative video track, using the same
|
|
47432
|
+
// priority order as applyVideoConstraints (original track before processed track).
|
|
47433
|
+
const getPreferredVideoTrackSettings = () => {
|
|
47434
|
+
var _videoMediaProcessorC, _webRTCStream, _webRTCStream$getVide6, _track$getSettings;
|
|
47435
|
+
const track = typeof (mediaProcessor == null ? void 0 : mediaProcessor.getOriginalVideoTrack) === 'function' && mediaProcessor.getOriginalVideoTrack() || ((_videoMediaProcessorC = _videoMediaProcessorConnector) == null ? void 0 : _videoMediaProcessorC.originalTrack) || ((_webRTCStream = webRTCStream) == null ? void 0 : (_webRTCStream$getVide6 = _webRTCStream.getVideoTracks()) == null ? void 0 : _webRTCStream$getVide6[0]);
|
|
47436
|
+
return (_track$getSettings = track == null ? void 0 : track.getSettings()) != null ? _track$getSettings : {};
|
|
47437
|
+
};
|
|
47367
47438
|
const applyVideoConstraints = () => {
|
|
47368
|
-
var
|
|
47369
|
-
const videoTracks = [mediaProcessor == null ? void 0 : mediaProcessor.getOriginalVideoTrack(), (
|
|
47439
|
+
var _videoMediaProcessorC2;
|
|
47440
|
+
const videoTracks = [typeof (mediaProcessor == null ? void 0 : mediaProcessor.getOriginalVideoTrack) === 'function' && mediaProcessor.getOriginalVideoTrack(), (_videoMediaProcessorC2 = _videoMediaProcessorConnector) == null ? void 0 : _videoMediaProcessorC2.originalTrack, ...webRTCStream.getVideoTracks()].filter(track => {
|
|
47370
47441
|
var _window$MediaStreamTr;
|
|
47371
47442
|
return track && (
|
|
47372
47443
|
// On Chrome both original and filtered track (instance of MediaStreamTrackGenerator) need to
|
|
@@ -47400,17 +47471,17 @@ function PublisherFactory(_ref) {
|
|
|
47400
47471
|
* @memberOf Publisher
|
|
47401
47472
|
*/
|
|
47402
47473
|
this.setPreferredResolution = /*#__PURE__*/function () {
|
|
47403
|
-
var
|
|
47404
|
-
var
|
|
47405
|
-
var message, startingWidth, startingHeight, startingArea, preferredArea, result;
|
|
47406
|
-
return _regenerator.default.wrap(function
|
|
47407
|
-
while (1) switch (
|
|
47474
|
+
var _ref71 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64(preferredResolution) {
|
|
47475
|
+
var _webRTCStream2, _webRTCStream2$getVid, _properties$videoDime3, _properties$videoDime4;
|
|
47476
|
+
var message, startingWidth, startingHeight, startingArea, preferredArea, result, _getPreferredVideoTra2, width, height;
|
|
47477
|
+
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
47478
|
+
while (1) switch (_context64.prev = _context64.next) {
|
|
47408
47479
|
case 0:
|
|
47409
47480
|
logAnalyticsEvent('setPreferredResolution', 'Attempt', {
|
|
47410
47481
|
preferredResolution
|
|
47411
47482
|
});
|
|
47412
|
-
if (!(!properties.publishVideo || !((
|
|
47413
|
-
|
|
47483
|
+
if (!(!properties.publishVideo || !((_webRTCStream2 = webRTCStream) != null && (_webRTCStream2$getVid = _webRTCStream2.getVideoTracks()) != null && _webRTCStream2$getVid.length))) {
|
|
47484
|
+
_context64.next = 5;
|
|
47414
47485
|
break;
|
|
47415
47486
|
}
|
|
47416
47487
|
message = 'setPreferredResolution needs to be called on a video publisher';
|
|
@@ -47421,7 +47492,7 @@ function PublisherFactory(_ref) {
|
|
|
47421
47492
|
throw new Error(message);
|
|
47422
47493
|
case 5:
|
|
47423
47494
|
if (!(!preferredResolution || !Number.isInteger(preferredResolution.width) || preferredResolution.width <= 0 || !Number.isInteger(preferredResolution.height) || preferredResolution.height <= 0)) {
|
|
47424
|
-
|
|
47495
|
+
_context64.next = 9;
|
|
47425
47496
|
break;
|
|
47426
47497
|
}
|
|
47427
47498
|
message = 'preferredResolution must be an object with positive integer width and height properties';
|
|
@@ -47436,7 +47507,7 @@ function PublisherFactory(_ref) {
|
|
|
47436
47507
|
startingArea = startingWidth * startingHeight;
|
|
47437
47508
|
preferredArea = preferredResolution.width * preferredResolution.height;
|
|
47438
47509
|
if (!(preferredArea > startingArea)) {
|
|
47439
|
-
|
|
47510
|
+
_context64.next = 17;
|
|
47440
47511
|
break;
|
|
47441
47512
|
}
|
|
47442
47513
|
message = 'preferredResolution cannot be higher than the initial ' + 'publishing resolution';
|
|
@@ -47448,31 +47519,49 @@ function PublisherFactory(_ref) {
|
|
|
47448
47519
|
case 17:
|
|
47449
47520
|
_preferredWidth = preferredResolution.width;
|
|
47450
47521
|
_preferredHeight = preferredResolution.height;
|
|
47451
|
-
|
|
47452
|
-
|
|
47522
|
+
// Suppress videoDimensionsChanged before applying constraints: the video element
|
|
47523
|
+
// resize triggered by applyVideoConstraints() would otherwise cause a duplicate
|
|
47524
|
+
// streamChannelUpdate. We do the signaling ourselves below with the actual track settings.
|
|
47525
|
+
_suppressVideoDimensionsSignaling = true;
|
|
47526
|
+
_context64.prev = 20;
|
|
47527
|
+
_context64.prev = 21;
|
|
47528
|
+
_context64.next = 24;
|
|
47453
47529
|
return applyVideoConstraints();
|
|
47454
|
-
case
|
|
47455
|
-
result =
|
|
47530
|
+
case 24:
|
|
47531
|
+
result = _context64.sent;
|
|
47532
|
+
if (_this.stream) {
|
|
47533
|
+
_getPreferredVideoTra2 = getPreferredVideoTrackSettings(), width = _getPreferredVideoTra2.width, height = _getPreferredVideoTra2.height;
|
|
47534
|
+
if (width && height) {
|
|
47535
|
+
_this.stream.setVideoDimensions(width, height);
|
|
47536
|
+
}
|
|
47537
|
+
}
|
|
47456
47538
|
logAnalyticsEvent('setPreferredResolution', 'Success', {
|
|
47457
47539
|
preferredResolution
|
|
47458
47540
|
});
|
|
47459
|
-
return
|
|
47460
|
-
case
|
|
47461
|
-
|
|
47462
|
-
|
|
47541
|
+
return _context64.abrupt("return", result);
|
|
47542
|
+
case 28:
|
|
47543
|
+
_context64.prev = 28;
|
|
47544
|
+
_suppressVideoDimensionsSignaling = false;
|
|
47545
|
+
return _context64.finish(28);
|
|
47546
|
+
case 31:
|
|
47547
|
+
_context64.next = 37;
|
|
47548
|
+
break;
|
|
47549
|
+
case 33:
|
|
47550
|
+
_context64.prev = 33;
|
|
47551
|
+
_context64.t0 = _context64["catch"](20);
|
|
47463
47552
|
logAnalyticsEvent('setPreferredResolution', 'Failure', {
|
|
47464
47553
|
preferredResolution,
|
|
47465
|
-
message:
|
|
47554
|
+
message: _context64.t0.message
|
|
47466
47555
|
});
|
|
47467
|
-
throw
|
|
47468
|
-
case
|
|
47556
|
+
throw _context64.t0;
|
|
47557
|
+
case 37:
|
|
47469
47558
|
case "end":
|
|
47470
|
-
return
|
|
47559
|
+
return _context64.stop();
|
|
47471
47560
|
}
|
|
47472
|
-
},
|
|
47561
|
+
}, _callee64, null, [[20, 33], [21,, 28, 31]]);
|
|
47473
47562
|
}));
|
|
47474
|
-
return function (
|
|
47475
|
-
return
|
|
47563
|
+
return function (_x52) {
|
|
47564
|
+
return _ref71.apply(this, arguments);
|
|
47476
47565
|
};
|
|
47477
47566
|
}();
|
|
47478
47567
|
|
|
@@ -47493,17 +47582,17 @@ function PublisherFactory(_ref) {
|
|
|
47493
47582
|
* @memberOf Publisher
|
|
47494
47583
|
*/
|
|
47495
47584
|
this.setPreferredFrameRate = /*#__PURE__*/function () {
|
|
47496
|
-
var
|
|
47497
|
-
var
|
|
47498
|
-
var message, result;
|
|
47499
|
-
return _regenerator.default.wrap(function
|
|
47500
|
-
while (1) switch (
|
|
47585
|
+
var _ref72 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65(frameRate) {
|
|
47586
|
+
var _webRTCStream3, _webRTCStream3$getVid;
|
|
47587
|
+
var message, result, _getPreferredVideoTra3, actualFrameRate;
|
|
47588
|
+
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
47589
|
+
while (1) switch (_context65.prev = _context65.next) {
|
|
47501
47590
|
case 0:
|
|
47502
47591
|
logAnalyticsEvent('setPreferredFrameRate', 'Attempt', {
|
|
47503
47592
|
frameRate
|
|
47504
47593
|
});
|
|
47505
|
-
if (!(!properties.publishVideo || !((
|
|
47506
|
-
|
|
47594
|
+
if (!(!properties.publishVideo || !((_webRTCStream3 = webRTCStream) != null && (_webRTCStream3$getVid = _webRTCStream3.getVideoTracks()) != null && _webRTCStream3$getVid.length))) {
|
|
47595
|
+
_context65.next = 5;
|
|
47507
47596
|
break;
|
|
47508
47597
|
}
|
|
47509
47598
|
message = 'setPreferredFrameRate needs to be called on a video publisher';
|
|
@@ -47514,7 +47603,7 @@ function PublisherFactory(_ref) {
|
|
|
47514
47603
|
throw new Error(message);
|
|
47515
47604
|
case 5:
|
|
47516
47605
|
if (!(!Number.isInteger(frameRate) || frameRate < 1)) {
|
|
47517
|
-
|
|
47606
|
+
_context65.next = 9;
|
|
47518
47607
|
break;
|
|
47519
47608
|
}
|
|
47520
47609
|
message = 'Invalid frameRate: must be an integer ≥ 1';
|
|
@@ -47525,31 +47614,37 @@ function PublisherFactory(_ref) {
|
|
|
47525
47614
|
throw new Error(message);
|
|
47526
47615
|
case 9:
|
|
47527
47616
|
_preferredFrameRate = frameRate;
|
|
47528
|
-
|
|
47529
|
-
|
|
47617
|
+
_context65.prev = 10;
|
|
47618
|
+
_context65.next = 13;
|
|
47530
47619
|
return applyVideoConstraints();
|
|
47531
47620
|
case 13:
|
|
47532
|
-
result =
|
|
47621
|
+
result = _context65.sent;
|
|
47622
|
+
if (_this.stream) {
|
|
47623
|
+
_getPreferredVideoTra3 = getPreferredVideoTrackSettings(), actualFrameRate = _getPreferredVideoTra3.frameRate;
|
|
47624
|
+
if (actualFrameRate) {
|
|
47625
|
+
_this.stream.setVideoFrameRate(actualFrameRate);
|
|
47626
|
+
}
|
|
47627
|
+
}
|
|
47533
47628
|
logAnalyticsEvent('setPreferredFrameRate', 'Success', {
|
|
47534
47629
|
frameRate
|
|
47535
47630
|
});
|
|
47536
|
-
return
|
|
47537
|
-
case
|
|
47538
|
-
|
|
47539
|
-
|
|
47631
|
+
return _context65.abrupt("return", result);
|
|
47632
|
+
case 19:
|
|
47633
|
+
_context65.prev = 19;
|
|
47634
|
+
_context65.t0 = _context65["catch"](10);
|
|
47540
47635
|
logAnalyticsEvent('setPreferredFrameRate', 'Failure', {
|
|
47541
47636
|
frameRate,
|
|
47542
|
-
message:
|
|
47637
|
+
message: _context65.t0.message
|
|
47543
47638
|
});
|
|
47544
|
-
throw
|
|
47545
|
-
case
|
|
47639
|
+
throw _context65.t0;
|
|
47640
|
+
case 23:
|
|
47546
47641
|
case "end":
|
|
47547
|
-
return
|
|
47642
|
+
return _context65.stop();
|
|
47548
47643
|
}
|
|
47549
|
-
},
|
|
47644
|
+
}, _callee65, null, [[10, 19]]);
|
|
47550
47645
|
}));
|
|
47551
|
-
return function (
|
|
47552
|
-
return
|
|
47646
|
+
return function (_x53) {
|
|
47647
|
+
return _ref72.apply(this, arguments);
|
|
47553
47648
|
};
|
|
47554
47649
|
}();
|
|
47555
47650
|
|
|
@@ -47573,44 +47668,44 @@ function PublisherFactory(_ref) {
|
|
|
47573
47668
|
* @memberOf Publisher
|
|
47574
47669
|
*/
|
|
47575
47670
|
this.setMaxVideoBitrate = /*#__PURE__*/function () {
|
|
47576
|
-
var
|
|
47671
|
+
var _ref73 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66(bitrateBps) {
|
|
47577
47672
|
var bitrate;
|
|
47578
|
-
return _regenerator.default.wrap(function
|
|
47579
|
-
while (1) switch (
|
|
47673
|
+
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
47674
|
+
while (1) switch (_context66.prev = _context66.next) {
|
|
47580
47675
|
case 0:
|
|
47581
47676
|
if (!(typeof bitrateBps !== 'number')) {
|
|
47582
|
-
|
|
47677
|
+
_context66.next = 2;
|
|
47583
47678
|
break;
|
|
47584
47679
|
}
|
|
47585
47680
|
throw otError(Errors.INVALID_PARAMETER, new Error('Invalid bitrate: it must be 0 or any number between 5000 and 10000000'));
|
|
47586
47681
|
case 2:
|
|
47587
47682
|
bitrate = parseInt(bitrateBps, 10);
|
|
47588
47683
|
if (!(isNaN(bitrate) || bitrate !== 0 && (bitrate < 5000 || bitrate > 10000000))) {
|
|
47589
|
-
|
|
47684
|
+
_context66.next = 5;
|
|
47590
47685
|
break;
|
|
47591
47686
|
}
|
|
47592
47687
|
throw otError(Errors.INVALID_PARAMETER, new Error('Invalid bitrate: it must be 0 or any number between 5000 and 10000000'));
|
|
47593
47688
|
case 5:
|
|
47594
47689
|
_videoMaxBitrateSetting = bitrate === 0 ? _VideoBitratePreset.default.DEFAULT : bitrate;
|
|
47595
47690
|
if (isAudioFallbackActive()) {
|
|
47596
|
-
|
|
47691
|
+
_context66.next = 11;
|
|
47597
47692
|
break;
|
|
47598
47693
|
}
|
|
47599
|
-
|
|
47694
|
+
_context66.next = 9;
|
|
47600
47695
|
return setMaxVideoBitrateToPublisher();
|
|
47601
47696
|
case 9:
|
|
47602
|
-
|
|
47697
|
+
_context66.next = 12;
|
|
47603
47698
|
break;
|
|
47604
47699
|
case 11:
|
|
47605
47700
|
logging.debug('Video is currently inactive, max bitrate will be applied once active.');
|
|
47606
47701
|
case 12:
|
|
47607
47702
|
case "end":
|
|
47608
|
-
return
|
|
47703
|
+
return _context66.stop();
|
|
47609
47704
|
}
|
|
47610
|
-
},
|
|
47705
|
+
}, _callee66);
|
|
47611
47706
|
}));
|
|
47612
|
-
return function (
|
|
47613
|
-
return
|
|
47707
|
+
return function (_x54) {
|
|
47708
|
+
return _ref73.apply(this, arguments);
|
|
47614
47709
|
};
|
|
47615
47710
|
}();
|
|
47616
47711
|
|
|
@@ -47632,44 +47727,44 @@ function PublisherFactory(_ref) {
|
|
|
47632
47727
|
* @memberOf Publisher
|
|
47633
47728
|
*/
|
|
47634
47729
|
this.setVideoBitratePreset = /*#__PURE__*/function () {
|
|
47635
|
-
var
|
|
47730
|
+
var _ref74 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee67(preset) {
|
|
47636
47731
|
var filteredPreset;
|
|
47637
|
-
return _regenerator.default.wrap(function
|
|
47638
|
-
while (1) switch (
|
|
47732
|
+
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
47733
|
+
while (1) switch (_context67.prev = _context67.next) {
|
|
47639
47734
|
case 0:
|
|
47640
47735
|
if (!(typeof preset !== 'string')) {
|
|
47641
|
-
|
|
47736
|
+
_context67.next = 2;
|
|
47642
47737
|
break;
|
|
47643
47738
|
}
|
|
47644
47739
|
throw otError(Errors.INVALID_PARAMETER, new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));
|
|
47645
47740
|
case 2:
|
|
47646
47741
|
filteredPreset = _VideoBitratePreset.default[preset.toUpperCase()];
|
|
47647
47742
|
if (!(filteredPreset === undefined)) {
|
|
47648
|
-
|
|
47743
|
+
_context67.next = 5;
|
|
47649
47744
|
break;
|
|
47650
47745
|
}
|
|
47651
47746
|
throw otError(Errors.INVALID_PARAMETER, new Error('Invalid preset. It must be either "default", "bw_saver", or "extra_bw_saver"'));
|
|
47652
47747
|
case 5:
|
|
47653
47748
|
_videoMaxBitrateSetting = filteredPreset;
|
|
47654
47749
|
if (isAudioFallbackActive()) {
|
|
47655
|
-
|
|
47750
|
+
_context67.next = 11;
|
|
47656
47751
|
break;
|
|
47657
47752
|
}
|
|
47658
|
-
|
|
47753
|
+
_context67.next = 9;
|
|
47659
47754
|
return setMaxVideoBitrateToPublisher();
|
|
47660
47755
|
case 9:
|
|
47661
|
-
|
|
47756
|
+
_context67.next = 12;
|
|
47662
47757
|
break;
|
|
47663
47758
|
case 11:
|
|
47664
47759
|
logging.debug('Video is currently inactive, bitrate preset will be applied once active.');
|
|
47665
47760
|
case 12:
|
|
47666
47761
|
case "end":
|
|
47667
|
-
return
|
|
47762
|
+
return _context67.stop();
|
|
47668
47763
|
}
|
|
47669
|
-
},
|
|
47764
|
+
}, _callee67);
|
|
47670
47765
|
}));
|
|
47671
|
-
return function (
|
|
47672
|
-
return
|
|
47766
|
+
return function (_x55) {
|
|
47767
|
+
return _ref74.apply(this, arguments);
|
|
47673
47768
|
};
|
|
47674
47769
|
}();
|
|
47675
47770
|
|
|
@@ -66929,13 +67024,14 @@ function SessionFactory(deps) {
|
|
|
66929
67024
|
// If the publisher already has a session attached to it we can
|
|
66930
67025
|
if ('session' in publisher && publisher.session && 'sessionId' in publisher.session) {
|
|
66931
67026
|
// send a warning message that we can't publish again.
|
|
67027
|
+
let msg;
|
|
66932
67028
|
if (publisher.session.sessionId === this.sessionId) {
|
|
66933
|
-
|
|
67029
|
+
msg = `Cannot publish ${publisher.guid()} again to ${this.sessionId}. Please call session.unpublish(publisher) first.`;
|
|
66934
67030
|
} else {
|
|
66935
|
-
|
|
67031
|
+
msg = `Cannot publish ${publisher.guid()} publisher already attached to ${publisher.session.sessionId}. Please call session.unpublish(publisher) first.`;
|
|
66936
67032
|
}
|
|
66937
|
-
|
|
66938
|
-
return
|
|
67033
|
+
dispatchOTError(otError(errors.INVALID_PARAMETER, new Error(msg), ExceptionCodes.UNABLE_TO_PUBLISH), completionHandler);
|
|
67034
|
+
return undefined;
|
|
66939
67035
|
}
|
|
66940
67036
|
} else if (shouldInitPublisher) {
|
|
66941
67037
|
// Initiate a new Publisher with the new session credentials
|
|
@@ -67840,9 +67936,9 @@ function SessionFactory(deps) {
|
|
|
67840
67936
|
customProperties = _ref4.customProperties;
|
|
67841
67937
|
if (!_socket) {
|
|
67842
67938
|
_logging.warn('You are disconnected, cannot create stream ', streamId);
|
|
67843
|
-
return;
|
|
67939
|
+
return null;
|
|
67844
67940
|
}
|
|
67845
|
-
_socket.streamCreate({
|
|
67941
|
+
return _socket.streamCreate({
|
|
67846
67942
|
name,
|
|
67847
67943
|
streamId,
|
|
67848
67944
|
subscriberAudioFallbackEnabled,
|
|
@@ -106001,6 +106097,9 @@ function Stream(id, name, creationTime, connection, session, channel, initials,
|
|
|
106001
106097
|
case 'videoDimensions':
|
|
106002
106098
|
self.videoDimensions = newValue;
|
|
106003
106099
|
break;
|
|
106100
|
+
case 'frameRate':
|
|
106101
|
+
self.frameRate = newValue;
|
|
106102
|
+
break;
|
|
106004
106103
|
case 'orientation':
|
|
106005
106104
|
case 'width':
|
|
106006
106105
|
case 'height':
|
|
@@ -106105,6 +106204,11 @@ function Stream(id, name, creationTime, connection, session, channel, initials,
|
|
|
106105
106204
|
orientation: 0
|
|
106106
106205
|
});
|
|
106107
106206
|
};
|
|
106207
|
+
this.setVideoFrameRate = function setVideoFrameRate(frameRate) {
|
|
106208
|
+
updateChannelsOfType('video', {
|
|
106209
|
+
frameRate
|
|
106210
|
+
});
|
|
106211
|
+
};
|
|
106108
106212
|
this.setRestrictFrameRate = function setRestrictFrameRate(restrict, completion) {
|
|
106109
106213
|
if (completion === void 0) {
|
|
106110
106214
|
completion = () => {};
|