@webex/plugin-meetings 2.4.2 → 2.7.0
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/meeting/index.js +166 -0
- package/dist/meeting/index.js.map +1 -1
- package/dist/metrics/constants.js +5 -1
- package/dist/metrics/constants.js.map +1 -1
- package/package.json +7 -6
- package/src/meeting/index.js +95 -0
- package/src/metrics/constants.js +5 -1
- package/test/unit/spec/meeting/index.js +198 -1
package/dist/meeting/index.js
CHANGED
|
@@ -64,6 +64,8 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
64
64
|
|
|
65
65
|
var _webexCore = require("@webex/webex-core");
|
|
66
66
|
|
|
67
|
+
var _internalMediaCore = require("@webex/internal-media-core");
|
|
68
|
+
|
|
67
69
|
var _webexErrors = require("../common/errors/webex-errors");
|
|
68
70
|
|
|
69
71
|
var _statsAnalyzer = _interopRequireDefault(require("../statsAnalyzer"));
|
|
@@ -6155,6 +6157,170 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6155
6157
|
* @memberof Meeting
|
|
6156
6158
|
*/
|
|
6157
6159
|
|
|
6160
|
+
}, {
|
|
6161
|
+
key: "enableBNR",
|
|
6162
|
+
value:
|
|
6163
|
+
/**
|
|
6164
|
+
* enableBNR API
|
|
6165
|
+
* @returns {Promise<Boolean>}
|
|
6166
|
+
* @public
|
|
6167
|
+
* @memberof Meeting
|
|
6168
|
+
*/
|
|
6169
|
+
function () {
|
|
6170
|
+
var _enableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
6171
|
+
var isSuccess, audioStream;
|
|
6172
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
6173
|
+
while (1) {
|
|
6174
|
+
switch (_context4.prev = _context4.next) {
|
|
6175
|
+
case 0:
|
|
6176
|
+
_loggerProxy.default.logger.info('Meeting:index#enableBNR. Enable BNR called');
|
|
6177
|
+
|
|
6178
|
+
isSuccess = false;
|
|
6179
|
+
_context4.prev = 2;
|
|
6180
|
+
|
|
6181
|
+
if (!(typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined')) {
|
|
6182
|
+
_context4.next = 5;
|
|
6183
|
+
break;
|
|
6184
|
+
}
|
|
6185
|
+
|
|
6186
|
+
throw new Error("Meeting doesn't have an audioTrack attached");
|
|
6187
|
+
|
|
6188
|
+
case 5:
|
|
6189
|
+
_context4.next = 7;
|
|
6190
|
+
return _internalMediaCore.Media.Effects.BNR.enableBNR(this.mediaProperties.audioTrack);
|
|
6191
|
+
|
|
6192
|
+
case 7:
|
|
6193
|
+
this.mediaProperties.audioTrack = _context4.sent;
|
|
6194
|
+
audioStream = _util2.default.createMediaStream([this.mediaProperties.audioTrack]);
|
|
6195
|
+
|
|
6196
|
+
_loggerProxy.default.logger.info('Meeting:index#enableBNR. BNR enabled track obtained from WebRTC & sent to updateAudio');
|
|
6197
|
+
|
|
6198
|
+
_context4.next = 12;
|
|
6199
|
+
return this.updateAudio({
|
|
6200
|
+
sendAudio: true,
|
|
6201
|
+
receiveAudio: true,
|
|
6202
|
+
stream: audioStream
|
|
6203
|
+
});
|
|
6204
|
+
|
|
6205
|
+
case 12:
|
|
6206
|
+
this.isBnrEnabled = true;
|
|
6207
|
+
isSuccess = true;
|
|
6208
|
+
|
|
6209
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.ENABLE_BNR_SUCCESS);
|
|
6210
|
+
|
|
6211
|
+
_context4.next = 22;
|
|
6212
|
+
break;
|
|
6213
|
+
|
|
6214
|
+
case 17:
|
|
6215
|
+
_context4.prev = 17;
|
|
6216
|
+
_context4.t0 = _context4["catch"](2);
|
|
6217
|
+
|
|
6218
|
+
_loggerProxy.default.logger.error("Meeting:index#enableBNR. ".concat(_context4.t0));
|
|
6219
|
+
|
|
6220
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.ENABLE_BNR_FAILURE, {
|
|
6221
|
+
reason: _context4.t0.message,
|
|
6222
|
+
stack: _context4.t0.stack
|
|
6223
|
+
});
|
|
6224
|
+
|
|
6225
|
+
throw _context4.t0;
|
|
6226
|
+
|
|
6227
|
+
case 22:
|
|
6228
|
+
return _context4.abrupt("return", isSuccess);
|
|
6229
|
+
|
|
6230
|
+
case 23:
|
|
6231
|
+
case "end":
|
|
6232
|
+
return _context4.stop();
|
|
6233
|
+
}
|
|
6234
|
+
}
|
|
6235
|
+
}, _callee4, this, [[2, 17]]);
|
|
6236
|
+
}));
|
|
6237
|
+
|
|
6238
|
+
function enableBNR() {
|
|
6239
|
+
return _enableBNR.apply(this, arguments);
|
|
6240
|
+
}
|
|
6241
|
+
|
|
6242
|
+
return enableBNR;
|
|
6243
|
+
}()
|
|
6244
|
+
/**
|
|
6245
|
+
* disableBNR API
|
|
6246
|
+
* @returns {Promise<Boolean>}
|
|
6247
|
+
* @public
|
|
6248
|
+
* @memberof Meeting
|
|
6249
|
+
*/
|
|
6250
|
+
|
|
6251
|
+
}, {
|
|
6252
|
+
key: "disableBNR",
|
|
6253
|
+
value: function () {
|
|
6254
|
+
var _disableBNR = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
6255
|
+
var isSuccess, audioStream;
|
|
6256
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
6257
|
+
while (1) {
|
|
6258
|
+
switch (_context5.prev = _context5.next) {
|
|
6259
|
+
case 0:
|
|
6260
|
+
_loggerProxy.default.logger.info('Meeting:index#disableBNR. Disable BNR called');
|
|
6261
|
+
|
|
6262
|
+
isSuccess = false;
|
|
6263
|
+
_context5.prev = 2;
|
|
6264
|
+
|
|
6265
|
+
if (!(typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined')) {
|
|
6266
|
+
_context5.next = 5;
|
|
6267
|
+
break;
|
|
6268
|
+
}
|
|
6269
|
+
|
|
6270
|
+
throw new Error("Meeting doesn't have an audioTrack attached");
|
|
6271
|
+
|
|
6272
|
+
case 5:
|
|
6273
|
+
this.mediaProperties.audioTrack = _internalMediaCore.Media.Effects.BNR.disableBNR(this.mediaProperties.audioTrack);
|
|
6274
|
+
audioStream = _util2.default.createMediaStream([this.mediaProperties.audioTrack]);
|
|
6275
|
+
|
|
6276
|
+
_loggerProxy.default.logger.info('Meeting:index#disableBNR. Raw media track obtained from WebRTC & sent to updateAudio');
|
|
6277
|
+
|
|
6278
|
+
_context5.next = 10;
|
|
6279
|
+
return this.updateAudio({
|
|
6280
|
+
sendAudio: true,
|
|
6281
|
+
receiveAudio: true,
|
|
6282
|
+
stream: audioStream
|
|
6283
|
+
});
|
|
6284
|
+
|
|
6285
|
+
case 10:
|
|
6286
|
+
this.isBnrEnabled = false;
|
|
6287
|
+
isSuccess = true;
|
|
6288
|
+
|
|
6289
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DISABLE_BNR_SUCCESS);
|
|
6290
|
+
|
|
6291
|
+
_context5.next = 20;
|
|
6292
|
+
break;
|
|
6293
|
+
|
|
6294
|
+
case 15:
|
|
6295
|
+
_context5.prev = 15;
|
|
6296
|
+
_context5.t0 = _context5["catch"](2);
|
|
6297
|
+
|
|
6298
|
+
_loggerProxy.default.logger.error("Meeting:index#disableBNR. ".concat(_context5.t0));
|
|
6299
|
+
|
|
6300
|
+
_metrics.default.sendBehavioralMetric(_constants2.default.DISABLE_BNR_FAILURE, {
|
|
6301
|
+
reason: _context5.t0.message,
|
|
6302
|
+
stack: _context5.t0.stack
|
|
6303
|
+
});
|
|
6304
|
+
|
|
6305
|
+
throw _context5.t0;
|
|
6306
|
+
|
|
6307
|
+
case 20:
|
|
6308
|
+
return _context5.abrupt("return", isSuccess);
|
|
6309
|
+
|
|
6310
|
+
case 21:
|
|
6311
|
+
case "end":
|
|
6312
|
+
return _context5.stop();
|
|
6313
|
+
}
|
|
6314
|
+
}
|
|
6315
|
+
}, _callee5, this, [[2, 15]]);
|
|
6316
|
+
}));
|
|
6317
|
+
|
|
6318
|
+
function disableBNR() {
|
|
6319
|
+
return _disableBNR.apply(this, arguments);
|
|
6320
|
+
}
|
|
6321
|
+
|
|
6322
|
+
return disableBNR;
|
|
6323
|
+
}()
|
|
6158
6324
|
}]);
|
|
6159
6325
|
return Meeting;
|
|
6160
6326
|
}(_webexCore.StatelessWebexPlugin);
|