@opentok/client 2.35.0-alpha.63 → 2.35.0-alpha.64
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 +185 -148
- package/dist/js/opentok.js.map +1 -1
- package/dist/js/opentok.min.js +3 -3
- package/dist/js/opentok.min.js.map +1 -1
- package/package.json +1 -1
package/dist/js/opentok.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license OpenTok.js 2.35.0
|
|
2
|
+
* @license OpenTok.js 2.35.0 dbe63a129
|
|
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, 01 Jul 2026 15:48:18 GMT
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
@@ -39551,7 +39551,7 @@ function staticConfigFactory(_temp) {
|
|
|
39551
39551
|
_ref$axios = _ref.axios,
|
|
39552
39552
|
axios = _ref$axios === void 0 ? _axios.default : _ref$axios,
|
|
39553
39553
|
_ref$properties = _ref.properties,
|
|
39554
|
-
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"
|
|
39554
|
+
properties = _ref$properties === void 0 ? {"version":"v2.35.0","buildHash":"dbe63a129","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;
|
|
39555
39555
|
/** @type builtInConfig */
|
|
39556
39556
|
const builtInConfig = (0, _cloneDeep.default)(properties);
|
|
39557
39557
|
/**
|
|
@@ -43900,37 +43900,42 @@ function PublisherFactory(_ref) {
|
|
|
43900
43900
|
refreshAudioVideoUI();
|
|
43901
43901
|
};
|
|
43902
43902
|
const destroyMediaProcessor = /*#__PURE__*/function () {
|
|
43903
|
-
var _ref38 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
|
|
43904
|
-
var videoTrack;
|
|
43903
|
+
var _ref38 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27(_temp) {
|
|
43904
|
+
var _ref39, _ref39$keepOriginalTr, keepOriginalTrack, videoTrack;
|
|
43905
43905
|
return _regenerator.default.wrap(function _callee27$(_context27) {
|
|
43906
43906
|
while (1) switch (_context27.prev = _context27.next) {
|
|
43907
43907
|
case 0:
|
|
43908
|
+
_ref39 = _temp === void 0 ? {} : _temp, _ref39$keepOriginalTr = _ref39.keepOriginalTrack, keepOriginalTrack = _ref39$keepOriginalTr === void 0 ? false : _ref39$keepOriginalTr;
|
|
43908
43909
|
// We need to cache this since calling the method below will
|
|
43909
43910
|
// clear this value.
|
|
43910
43911
|
videoTrack = mediaProcessor.getOriginalVideoTrack(); // Note: this needs to be called before the `stop` method below. Reversing
|
|
43911
43912
|
// the order may cause race conditions with the MP worker.
|
|
43912
|
-
_context27.prev =
|
|
43913
|
-
_context27.next =
|
|
43913
|
+
_context27.prev = 2;
|
|
43914
|
+
_context27.next = 5;
|
|
43914
43915
|
return mediaProcessor.destroy();
|
|
43915
|
-
case
|
|
43916
|
-
_context27.next =
|
|
43916
|
+
case 5:
|
|
43917
|
+
_context27.next = 10;
|
|
43917
43918
|
break;
|
|
43918
|
-
case
|
|
43919
|
-
_context27.prev =
|
|
43920
|
-
_context27.t0 = _context27["catch"](
|
|
43919
|
+
case 7:
|
|
43920
|
+
_context27.prev = 7;
|
|
43921
|
+
_context27.t0 = _context27["catch"](2);
|
|
43921
43922
|
logging.warn(`Error cleaning up mediaProcessor: ${_context27.t0}`);
|
|
43922
|
-
case
|
|
43923
|
+
case 10:
|
|
43923
43924
|
// Since no filtering is being applied, we perform some cleanup. We
|
|
43924
43925
|
// stop the original video track here since it's not being used
|
|
43925
|
-
// anymore -- this also turns off the camera LED
|
|
43926
|
-
|
|
43927
|
-
|
|
43926
|
+
// anymore -- this also turns off the camera LED.
|
|
43927
|
+
// When keepOriginalTrack is true the caller is reusing this track, so
|
|
43928
|
+
// we must not stop it.
|
|
43929
|
+
if (!keepOriginalTrack && videoTrack) {
|
|
43930
|
+
videoTrack.stop();
|
|
43931
|
+
}
|
|
43932
|
+
case 11:
|
|
43928
43933
|
case "end":
|
|
43929
43934
|
return _context27.stop();
|
|
43930
43935
|
}
|
|
43931
|
-
}, _callee27, null, [[
|
|
43936
|
+
}, _callee27, null, [[2, 7]]);
|
|
43932
43937
|
}));
|
|
43933
|
-
return function destroyMediaProcessor() {
|
|
43938
|
+
return function destroyMediaProcessor(_x19) {
|
|
43934
43939
|
return _ref38.apply(this, arguments);
|
|
43935
43940
|
};
|
|
43936
43941
|
}();
|
|
@@ -43959,7 +43964,7 @@ function PublisherFactory(_ref) {
|
|
|
43959
43964
|
let currentVideoFilter;
|
|
43960
43965
|
let currentAudioFilter;
|
|
43961
43966
|
this._toggleVideo = (0, _blockCallsUntilComplete.default)( /*#__PURE__*/function () {
|
|
43962
|
-
var
|
|
43967
|
+
var _ref40 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28(shouldHaveVideo, videoDimensions) {
|
|
43963
43968
|
var _vidDevices$find;
|
|
43964
43969
|
var vidDevices, oldTrack, oldTrackDeviceId, newTrack, videoFilter, originalVideoTrack, _originalVideoTrack;
|
|
43965
43970
|
return _regenerator.default.wrap(function _callee28$(_context28) {
|
|
@@ -44120,12 +44125,12 @@ function PublisherFactory(_ref) {
|
|
|
44120
44125
|
}
|
|
44121
44126
|
}, _callee28, null, [[16, 20], [37, 43], [64, 70]]);
|
|
44122
44127
|
}));
|
|
44123
|
-
return function (
|
|
44124
|
-
return
|
|
44128
|
+
return function (_x20, _x21) {
|
|
44129
|
+
return _ref40.apply(this, arguments);
|
|
44125
44130
|
};
|
|
44126
44131
|
}());
|
|
44127
44132
|
const resetCongestionLevelEstimationOnPeerConnection = (0, _cancellation.callWithCancellation)( /*#__PURE__*/function () {
|
|
44128
|
-
var
|
|
44133
|
+
var _ref41 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29(isActive, cancellation) {
|
|
44129
44134
|
var peerConnections;
|
|
44130
44135
|
return _regenerator.default.wrap(function _callee29$(_context29) {
|
|
44131
44136
|
while (1) switch (_context29.prev = _context29.next) {
|
|
@@ -44149,8 +44154,8 @@ function PublisherFactory(_ref) {
|
|
|
44149
44154
|
}
|
|
44150
44155
|
}, _callee29);
|
|
44151
44156
|
}));
|
|
44152
|
-
return function (
|
|
44153
|
-
return
|
|
44157
|
+
return function (_x22, _x23) {
|
|
44158
|
+
return _ref41.apply(this, arguments);
|
|
44154
44159
|
};
|
|
44155
44160
|
}());
|
|
44156
44161
|
const resetAudioFallbackState = () => {
|
|
@@ -44160,7 +44165,7 @@ function PublisherFactory(_ref) {
|
|
|
44160
44165
|
(_chromeMixin2 = chromeMixin) == null ? void 0 : _chromeMixin2.videoDisabledIndicator.setWarning(false);
|
|
44161
44166
|
};
|
|
44162
44167
|
const onAudioFallbackActiveVideo = /*#__PURE__*/function () {
|
|
44163
|
-
var
|
|
44168
|
+
var _ref42 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30(previousState) {
|
|
44164
44169
|
var _chromeMixin3, _chromeMixin4;
|
|
44165
44170
|
return _regenerator.default.wrap(function _callee30$(_context30) {
|
|
44166
44171
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -44181,8 +44186,8 @@ function PublisherFactory(_ref) {
|
|
|
44181
44186
|
}
|
|
44182
44187
|
}, _callee30);
|
|
44183
44188
|
}));
|
|
44184
|
-
return function onAudioFallbackActiveVideo(
|
|
44185
|
-
return
|
|
44189
|
+
return function onAudioFallbackActiveVideo(_x24) {
|
|
44190
|
+
return _ref42.apply(this, arguments);
|
|
44186
44191
|
};
|
|
44187
44192
|
}();
|
|
44188
44193
|
const onAudioFallbackActiveVideoWithWarning = () => {
|
|
@@ -44193,7 +44198,7 @@ function PublisherFactory(_ref) {
|
|
|
44193
44198
|
this.trigger('videoDisableWarning');
|
|
44194
44199
|
};
|
|
44195
44200
|
const onAudioFallbackSuspendedVideo = /*#__PURE__*/function () {
|
|
44196
|
-
var
|
|
44201
|
+
var _ref43 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
|
|
44197
44202
|
var _chromeMixin6;
|
|
44198
44203
|
return _regenerator.default.wrap(function _callee31$(_context31) {
|
|
44199
44204
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -44211,7 +44216,7 @@ function PublisherFactory(_ref) {
|
|
|
44211
44216
|
}, _callee31);
|
|
44212
44217
|
}));
|
|
44213
44218
|
return function onAudioFallbackSuspendedVideo() {
|
|
44214
|
-
return
|
|
44219
|
+
return _ref43.apply(this, arguments);
|
|
44215
44220
|
};
|
|
44216
44221
|
}();
|
|
44217
44222
|
let audioFallbackCoordinator;
|
|
@@ -44224,9 +44229,9 @@ function PublisherFactory(_ref) {
|
|
|
44224
44229
|
[_audioFallbackVideoStates.default.ACTIVE_VIDEO_WITH_WARNING]: onAudioFallbackActiveVideoWithWarning,
|
|
44225
44230
|
[_audioFallbackVideoStates.default.SUSPENDED_VIDEO]: onAudioFallbackSuspendedVideo
|
|
44226
44231
|
};
|
|
44227
|
-
audioFallbackCoordinator.on('stateChange',
|
|
44228
|
-
let previousState =
|
|
44229
|
-
audioFallbackVideoState =
|
|
44232
|
+
audioFallbackCoordinator.on('stateChange', _ref44 => {
|
|
44233
|
+
let previousState = _ref44.previousState,
|
|
44234
|
+
audioFallbackVideoState = _ref44.state;
|
|
44230
44235
|
try {
|
|
44231
44236
|
audioFallbackStateHandlers[audioFallbackVideoState](previousState);
|
|
44232
44237
|
} catch (err) {
|
|
@@ -44344,7 +44349,7 @@ function PublisherFactory(_ref) {
|
|
|
44344
44349
|
});
|
|
44345
44350
|
});
|
|
44346
44351
|
this._publishVideo = /*#__PURE__*/function () {
|
|
44347
|
-
var
|
|
44352
|
+
var _ref45 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee32(value) {
|
|
44348
44353
|
var videoDimensions;
|
|
44349
44354
|
return _regenerator.default.wrap(function _callee32$(_context32) {
|
|
44350
44355
|
while (1) switch (_context32.prev = _context32.next) {
|
|
@@ -44369,8 +44374,8 @@ function PublisherFactory(_ref) {
|
|
|
44369
44374
|
}
|
|
44370
44375
|
}, _callee32);
|
|
44371
44376
|
}));
|
|
44372
|
-
return function (
|
|
44373
|
-
return
|
|
44377
|
+
return function (_x25) {
|
|
44378
|
+
return _ref45.apply(this, arguments);
|
|
44374
44379
|
};
|
|
44375
44380
|
}();
|
|
44376
44381
|
|
|
@@ -44755,7 +44760,7 @@ function PublisherFactory(_ref) {
|
|
|
44755
44760
|
{
|
|
44756
44761
|
let videoIndex = 0;
|
|
44757
44762
|
const cycleVideo = /*#__PURE__*/function () {
|
|
44758
|
-
var
|
|
44763
|
+
var _ref46 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee33() {
|
|
44759
44764
|
var oldTrack, vidDevices, hasOtherVideoDevices, newVideoDevice, deviceId;
|
|
44760
44765
|
return _regenerator.default.wrap(function _callee33$(_context33) {
|
|
44761
44766
|
while (1) switch (_context33.prev = _context33.next) {
|
|
@@ -44809,7 +44814,7 @@ function PublisherFactory(_ref) {
|
|
|
44809
44814
|
}, _callee33);
|
|
44810
44815
|
}));
|
|
44811
44816
|
return function cycleVideo() {
|
|
44812
|
-
return
|
|
44817
|
+
return _ref46.apply(this, arguments);
|
|
44813
44818
|
};
|
|
44814
44819
|
}();
|
|
44815
44820
|
|
|
@@ -44883,7 +44888,7 @@ function PublisherFactory(_ref) {
|
|
|
44883
44888
|
})));
|
|
44884
44889
|
}
|
|
44885
44890
|
const replaceTrackAndUpdate = /*#__PURE__*/function () {
|
|
44886
|
-
var
|
|
44891
|
+
var _ref48 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee36(oldTrack, newTrack) {
|
|
44887
44892
|
var pcs, video;
|
|
44888
44893
|
return _regenerator.default.wrap(function _callee36$(_context36) {
|
|
44889
44894
|
while (1) switch (_context36.prev = _context36.next) {
|
|
@@ -44894,7 +44899,7 @@ function PublisherFactory(_ref) {
|
|
|
44894
44899
|
pcs = _context36.sent;
|
|
44895
44900
|
_context36.next = 5;
|
|
44896
44901
|
return Promise.all(pcs.map( /*#__PURE__*/function () {
|
|
44897
|
-
var
|
|
44902
|
+
var _ref49 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee35(pc) {
|
|
44898
44903
|
return _regenerator.default.wrap(function _callee35$(_context35) {
|
|
44899
44904
|
while (1) switch (_context35.prev = _context35.next) {
|
|
44900
44905
|
case 0:
|
|
@@ -44908,8 +44913,8 @@ function PublisherFactory(_ref) {
|
|
|
44908
44913
|
}
|
|
44909
44914
|
}, _callee35);
|
|
44910
44915
|
}));
|
|
44911
|
-
return function (
|
|
44912
|
-
return
|
|
44916
|
+
return function (_x28) {
|
|
44917
|
+
return _ref49.apply(this, arguments);
|
|
44913
44918
|
};
|
|
44914
44919
|
}()));
|
|
44915
44920
|
case 5:
|
|
@@ -44945,12 +44950,12 @@ function PublisherFactory(_ref) {
|
|
|
44945
44950
|
}
|
|
44946
44951
|
}, _callee36);
|
|
44947
44952
|
}));
|
|
44948
|
-
return function replaceTrackAndUpdate(
|
|
44949
|
-
return
|
|
44953
|
+
return function replaceTrackAndUpdate(_x26, _x27) {
|
|
44954
|
+
return _ref48.apply(this, arguments);
|
|
44950
44955
|
};
|
|
44951
44956
|
}();
|
|
44952
44957
|
const getTrackFromDeviceId = /*#__PURE__*/function () {
|
|
44953
|
-
var
|
|
44958
|
+
var _ref50 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee37(deviceId) {
|
|
44954
44959
|
var _newVideoStream;
|
|
44955
44960
|
var oldTrackDeviceId, newOptions, _processedOptions2, getUserMediaHelper, newVideoStream, _newVideoStream$getVi, track;
|
|
44956
44961
|
return _regenerator.default.wrap(function _callee37$(_context37) {
|
|
@@ -44991,8 +44996,8 @@ function PublisherFactory(_ref) {
|
|
|
44991
44996
|
}
|
|
44992
44997
|
}, _callee37, null, [[8, 14]]);
|
|
44993
44998
|
}));
|
|
44994
|
-
return function getTrackFromDeviceId(
|
|
44995
|
-
return
|
|
44999
|
+
return function getTrackFromDeviceId(_x29) {
|
|
45000
|
+
return _ref50.apply(this, arguments);
|
|
44996
45001
|
};
|
|
44997
45002
|
}();
|
|
44998
45003
|
const getCurrentTrack = () => {
|
|
@@ -45009,7 +45014,7 @@ function PublisherFactory(_ref) {
|
|
|
45009
45014
|
_currentTrackDeviceId = deviceId;
|
|
45010
45015
|
};
|
|
45011
45016
|
const getVideoDevices = /*#__PURE__*/function () {
|
|
45012
|
-
var
|
|
45017
|
+
var _ref51 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee38() {
|
|
45013
45018
|
var devices, vidDevices;
|
|
45014
45019
|
return _regenerator.default.wrap(function _callee38$(_context38) {
|
|
45015
45020
|
while (1) switch (_context38.prev = _context38.next) {
|
|
@@ -45033,11 +45038,11 @@ function PublisherFactory(_ref) {
|
|
|
45033
45038
|
}, _callee38);
|
|
45034
45039
|
}));
|
|
45035
45040
|
return function getVideoDevices() {
|
|
45036
|
-
return
|
|
45041
|
+
return _ref51.apply(this, arguments);
|
|
45037
45042
|
};
|
|
45038
45043
|
}();
|
|
45039
45044
|
const replaceAudioTrackInPeerConnections = /*#__PURE__*/function () {
|
|
45040
|
-
var
|
|
45045
|
+
var _ref52 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee39(oldTrack, newTrack) {
|
|
45041
45046
|
var _this$session$session2;
|
|
45042
45047
|
var activePeerConnection, inactivePeerConnection, pcs;
|
|
45043
45048
|
return _regenerator.default.wrap(function _callee39$(_context39) {
|
|
@@ -45082,12 +45087,12 @@ function PublisherFactory(_ref) {
|
|
|
45082
45087
|
}
|
|
45083
45088
|
}, _callee39);
|
|
45084
45089
|
}));
|
|
45085
|
-
return function replaceAudioTrackInPeerConnections(
|
|
45086
|
-
return
|
|
45090
|
+
return function replaceAudioTrackInPeerConnections(_x30, _x31) {
|
|
45091
|
+
return _ref52.apply(this, arguments);
|
|
45087
45092
|
};
|
|
45088
45093
|
}();
|
|
45089
45094
|
const replaceAudioTrack = /*#__PURE__*/function () {
|
|
45090
|
-
var
|
|
45095
|
+
var _ref53 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee40(oldTrack, newTrack) {
|
|
45091
45096
|
var video, isFilteredTrack;
|
|
45092
45097
|
return _regenerator.default.wrap(function _callee40$(_context40) {
|
|
45093
45098
|
while (1) switch (_context40.prev = _context40.next) {
|
|
@@ -45144,12 +45149,12 @@ function PublisherFactory(_ref) {
|
|
|
45144
45149
|
}
|
|
45145
45150
|
}, _callee40);
|
|
45146
45151
|
}));
|
|
45147
|
-
return function replaceAudioTrack(
|
|
45148
|
-
return
|
|
45152
|
+
return function replaceAudioTrack(_x32, _x33) {
|
|
45153
|
+
return _ref53.apply(this, arguments);
|
|
45149
45154
|
};
|
|
45150
45155
|
}();
|
|
45151
45156
|
const resetAudioSource = /*#__PURE__*/function () {
|
|
45152
|
-
var
|
|
45157
|
+
var _ref54 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee41(audioTrack) {
|
|
45153
45158
|
var audioDeviceId, newAudioTrack;
|
|
45154
45159
|
return _regenerator.default.wrap(function _callee41$(_context41) {
|
|
45155
45160
|
while (1) switch (_context41.prev = _context41.next) {
|
|
@@ -45177,8 +45182,8 @@ function PublisherFactory(_ref) {
|
|
|
45177
45182
|
}
|
|
45178
45183
|
}, _callee41, null, [[1, 8]]);
|
|
45179
45184
|
}));
|
|
45180
|
-
return function resetAudioSource(
|
|
45181
|
-
return
|
|
45185
|
+
return function resetAudioSource(_x34) {
|
|
45186
|
+
return _ref54.apply(this, arguments);
|
|
45182
45187
|
};
|
|
45183
45188
|
}();
|
|
45184
45189
|
|
|
@@ -45192,7 +45197,7 @@ function PublisherFactory(_ref) {
|
|
|
45192
45197
|
}
|
|
45193
45198
|
// trigger the handler onVisibilityChange
|
|
45194
45199
|
const visibilityHandler = /*#__PURE__*/function () {
|
|
45195
|
-
var
|
|
45200
|
+
var _ref55 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee42() {
|
|
45196
45201
|
return _regenerator.default.wrap(function _callee42$(_context42) {
|
|
45197
45202
|
while (1) switch (_context42.prev = _context42.next) {
|
|
45198
45203
|
case 0:
|
|
@@ -45214,7 +45219,7 @@ function PublisherFactory(_ref) {
|
|
|
45214
45219
|
}, _callee42);
|
|
45215
45220
|
}));
|
|
45216
45221
|
return function visibilityHandler() {
|
|
45217
|
-
return
|
|
45222
|
+
return _ref55.apply(this, arguments);
|
|
45218
45223
|
};
|
|
45219
45224
|
}();
|
|
45220
45225
|
document.addEventListener('visibilitychange', visibilityHandler);
|
|
@@ -45295,7 +45300,7 @@ function PublisherFactory(_ref) {
|
|
|
45295
45300
|
};
|
|
45296
45301
|
const isMediaStreamTrack = track => track instanceof MediaStreamTrack || track && typeof track === 'object' && Object.getPrototypeOf(track).toString().includes('MediaStreamTrack');
|
|
45297
45302
|
const setAudioSource = /*#__PURE__*/function () {
|
|
45298
|
-
var
|
|
45303
|
+
var _ref56 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee44(audioSource) {
|
|
45299
45304
|
var currentCancelSentinel, setStreamIfNotCancelled, prevAudioSource, newTrack, newOptions, prevLabel, prevDeviceId, _processedOptions3, getUserMediaHelper, prevOptions, previousDevice, stream;
|
|
45300
45305
|
return _regenerator.default.wrap(function _callee44$(_context44) {
|
|
45301
45306
|
while (1) switch (_context44.prev = _context44.next) {
|
|
@@ -45308,7 +45313,7 @@ function PublisherFactory(_ref) {
|
|
|
45308
45313
|
case 2:
|
|
45309
45314
|
currentCancelSentinel = getSetAudioSourceCancellationSentinel();
|
|
45310
45315
|
setStreamIfNotCancelled = /*#__PURE__*/function () {
|
|
45311
|
-
var
|
|
45316
|
+
var _ref57 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee43(stream) {
|
|
45312
45317
|
return _regenerator.default.wrap(function _callee43$(_context43) {
|
|
45313
45318
|
while (1) switch (_context43.prev = _context43.next) {
|
|
45314
45319
|
case 0:
|
|
@@ -45326,8 +45331,8 @@ function PublisherFactory(_ref) {
|
|
|
45326
45331
|
}
|
|
45327
45332
|
}, _callee43);
|
|
45328
45333
|
}));
|
|
45329
|
-
return function setStreamIfNotCancelled(
|
|
45330
|
-
return
|
|
45334
|
+
return function setStreamIfNotCancelled(_x36) {
|
|
45335
|
+
return _ref57.apply(this, arguments);
|
|
45331
45336
|
};
|
|
45332
45337
|
}();
|
|
45333
45338
|
prevAudioSource = _this._getAudioSource();
|
|
@@ -45462,8 +45467,8 @@ function PublisherFactory(_ref) {
|
|
|
45462
45467
|
}
|
|
45463
45468
|
}, _callee44, null, [[11, 20], [37, 47]]);
|
|
45464
45469
|
}));
|
|
45465
|
-
return function setAudioSource(
|
|
45466
|
-
return
|
|
45470
|
+
return function setAudioSource(_x35) {
|
|
45471
|
+
return _ref56.apply(this, arguments);
|
|
45467
45472
|
};
|
|
45468
45473
|
}();
|
|
45469
45474
|
this.setAudioSource = setAudioSource;
|
|
@@ -45572,14 +45577,14 @@ function PublisherFactory(_ref) {
|
|
|
45572
45577
|
}
|
|
45573
45578
|
}, _callee45);
|
|
45574
45579
|
}));
|
|
45575
|
-
function setVideoSource(
|
|
45580
|
+
function setVideoSource(_x37) {
|
|
45576
45581
|
return _setVideoSource.apply(this, arguments);
|
|
45577
45582
|
}
|
|
45578
45583
|
return setVideoSource;
|
|
45579
45584
|
}();
|
|
45580
45585
|
this.setVideoSource = setVideoSource;
|
|
45581
45586
|
const attemptToSetVideoTrack = /*#__PURE__*/function () {
|
|
45582
|
-
var
|
|
45587
|
+
var _ref58 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee46(newVideoDeviceId, action) {
|
|
45583
45588
|
var _originalVideoTrack2;
|
|
45584
45589
|
var oldDeviceID, oldTrack, supportedBrowsers, videoFilterToReapplyOnAndroid, newVideoTrack, originalVideoTrack;
|
|
45585
45590
|
return _regenerator.default.wrap(function _callee46$(_context46) {
|
|
@@ -45699,8 +45704,8 @@ function PublisherFactory(_ref) {
|
|
|
45699
45704
|
}
|
|
45700
45705
|
}, _callee46, null, [[16, 22]]);
|
|
45701
45706
|
}));
|
|
45702
|
-
return function attemptToSetVideoTrack(
|
|
45703
|
-
return
|
|
45707
|
+
return function attemptToSetVideoTrack(_x38, _x39) {
|
|
45708
|
+
return _ref58.apply(this, arguments);
|
|
45704
45709
|
};
|
|
45705
45710
|
}();
|
|
45706
45711
|
|
|
@@ -45800,8 +45805,8 @@ function PublisherFactory(_ref) {
|
|
|
45800
45805
|
return;
|
|
45801
45806
|
}
|
|
45802
45807
|
this.once('initSuccess', resolve);
|
|
45803
|
-
this.once('destroyed',
|
|
45804
|
-
let reason =
|
|
45808
|
+
this.once('destroyed', _ref59 => {
|
|
45809
|
+
let reason = _ref59.reason;
|
|
45805
45810
|
let reasonDescription = '';
|
|
45806
45811
|
if (reason) {
|
|
45807
45812
|
reasonDescription = ` Reason: ${reason}`;
|
|
@@ -45972,7 +45977,7 @@ function PublisherFactory(_ref) {
|
|
|
45972
45977
|
throw err;
|
|
45973
45978
|
});
|
|
45974
45979
|
return Promise.all([streamCreatedPromise, completedPromise]).catch( /*#__PURE__*/function () {
|
|
45975
|
-
var
|
|
45980
|
+
var _ref60 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee48(err) {
|
|
45976
45981
|
return _regenerator.default.wrap(function _callee48$(_context48) {
|
|
45977
45982
|
while (1) switch (_context48.prev = _context48.next) {
|
|
45978
45983
|
case 0:
|
|
@@ -45988,8 +45993,8 @@ function PublisherFactory(_ref) {
|
|
|
45988
45993
|
}
|
|
45989
45994
|
}, _callee48);
|
|
45990
45995
|
}));
|
|
45991
|
-
return function (
|
|
45992
|
-
return
|
|
45996
|
+
return function (_x40) {
|
|
45997
|
+
return _ref60.apply(this, arguments);
|
|
45993
45998
|
};
|
|
45994
45999
|
}());
|
|
45995
46000
|
},
|
|
@@ -46093,7 +46098,7 @@ function PublisherFactory(_ref) {
|
|
|
46093
46098
|
var _this$session24, _this$session24$sessi;
|
|
46094
46099
|
clearTimeout(_migrationTimeoutId);
|
|
46095
46100
|
const destroyPeerConnection = /*#__PURE__*/function () {
|
|
46096
|
-
var
|
|
46101
|
+
var _ref61 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee50(pc) {
|
|
46097
46102
|
var _getPeerConnectionMet8, peerConnectionId;
|
|
46098
46103
|
return _regenerator.default.wrap(function _callee50$(_context50) {
|
|
46099
46104
|
while (1) switch (_context50.prev = _context50.next) {
|
|
@@ -46115,8 +46120,8 @@ function PublisherFactory(_ref) {
|
|
|
46115
46120
|
}
|
|
46116
46121
|
}, _callee50);
|
|
46117
46122
|
}));
|
|
46118
|
-
return function destroyPeerConnection(
|
|
46119
|
-
return
|
|
46123
|
+
return function destroyPeerConnection(_x41) {
|
|
46124
|
+
return _ref61.apply(this, arguments);
|
|
46120
46125
|
};
|
|
46121
46126
|
}();
|
|
46122
46127
|
|
|
@@ -46325,7 +46330,7 @@ function PublisherFactory(_ref) {
|
|
|
46325
46330
|
}
|
|
46326
46331
|
}, _callee53);
|
|
46327
46332
|
}));
|
|
46328
|
-
function setCongestionLevel(
|
|
46333
|
+
function setCongestionLevel(_x42, _x43) {
|
|
46329
46334
|
return _setCongestionLevel.apply(this, arguments);
|
|
46330
46335
|
}
|
|
46331
46336
|
return setCongestionLevel;
|
|
@@ -46725,7 +46730,7 @@ function PublisherFactory(_ref) {
|
|
|
46725
46730
|
* If there is an error, the promise is rejected and no new video filter is set.
|
|
46726
46731
|
*/
|
|
46727
46732
|
this.applyVideoFilter = /*#__PURE__*/function () {
|
|
46728
|
-
var
|
|
46733
|
+
var _ref62 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee54(videoFilter, avoidOriginalTrackLeak) {
|
|
46729
46734
|
var sanitizedVideoFilter, isSupported, message, _webRTCStream$getVide2, originalVideoTrack, filteredVideoTrack;
|
|
46730
46735
|
return _regenerator.default.wrap(function _callee54$(_context54) {
|
|
46731
46736
|
while (1) switch (_context54.prev = _context54.next) {
|
|
@@ -46858,8 +46863,8 @@ function PublisherFactory(_ref) {
|
|
|
46858
46863
|
}
|
|
46859
46864
|
}, _callee54, null, [[3, 55], [25, 33]]);
|
|
46860
46865
|
}));
|
|
46861
|
-
return function (
|
|
46862
|
-
return
|
|
46866
|
+
return function (_x44, _x45) {
|
|
46867
|
+
return _ref62.apply(this, arguments);
|
|
46863
46868
|
};
|
|
46864
46869
|
}();
|
|
46865
46870
|
|
|
@@ -46966,7 +46971,7 @@ function PublisherFactory(_ref) {
|
|
|
46966
46971
|
* If there is an error, the promise is rejected and no new video filter is set.
|
|
46967
46972
|
*/
|
|
46968
46973
|
this.applyAudioFilter = /*#__PURE__*/function () {
|
|
46969
|
-
var
|
|
46974
|
+
var _ref63 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee55(audioFilter) {
|
|
46970
46975
|
var isSupported, message, _getNoiseSuppressionC, assetsDirBaseUrl, vonageNoiseSuppression, noiseSuppressionConnector;
|
|
46971
46976
|
return _regenerator.default.wrap(function _callee55$(_context55) {
|
|
46972
46977
|
while (1) switch (_context55.prev = _context55.next) {
|
|
@@ -47062,8 +47067,8 @@ function PublisherFactory(_ref) {
|
|
|
47062
47067
|
}
|
|
47063
47068
|
}, _callee55, null, [[20, 34]]);
|
|
47064
47069
|
}));
|
|
47065
|
-
return function (
|
|
47066
|
-
return
|
|
47070
|
+
return function (_x46) {
|
|
47071
|
+
return _ref63.apply(this, arguments);
|
|
47067
47072
|
};
|
|
47068
47073
|
}();
|
|
47069
47074
|
|
|
@@ -47246,7 +47251,7 @@ function PublisherFactory(_ref) {
|
|
|
47246
47251
|
* If there is an error, the promise is rejected and no connector is set.
|
|
47247
47252
|
*/
|
|
47248
47253
|
this.setVideoMediaProcessorConnector = /*#__PURE__*/function () {
|
|
47249
|
-
var
|
|
47254
|
+
var _ref65 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee57(mediaProcessorConnector) {
|
|
47250
47255
|
var _webRTCStream$getVide3, filteredVideoTrack, videoTrack, _webRTCStream$getVide4, originalVideoTrack, message;
|
|
47251
47256
|
return _regenerator.default.wrap(function _callee57$(_context57) {
|
|
47252
47257
|
while (1) switch (_context57.prev = _context57.next) {
|
|
@@ -47340,8 +47345,8 @@ function PublisherFactory(_ref) {
|
|
|
47340
47345
|
}
|
|
47341
47346
|
}, _callee57, null, [[29, 38]]);
|
|
47342
47347
|
}));
|
|
47343
|
-
return function (
|
|
47344
|
-
return
|
|
47348
|
+
return function (_x47) {
|
|
47349
|
+
return _ref65.apply(this, arguments);
|
|
47345
47350
|
};
|
|
47346
47351
|
}();
|
|
47347
47352
|
|
|
@@ -47405,7 +47410,7 @@ function PublisherFactory(_ref) {
|
|
|
47405
47410
|
* If there is an error, the promise is rejected and no connector is set.
|
|
47406
47411
|
*/
|
|
47407
47412
|
this.setAudioMediaProcessorConnector = /*#__PURE__*/function () {
|
|
47408
|
-
var
|
|
47413
|
+
var _ref66 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee58(mediaProcessorConnector) {
|
|
47409
47414
|
return _regenerator.default.wrap(function _callee58$(_context58) {
|
|
47410
47415
|
while (1) switch (_context58.prev = _context58.next) {
|
|
47411
47416
|
case 0:
|
|
@@ -47434,12 +47439,12 @@ function PublisherFactory(_ref) {
|
|
|
47434
47439
|
}
|
|
47435
47440
|
}, _callee58, null, [[1, 7]]);
|
|
47436
47441
|
}));
|
|
47437
|
-
return function (
|
|
47438
|
-
return
|
|
47442
|
+
return function (_x48) {
|
|
47443
|
+
return _ref66.apply(this, arguments);
|
|
47439
47444
|
};
|
|
47440
47445
|
}();
|
|
47441
47446
|
const _setAudioMediaProcessorConnector = /*#__PURE__*/function () {
|
|
47442
|
-
var
|
|
47447
|
+
var _ref67 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee59(mediaProcessorConnector) {
|
|
47443
47448
|
var message, _webRTCStream$getAudi, filteredAudioTrack, _webRTCStream$getAudi2, originalAudioTrack;
|
|
47444
47449
|
return _regenerator.default.wrap(function _callee59$(_context59) {
|
|
47445
47450
|
while (1) switch (_context59.prev = _context59.next) {
|
|
@@ -47508,8 +47513,8 @@ function PublisherFactory(_ref) {
|
|
|
47508
47513
|
}
|
|
47509
47514
|
}, _callee59, null, [[21, 29]]);
|
|
47510
47515
|
}));
|
|
47511
|
-
return function _setAudioMediaProcessorConnector(
|
|
47512
|
-
return
|
|
47516
|
+
return function _setAudioMediaProcessorConnector(_x49) {
|
|
47517
|
+
return _ref67.apply(this, arguments);
|
|
47513
47518
|
};
|
|
47514
47519
|
}();
|
|
47515
47520
|
|
|
@@ -47531,7 +47536,7 @@ function PublisherFactory(_ref) {
|
|
|
47531
47536
|
* If there is an error, the promise is rejected.
|
|
47532
47537
|
*/
|
|
47533
47538
|
this.clearVideoFilter = /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee60() {
|
|
47534
|
-
var message, oldVideoFilter, _webRTCStream$getVide5, filteredVideoTrack, videoTrack;
|
|
47539
|
+
var message, oldVideoFilter, _webRTCStream$getVide5, filteredVideoTrack, originalVideoTrack, videoTrack, _properties$videoDime3, _properties$videoDime4;
|
|
47535
47540
|
return _regenerator.default.wrap(function _callee60$(_context60) {
|
|
47536
47541
|
while (1) switch (_context60.prev = _context60.next) {
|
|
47537
47542
|
case 0:
|
|
@@ -47579,53 +47584,79 @@ function PublisherFactory(_ref) {
|
|
|
47579
47584
|
case 20:
|
|
47580
47585
|
oldVideoFilter = currentVideoFilter;
|
|
47581
47586
|
currentVideoFilter = null;
|
|
47582
|
-
_webRTCStream$getVide5 = webRTCStream.getVideoTracks(), filteredVideoTrack = _webRTCStream$getVide5[0];
|
|
47583
|
-
|
|
47584
|
-
|
|
47587
|
+
_webRTCStream$getVide5 = webRTCStream.getVideoTracks(), filteredVideoTrack = _webRTCStream$getVide5[0]; // Prefer the original pre-filter track from the MediaProcessor. It is already at
|
|
47588
|
+
// the correct resolution — including any setPreferredResolution constraints applied
|
|
47589
|
+
// before the filter was set — so reusing it avoids the visual zoom that would occur
|
|
47590
|
+
// if the camera were reacquired at its initial/default resolution.
|
|
47591
|
+
originalVideoTrack = typeof (mediaProcessor == null ? void 0 : mediaProcessor.getOriginalVideoTrack) === 'function' ? mediaProcessor.getOriginalVideoTrack() : null;
|
|
47592
|
+
videoTrack = originalVideoTrack;
|
|
47593
|
+
if (videoTrack) {
|
|
47594
|
+
_context60.next = 44;
|
|
47595
|
+
break;
|
|
47596
|
+
}
|
|
47597
|
+
_context60.prev = 26;
|
|
47598
|
+
_context60.next = 29;
|
|
47585
47599
|
return getTrackFromDeviceId(currentDeviceId);
|
|
47586
|
-
case
|
|
47600
|
+
case 29:
|
|
47587
47601
|
videoTrack = _context60.sent;
|
|
47588
|
-
_context60.next =
|
|
47602
|
+
_context60.next = 36;
|
|
47589
47603
|
break;
|
|
47590
|
-
case
|
|
47591
|
-
_context60.prev =
|
|
47592
|
-
_context60.t0 = _context60["catch"](
|
|
47604
|
+
case 32:
|
|
47605
|
+
_context60.prev = 32;
|
|
47606
|
+
_context60.t0 = _context60["catch"](26);
|
|
47593
47607
|
logging.error(_context60.t0);
|
|
47594
47608
|
return _context60.abrupt("return");
|
|
47595
|
-
case
|
|
47609
|
+
case 36:
|
|
47610
|
+
_context60.prev = 36;
|
|
47611
|
+
_context60.next = 39;
|
|
47612
|
+
return applyVideoConstraintsTo(videoTrack, {
|
|
47613
|
+
width: (_properties$videoDime3 = properties.videoDimensions) == null ? void 0 : _properties$videoDime3.width,
|
|
47614
|
+
height: (_properties$videoDime4 = properties.videoDimensions) == null ? void 0 : _properties$videoDime4.height,
|
|
47615
|
+
frameRate: properties.frameRate
|
|
47616
|
+
});
|
|
47617
|
+
case 39:
|
|
47618
|
+
_context60.next = 44;
|
|
47619
|
+
break;
|
|
47620
|
+
case 41:
|
|
47621
|
+
_context60.prev = 41;
|
|
47622
|
+
_context60.t1 = _context60["catch"](36);
|
|
47623
|
+
logging.warn(`clearVideoFilter: could not pre-apply constraints to restored track: ${_context60.t1}`);
|
|
47624
|
+
case 44:
|
|
47596
47625
|
if (videoTrack) {
|
|
47597
|
-
_context60.next =
|
|
47626
|
+
_context60.next = 47;
|
|
47598
47627
|
break;
|
|
47599
47628
|
}
|
|
47600
47629
|
logging.warn('Failed to clear filter because there is no video track.');
|
|
47601
47630
|
return _context60.abrupt("return");
|
|
47602
|
-
case
|
|
47631
|
+
case 47:
|
|
47603
47632
|
filteredVideoTrackId = null;
|
|
47604
|
-
_context60.prev =
|
|
47605
|
-
_context60.next =
|
|
47633
|
+
_context60.prev = 48;
|
|
47634
|
+
_context60.next = 51;
|
|
47606
47635
|
return replaceTrackAndUpdate(filteredVideoTrack, videoTrack);
|
|
47607
|
-
case
|
|
47608
|
-
_context60.next =
|
|
47609
|
-
return destroyMediaProcessor(
|
|
47610
|
-
|
|
47611
|
-
|
|
47636
|
+
case 51:
|
|
47637
|
+
_context60.next = 53;
|
|
47638
|
+
return destroyMediaProcessor({
|
|
47639
|
+
keepOriginalTrack: !!originalVideoTrack
|
|
47640
|
+
});
|
|
47641
|
+
case 53:
|
|
47642
|
+
_context60.next = 58;
|
|
47612
47643
|
break;
|
|
47613
|
-
case
|
|
47614
|
-
_context60.prev =
|
|
47615
|
-
_context60.
|
|
47644
|
+
case 55:
|
|
47645
|
+
_context60.prev = 55;
|
|
47646
|
+
_context60.t2 = _context60["catch"](48);
|
|
47616
47647
|
// Restore the previous filter since this call has failed. This way, this function can be
|
|
47617
47648
|
// called again if needed.
|
|
47618
47649
|
currentVideoFilter = oldVideoFilter;
|
|
47619
|
-
case
|
|
47650
|
+
case 58:
|
|
47620
47651
|
logAnalyticsEvent('clearVideoFilter', 'Success');
|
|
47621
|
-
case
|
|
47652
|
+
case 59:
|
|
47622
47653
|
case "end":
|
|
47623
47654
|
return _context60.stop();
|
|
47624
47655
|
}
|
|
47625
|
-
}, _callee60, null, [[
|
|
47656
|
+
}, _callee60, null, [[26, 32], [36, 41], [48, 55]]);
|
|
47626
47657
|
}));
|
|
47627
47658
|
const applySetMaxBitrateToPeerConnection = /*#__PURE__*/function () {
|
|
47628
|
-
var
|
|
47659
|
+
var _ref69 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee61(peerConnection) {
|
|
47629
47660
|
var maxBitrateHasChanged, isPreset;
|
|
47630
47661
|
return _regenerator.default.wrap(function _callee61$(_context61) {
|
|
47631
47662
|
while (1) switch (_context61.prev = _context61.next) {
|
|
@@ -47658,8 +47689,8 @@ function PublisherFactory(_ref) {
|
|
|
47658
47689
|
}
|
|
47659
47690
|
}, _callee61);
|
|
47660
47691
|
}));
|
|
47661
|
-
return function applySetMaxBitrateToPeerConnection(
|
|
47662
|
-
return
|
|
47692
|
+
return function applySetMaxBitrateToPeerConnection(_x50) {
|
|
47693
|
+
return _ref69.apply(this, arguments);
|
|
47663
47694
|
};
|
|
47664
47695
|
}();
|
|
47665
47696
|
|
|
@@ -47687,7 +47718,7 @@ function PublisherFactory(_ref) {
|
|
|
47687
47718
|
*/
|
|
47688
47719
|
this.getVideoBitratePreset = () => properties.videoBitratePreset;
|
|
47689
47720
|
const setMaxVideoBitrateToPublisher = /*#__PURE__*/function () {
|
|
47690
|
-
var
|
|
47721
|
+
var _ref70 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee63(peerConnection) {
|
|
47691
47722
|
var logOptions, applyMaxBitrate, peerConnections;
|
|
47692
47723
|
return _regenerator.default.wrap(function _callee63$(_context63) {
|
|
47693
47724
|
while (1) switch (_context63.prev = _context63.next) {
|
|
@@ -47712,7 +47743,7 @@ function PublisherFactory(_ref) {
|
|
|
47712
47743
|
logOptions.NearestResolution = (0, _getSpatialResolution.default)(_this.videoWidth(), _this.videoHeight());
|
|
47713
47744
|
logAnalyticsEvent('SetMaxVideoBitrateOnRtpSender', 'Attempt', {}, logOptions);
|
|
47714
47745
|
applyMaxBitrate = /*#__PURE__*/function () {
|
|
47715
|
-
var
|
|
47746
|
+
var _ref71 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee62(pc) {
|
|
47716
47747
|
return _regenerator.default.wrap(function _callee62$(_context62) {
|
|
47717
47748
|
while (1) switch (_context62.prev = _context62.next) {
|
|
47718
47749
|
case 0:
|
|
@@ -47735,8 +47766,8 @@ function PublisherFactory(_ref) {
|
|
|
47735
47766
|
}
|
|
47736
47767
|
}, _callee62, null, [[0, 6]]);
|
|
47737
47768
|
}));
|
|
47738
|
-
return function applyMaxBitrate(
|
|
47739
|
-
return
|
|
47769
|
+
return function applyMaxBitrate(_x52) {
|
|
47770
|
+
return _ref71.apply(this, arguments);
|
|
47740
47771
|
};
|
|
47741
47772
|
}();
|
|
47742
47773
|
if (!peerConnection) {
|
|
@@ -47761,23 +47792,29 @@ function PublisherFactory(_ref) {
|
|
|
47761
47792
|
}
|
|
47762
47793
|
}, _callee63);
|
|
47763
47794
|
}));
|
|
47764
|
-
return function setMaxVideoBitrateToPublisher(
|
|
47765
|
-
return
|
|
47795
|
+
return function setMaxVideoBitrateToPublisher(_x51) {
|
|
47796
|
+
return _ref70.apply(this, arguments);
|
|
47766
47797
|
};
|
|
47767
47798
|
}();
|
|
47768
|
-
const applyVideoConstraintsTo = track
|
|
47769
|
-
if (
|
|
47799
|
+
const applyVideoConstraintsTo = function applyVideoConstraintsTo(track, fallbackVideoTrackSettings) {
|
|
47800
|
+
if (fallbackVideoTrackSettings === void 0) {
|
|
47801
|
+
fallbackVideoTrackSettings = {};
|
|
47802
|
+
}
|
|
47803
|
+
const width = _preferredWidth || fallbackVideoTrackSettings.width;
|
|
47804
|
+
const height = _preferredHeight || fallbackVideoTrackSettings.height;
|
|
47805
|
+
const frameRate = _preferredFrameRate || fallbackVideoTrackSettings.frameRate;
|
|
47806
|
+
if (!width && !height && !frameRate) {
|
|
47770
47807
|
return Promise.resolve();
|
|
47771
47808
|
}
|
|
47772
47809
|
const constraints = {
|
|
47773
47810
|
width: {
|
|
47774
|
-
ideal:
|
|
47811
|
+
ideal: width
|
|
47775
47812
|
},
|
|
47776
47813
|
height: {
|
|
47777
|
-
ideal:
|
|
47814
|
+
ideal: height
|
|
47778
47815
|
},
|
|
47779
47816
|
frameRate: {
|
|
47780
|
-
ideal:
|
|
47817
|
+
ideal: frameRate
|
|
47781
47818
|
}
|
|
47782
47819
|
};
|
|
47783
47820
|
return (0, _videoConstraints.default)(track, constraints);
|
|
@@ -47803,7 +47840,7 @@ function PublisherFactory(_ref) {
|
|
|
47803
47840
|
}()) || track.id !== filteredVideoTrackId);
|
|
47804
47841
|
});
|
|
47805
47842
|
if (!videoTracks || videoTracks.length === 0) return Promise.resolve();
|
|
47806
|
-
return Promise.all(videoTracks.map(applyVideoConstraintsTo));
|
|
47843
|
+
return Promise.all(videoTracks.map(track => applyVideoConstraintsTo(track)));
|
|
47807
47844
|
};
|
|
47808
47845
|
|
|
47809
47846
|
/**
|
|
@@ -47826,8 +47863,8 @@ function PublisherFactory(_ref) {
|
|
|
47826
47863
|
* @memberOf Publisher
|
|
47827
47864
|
*/
|
|
47828
47865
|
this.setPreferredResolution = /*#__PURE__*/function () {
|
|
47829
|
-
var
|
|
47830
|
-
var _webRTCStream3, _webRTCStream3$getVid, _properties$
|
|
47866
|
+
var _ref72 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee64(preferredResolution) {
|
|
47867
|
+
var _webRTCStream3, _webRTCStream3$getVid, _properties$videoDime5, _properties$videoDime6;
|
|
47831
47868
|
var message, startingWidth, startingHeight, startingArea, preferredArea, result, _getPreferredVideoTra2, width, height;
|
|
47832
47869
|
return _regenerator.default.wrap(function _callee64$(_context64) {
|
|
47833
47870
|
while (1) switch (_context64.prev = _context64.next) {
|
|
@@ -47857,8 +47894,8 @@ function PublisherFactory(_ref) {
|
|
|
47857
47894
|
});
|
|
47858
47895
|
throw new Error(message);
|
|
47859
47896
|
case 9:
|
|
47860
|
-
startingWidth = ((_properties$
|
|
47861
|
-
startingHeight = ((_properties$
|
|
47897
|
+
startingWidth = ((_properties$videoDime5 = properties.videoDimensions) == null ? void 0 : _properties$videoDime5.width) || publisherDefaultResolution.width;
|
|
47898
|
+
startingHeight = ((_properties$videoDime6 = properties.videoDimensions) == null ? void 0 : _properties$videoDime6.height) || publisherDefaultResolution.height;
|
|
47862
47899
|
startingArea = startingWidth * startingHeight;
|
|
47863
47900
|
preferredArea = preferredResolution.width * preferredResolution.height;
|
|
47864
47901
|
if (!(preferredArea > startingArea)) {
|
|
@@ -47915,8 +47952,8 @@ function PublisherFactory(_ref) {
|
|
|
47915
47952
|
}
|
|
47916
47953
|
}, _callee64, null, [[20, 33], [21,, 28, 31]]);
|
|
47917
47954
|
}));
|
|
47918
|
-
return function (
|
|
47919
|
-
return
|
|
47955
|
+
return function (_x53) {
|
|
47956
|
+
return _ref72.apply(this, arguments);
|
|
47920
47957
|
};
|
|
47921
47958
|
}();
|
|
47922
47959
|
|
|
@@ -47937,7 +47974,7 @@ function PublisherFactory(_ref) {
|
|
|
47937
47974
|
* @memberOf Publisher
|
|
47938
47975
|
*/
|
|
47939
47976
|
this.setPreferredFrameRate = /*#__PURE__*/function () {
|
|
47940
|
-
var
|
|
47977
|
+
var _ref73 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee65(frameRate) {
|
|
47941
47978
|
var _webRTCStream4, _webRTCStream4$getVid;
|
|
47942
47979
|
var message, result, _getPreferredVideoTra3, actualFrameRate;
|
|
47943
47980
|
return _regenerator.default.wrap(function _callee65$(_context65) {
|
|
@@ -47998,8 +48035,8 @@ function PublisherFactory(_ref) {
|
|
|
47998
48035
|
}
|
|
47999
48036
|
}, _callee65, null, [[10, 19]]);
|
|
48000
48037
|
}));
|
|
48001
|
-
return function (
|
|
48002
|
-
return
|
|
48038
|
+
return function (_x54) {
|
|
48039
|
+
return _ref73.apply(this, arguments);
|
|
48003
48040
|
};
|
|
48004
48041
|
}();
|
|
48005
48042
|
|
|
@@ -48023,7 +48060,7 @@ function PublisherFactory(_ref) {
|
|
|
48023
48060
|
* @memberOf Publisher
|
|
48024
48061
|
*/
|
|
48025
48062
|
this.setMaxVideoBitrate = /*#__PURE__*/function () {
|
|
48026
|
-
var
|
|
48063
|
+
var _ref74 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee66(bitrateBps) {
|
|
48027
48064
|
var bitrate;
|
|
48028
48065
|
return _regenerator.default.wrap(function _callee66$(_context66) {
|
|
48029
48066
|
while (1) switch (_context66.prev = _context66.next) {
|
|
@@ -48059,8 +48096,8 @@ function PublisherFactory(_ref) {
|
|
|
48059
48096
|
}
|
|
48060
48097
|
}, _callee66);
|
|
48061
48098
|
}));
|
|
48062
|
-
return function (
|
|
48063
|
-
return
|
|
48099
|
+
return function (_x55) {
|
|
48100
|
+
return _ref74.apply(this, arguments);
|
|
48064
48101
|
};
|
|
48065
48102
|
}();
|
|
48066
48103
|
|
|
@@ -48082,7 +48119,7 @@ function PublisherFactory(_ref) {
|
|
|
48082
48119
|
* @memberOf Publisher
|
|
48083
48120
|
*/
|
|
48084
48121
|
this.setVideoBitratePreset = /*#__PURE__*/function () {
|
|
48085
|
-
var
|
|
48122
|
+
var _ref75 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee67(preset) {
|
|
48086
48123
|
var filteredPreset;
|
|
48087
48124
|
return _regenerator.default.wrap(function _callee67$(_context67) {
|
|
48088
48125
|
while (1) switch (_context67.prev = _context67.next) {
|
|
@@ -48118,8 +48155,8 @@ function PublisherFactory(_ref) {
|
|
|
48118
48155
|
}
|
|
48119
48156
|
}, _callee67);
|
|
48120
48157
|
}));
|
|
48121
|
-
return function (
|
|
48122
|
-
return
|
|
48158
|
+
return function (_x56) {
|
|
48159
|
+
return _ref75.apply(this, arguments);
|
|
48123
48160
|
};
|
|
48124
48161
|
}();
|
|
48125
48162
|
|