@webex/plugin-meetings 2.13.0 → 2.14.2
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/constants.js +1 -0
- package/dist/constants.js.map +1 -1
- package/dist/locus-info/controlsUtils.js +12 -2
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +14 -0
- package/dist/locus-info/index.js.map +1 -1
- package/dist/meeting/effectsState.js +328 -0
- package/dist/meeting/effectsState.js.map +1 -0
- package/dist/meeting/index.js +102 -195
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +6 -10
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/package.json +6 -6
- package/src/constants.js +1 -0
- package/src/locus-info/controlsUtils.js +11 -0
- package/src/locus-info/index.js +16 -0
- package/src/meeting/effectsState.js +206 -0
- package/src/meeting/index.js +83 -98
- package/src/meeting-info/meeting-info-v2.js +1 -4
- package/test/unit/spec/locus-info/index.js +34 -0
- package/test/unit/spec/meeting/effectsState.js +292 -0
- package/test/unit/spec/meeting/index.js +42 -200
- package/test/unit/spec/meeting-info/meetinginfov2.js +13 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createEffectsState","type","LoggerProxy","logger","info","EffectsState","effectType","state","bnr","enabled","BNR_STATUS","NOT_ENABLED","callToWebrtcBNRInProgress","pendingPromiseResolve","pendingPromiseReject","isEnable","meeting","resolve","reject","enableBNR","disableBNR","ENABLED","e","isBnrEnabled","warn","resolvePromise","SHOULD_ENABLE","audioStream","MediaUtil","createMediaStream","mediaProperties","audioTrack","updateAudio","sendAudio","receiveAudio","mediaDirection","stream","bnrEnabled","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","ENABLE_BNR_SUCCESS","error","ENABLE_BNR_FAILURE","reason","message","stack","rejectPromise","SHOULD_DISABLE","WebRTCMedia","Effects","BNR","DISABLE_BNR_SUCCESS","DISABLE_BNR_FAILURE"],"sources":["effectsState.js"],"sourcesContent":["/* eslint-disable no-param-reassign */\nimport {Media as WebRTCMedia} from '@webex/internal-media-core';\n\nimport BEHAVIORAL_METRICS from '../metrics/constants';\nimport Metrics from '../metrics';\nimport MediaUtil from '../media/util';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {BNR_STATUS} from '../constants';\n\nconst createEffectsState = (type) => {\n LoggerProxy.logger.info(`Meeting:effectState#createEffectsState --> creating effectsState for effect ${type}`);\n\n return new EffectsState(type);\n};\n\n/* The purpose of this class is to manage the effects state(for eg., BNR).\n*/\nclass EffectsState {\n constructor(type) {\n this.effectType = type;\n this.state = {\n bnr: {\n enabled: BNR_STATUS.NOT_ENABLED\n },\n callToWebrtcBNRInProgress: false\n };\n // these 2 hold the resolve, reject methods for the promise we returned to the client in last handleClientRequest() call\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * @memberof EffectsState\n * @param {Boolean} [isEnable] true for enableBNR, false for disableBNR request\n * @param {Object} [meeting] the meeting object\n * @returns {Promise}\n */\n async handleClientRequest(isEnable, meeting) {\n return new Promise((resolve, reject) => {\n if (this.pendingPromiseResolve) {\n // resolve the last promise we returned to the client as the client has issued a new request that has superseded the previous one\n this.pendingPromiseResolve();\n }\n this.pendingPromiseResolve = resolve;\n this.pendingPromiseReject = reject;\n\n if (isEnable) this.enableBNR(meeting);\n else this.disableBNR(meeting);\n });\n }\n\n /**\n * Internal API to return status of BNR\n * @memberof EffectsState\n * @returns {Boolean}\n * @public\n * @memberof Meeting\n */\n isBnrEnabled() {\n return this.state.bnr.enabled === BNR_STATUS.ENABLED;\n }\n\n resolvePromise() {\n if (this.pendingPromiseResolve) {\n this.pendingPromiseResolve(true);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n rejectPromise(e) {\n if (this.pendingPromiseReject) {\n this.pendingPromiseReject(e);\n }\n this.pendingPromiseResolve = null;\n this.pendingPromiseReject = null;\n }\n\n /**\n * enableBNR API\n * @param {Object} meeting the meeting object\n * @returns {Promise<Boolean>}\n * @public\n * @memberof EffectsState\n */\n async enableBNR(meeting) {\n LoggerProxy.logger.info('Meeting:effectState#enableBNR. Enable BNR called');\n\n if (this.isBnrEnabled()) {\n LoggerProxy.logger.warn('Meeting:index#enableBNR. BNR is already enabled');\n\n return this.resolvePromise();\n }\n\n if (this.state.callToWebrtcBNRInProgress) {\n LoggerProxy.logger.warn('Meeting:effectState#enableBNR. Call to WebRTC in progress, we need to wait for it to complete');\n\n return this.resolvePromise();\n }\n\n const {bnr} = this.state;\n\n try {\n bnr.enabled = BNR_STATUS.SHOULD_ENABLE;\n this.state.callToWebrtcBNRInProgress = true;\n const audioStream = MediaUtil.createMediaStream([meeting.mediaProperties.audioTrack]);\n\n LoggerProxy.logger.info('Meeting:effectState#enableBNR. MediaStream created from meeting & sent to updateAudio');\n await meeting.updateAudio({\n sendAudio: true,\n receiveAudio: meeting.mediaProperties.mediaDirection.receiveAudio,\n stream: audioStream,\n bnrEnabled: bnr.enabled\n });\n\n LoggerProxy.logger.info('Meeting:effectState#enableBNR. Updated meeting audio with bnr enabled track');\n bnr.enabled = BNR_STATUS.ENABLED;\n this.state.callToWebrtcBNRInProgress = false;\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ENABLE_BNR_SUCCESS,\n );\n }\n catch (error) {\n bnr.enabled = BNR_STATUS.NOT_ENABLED;\n this.state.callToWebrtcBNRInProgress = false;\n LoggerProxy.logger.error('Meeting:index#enableBNR.', error);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.ENABLE_BNR_FAILURE,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n this.rejectPromise(error);\n\n throw error;\n }\n\n return this.resolvePromise();\n }\n\n /**\n * disableBNR API\n * @param {Object} meeting the meeting object\n * @returns {Promise<Boolean>}\n * @public\n * @memberof EffectsState\n */\n async disableBNR(meeting) {\n LoggerProxy.logger.info('Meeting:effectState#disableBNR. Disable BNR called');\n\n const {bnr} = this.state;\n\n try {\n if (this.state.callToWebrtcBNRInProgress) {\n LoggerProxy.logger.info('Meeting:effectState#disableBNR. Call to WebRTC in progress, we need to wait for it to complete');\n\n return this.resolvePromise();\n }\n\n bnr.enabled = BNR_STATUS.SHOULD_DISABLE;\n this.state.callToWebrtcBNRInProgress = true;\n\n const audioTrack = WebRTCMedia.Effects.BNR.disableBNR(meeting.mediaProperties.audioTrack);\n\n const audioStream = MediaUtil.createMediaStream([audioTrack]);\n\n LoggerProxy.logger.info('Meeting:effectState#disableBNR. Raw media track obtained from WebRTC & sent to updateAudio');\n\n await meeting.updateAudio({\n sendAudio: true,\n receiveAudio: meeting.mediaProperties.mediaDirection.receiveAudio,\n stream: audioStream\n });\n\n bnr.enabled = BNR_STATUS.NOT_ENABLED;\n\n this.state.callToWebrtcBNRInProgress = false;\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.DISABLE_BNR_SUCCESS\n );\n }\n catch (error) {\n bnr.enabled = BNR_STATUS.ENABLED;\n this.state.callToWebrtcBNRInProgress = false;\n LoggerProxy.logger.error(`Meeting:index#disableBNR. ${error}`);\n\n Metrics.sendBehavioralMetric(\n BEHAVIORAL_METRICS.DISABLE_BNR_FAILURE,\n {\n reason: error.message,\n stack: error.stack\n }\n );\n this.rejectPromise(error);\n\n throw error;\n }\n\n return this.resolvePromise();\n }\n}\n\nexport default createEffectsState;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAPA;AASA,IAAMA,kBAAkB,GAAG,SAArBA,kBAAqB,CAACC,IAAD,EAAU;EACnCC,qBAAYC,MAAZ,CAAmBC,IAAnB,uFAAuGH,IAAvG;;EAEA,OAAO,IAAII,YAAJ,CAAiBJ,IAAjB,CAAP;AACD,CAJD;AAMA;AACA;;;IACMI,Y;EACJ,sBAAYJ,IAAZ,EAAkB;IAAA;IAChB,KAAKK,UAAL,GAAkBL,IAAlB;IACA,KAAKM,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wBK,cAAxB,CAAuCD,YAF7B;kBAGxBE,MAAM,EAAET;gBAHgB,CAApB,CArBV;;cAAA;gBA2BInB,GAAG,CAACC,OAAJ,GAAcC,uBAAWC,WAAzB;gBAEA,KAAKJ,KAAL,CAAWK,yBAAX,GAAuC,KAAvC;;gBAEA0B,iBAAQC,oBAAR,CACEC,mBAAmBY,mBADrB;;gBA/BJ;gBAAA;;cAAA;gBAAA;gBAAA;gBAoCI5C,GAAG,CAACC,OAAJ,GAAcC,uBAAWW,OAAzB;gBACA,KAAKd,KAAL,CAAWK,yBAAX,GAAuC,KAAvC;;gBACAV,qBAAYC,MAAZ,CAAmBuC,KAAnB;;gBAEAJ,iBAAQC,oBAAR,CACEC,mBAAmBa,mBADrB,EAEE;kBACET,MAAM,EAAE,aAAMC,OADhB;kBAEEC,KAAK,EAAE,aAAMA;gBAFf,CAFF;;gBAOA,KAAKC,aAAL;gBA/CJ;;cAAA;gBAAA,kCAoDS,KAAKtB,cAAL,EApDT;;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA;MAAA,C;;;;;;;;;;;;eAwDazB,kB"}
|
package/dist/meeting/index.js
CHANGED
|
@@ -86,6 +86,8 @@ var _state = _interopRequireDefault(require("../meeting/state"));
|
|
|
86
86
|
|
|
87
87
|
var _muteState = _interopRequireDefault(require("../meeting/muteState"));
|
|
88
88
|
|
|
89
|
+
var _effectsState = _interopRequireDefault(require("../meeting/effectsState"));
|
|
90
|
+
|
|
89
91
|
var _locusInfo = _interopRequireDefault(require("../locus-info"));
|
|
90
92
|
|
|
91
93
|
var _peerConnectionManager = _interopRequireDefault(require("../peer-connection-manager"));
|
|
@@ -780,6 +782,15 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
780
782
|
*/
|
|
781
783
|
|
|
782
784
|
_this.video = null;
|
|
785
|
+
/**
|
|
786
|
+
* created later
|
|
787
|
+
* @instance
|
|
788
|
+
* @type {EffectsState}
|
|
789
|
+
* @private
|
|
790
|
+
* @memberof Meeting
|
|
791
|
+
*/
|
|
792
|
+
|
|
793
|
+
_this.effects = null;
|
|
783
794
|
/**
|
|
784
795
|
* @instance
|
|
785
796
|
* @type {MeetingStateMachine}
|
|
@@ -1203,14 +1214,6 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
1203
1214
|
*/
|
|
1204
1215
|
|
|
1205
1216
|
_this.meetingInfoFailureReason = undefined;
|
|
1206
|
-
/**
|
|
1207
|
-
* Indicates the current status of BNR in the meeting
|
|
1208
|
-
* @type {BNR_STATUS}
|
|
1209
|
-
* @private
|
|
1210
|
-
* @memberof Meeting
|
|
1211
|
-
*/
|
|
1212
|
-
|
|
1213
|
-
_this.bnrStatus = _constants.BNR_STATUS.NOT_ENABLED;
|
|
1214
1217
|
|
|
1215
1218
|
_this.setUpLocusInfoListeners();
|
|
1216
1219
|
|
|
@@ -1937,6 +1940,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
1937
1940
|
meetingContainerUrl: meetingContainerUrl
|
|
1938
1941
|
});
|
|
1939
1942
|
});
|
|
1943
|
+
this.locusInfo.on(_constants.LOCUSINFO.EVENTS.CONTROLS_MEETING_TRANSCRIBE_UPDATED, function (_ref7) {
|
|
1944
|
+
var caption = _ref7.caption,
|
|
1945
|
+
transcribing = _ref7.transcribing;
|
|
1946
|
+
|
|
1947
|
+
if (transcribing && _this11.transcription && _this11.config.receiveTranscription) {
|
|
1948
|
+
_this11.receiveTranscription();
|
|
1949
|
+
} else if (!transcribing && _this11.transcription) {
|
|
1950
|
+
_triggerProxy.default.trigger(_this11, {
|
|
1951
|
+
file: 'meeting/index',
|
|
1952
|
+
function: 'setupLocusControlsListener'
|
|
1953
|
+
}, _constants.EVENT_TRIGGERS.MEETING_STOPPED_RECEIVING_TRANSCRIPTION, {
|
|
1954
|
+
caption: caption,
|
|
1955
|
+
transcribing: transcribing
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
});
|
|
1940
1959
|
}
|
|
1941
1960
|
/**
|
|
1942
1961
|
* Set up the locus info media shares listener
|
|
@@ -3663,10 +3682,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
3663
3682
|
joinOptions = options.joinOptions,
|
|
3664
3683
|
audioVideoOptions = options.audioVideoOptions;
|
|
3665
3684
|
return this.join(joinOptions).then(function (joinResponse) {
|
|
3666
|
-
return _this30.getMediaStreams(mediaSettings, audioVideoOptions).then(function (
|
|
3667
|
-
var
|
|
3668
|
-
localStream =
|
|
3669
|
-
localShare =
|
|
3685
|
+
return _this30.getMediaStreams(mediaSettings, audioVideoOptions).then(function (_ref8) {
|
|
3686
|
+
var _ref9 = (0, _slicedToArray2.default)(_ref8, 2),
|
|
3687
|
+
localStream = _ref9[0],
|
|
3688
|
+
localShare = _ref9[1];
|
|
3670
3689
|
|
|
3671
3690
|
return _this30.addMedia({
|
|
3672
3691
|
mediaSettings: mediaSettings,
|
|
@@ -3782,9 +3801,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
3782
3801
|
}, {
|
|
3783
3802
|
key: "isTranscriptionSupported",
|
|
3784
3803
|
value: function isTranscriptionSupported() {
|
|
3785
|
-
var _this$
|
|
3804
|
+
var _this$locusInfo$contr;
|
|
3786
3805
|
|
|
3787
|
-
if ((_this$
|
|
3806
|
+
if ((_this$locusInfo$contr = this.locusInfo.controls.transcribe) !== null && _this$locusInfo$contr !== void 0 && _this$locusInfo$contr.transcribing) {
|
|
3788
3807
|
return true;
|
|
3789
3808
|
}
|
|
3790
3809
|
|
|
@@ -4059,7 +4078,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4059
4078
|
|
|
4060
4079
|
return join;
|
|
4061
4080
|
}).then( /*#__PURE__*/function () {
|
|
4062
|
-
var
|
|
4081
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(join) {
|
|
4063
4082
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
4064
4083
|
while (1) {
|
|
4065
4084
|
switch (_context3.prev = _context3.next) {
|
|
@@ -4104,7 +4123,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4104
4123
|
}));
|
|
4105
4124
|
|
|
4106
4125
|
return function (_x2) {
|
|
4107
|
-
return
|
|
4126
|
+
return _ref10.apply(this, arguments);
|
|
4108
4127
|
};
|
|
4109
4128
|
}()).catch(function (error) {
|
|
4110
4129
|
var _error$error;
|
|
@@ -4386,10 +4405,10 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4386
4405
|
sendAudio: true,
|
|
4387
4406
|
sendVideo: true,
|
|
4388
4407
|
sendShare: false
|
|
4389
|
-
}).then(function (
|
|
4390
|
-
var
|
|
4391
|
-
localStream =
|
|
4392
|
-
localShare =
|
|
4408
|
+
}).then(function (_ref11) {
|
|
4409
|
+
var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
|
|
4410
|
+
localStream = _ref12[0],
|
|
4411
|
+
localShare = _ref12[1];
|
|
4393
4412
|
|
|
4394
4413
|
return _this38.updateMedia({
|
|
4395
4414
|
mediaSettings: {
|
|
@@ -4824,7 +4843,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4824
4843
|
var _updateAudio = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(options) {
|
|
4825
4844
|
var _this42 = this;
|
|
4826
4845
|
|
|
4827
|
-
var sendAudio, receiveAudio, stream, audioTransceiver, track;
|
|
4846
|
+
var sendAudio, receiveAudio, stream, bnrEnabled, audioTransceiver, track;
|
|
4828
4847
|
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
4829
4848
|
while (1) {
|
|
4830
4849
|
switch (_context4.prev = _context4.next) {
|
|
@@ -4837,7 +4856,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4837
4856
|
return _context4.abrupt("return", this.enqueueMediaUpdate(MEDIA_UPDATE_TYPE.AUDIO, options));
|
|
4838
4857
|
|
|
4839
4858
|
case 2:
|
|
4840
|
-
sendAudio = options.sendAudio, receiveAudio = options.receiveAudio, stream = options.stream;
|
|
4859
|
+
sendAudio = options.sendAudio, receiveAudio = options.receiveAudio, stream = options.stream, bnrEnabled = options.bnrEnabled;
|
|
4841
4860
|
audioTransceiver = this.mediaProperties.peerConnection.audioTransceiver;
|
|
4842
4861
|
track = _util.default.getTrack(stream).audioTrack;
|
|
4843
4862
|
|
|
@@ -4849,19 +4868,22 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4849
4868
|
return _context4.abrupt("return", _promise.default.reject(new _parameter.default('Pass sendAudio and receiveAudio parameter')));
|
|
4850
4869
|
|
|
4851
4870
|
case 7:
|
|
4852
|
-
if (!(sendAudio && !this.isAudioMuted() && (
|
|
4853
|
-
_context4.next =
|
|
4871
|
+
if (!(sendAudio && !this.isAudioMuted() && (bnrEnabled === _constants.BNR_STATUS.ENABLED || bnrEnabled === _constants.BNR_STATUS.SHOULD_ENABLE))) {
|
|
4872
|
+
_context4.next = 13;
|
|
4854
4873
|
break;
|
|
4855
4874
|
}
|
|
4856
4875
|
|
|
4857
|
-
|
|
4876
|
+
_loggerProxy.default.logger.info('Meeting:index#updateAudio. Calling WebRTC enable bnr method');
|
|
4877
|
+
|
|
4878
|
+
_context4.next = 11;
|
|
4858
4879
|
return this.internal_enableBNR(track);
|
|
4859
4880
|
|
|
4860
|
-
case
|
|
4881
|
+
case 11:
|
|
4861
4882
|
track = _context4.sent;
|
|
4862
|
-
this.bnrStatus = _constants.BNR_STATUS.ENABLED;
|
|
4863
4883
|
|
|
4864
|
-
|
|
4884
|
+
_loggerProxy.default.logger.info('Meeting:index#updateAudio. WebRTC enable bnr request completed');
|
|
4885
|
+
|
|
4886
|
+
case 13:
|
|
4865
4887
|
return _context4.abrupt("return", _util.default.validateOptions({
|
|
4866
4888
|
sendAudio: sendAudio,
|
|
4867
4889
|
localStream: stream
|
|
@@ -4900,7 +4922,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
4900
4922
|
_this42.audio = _this42.audio || (0, _muteState.default)(_constants.AUDIO, _this42, _this42.mediaProperties.mediaDirection);
|
|
4901
4923
|
}));
|
|
4902
4924
|
|
|
4903
|
-
case
|
|
4925
|
+
case 14:
|
|
4904
4926
|
case "end":
|
|
4905
4927
|
return _context4.stop();
|
|
4906
4928
|
}
|
|
@@ -5714,9 +5736,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
5714
5736
|
sendVideo: this.mediaProperties.mediaDirection.sendVideo,
|
|
5715
5737
|
sendShare: this.mediaProperties.mediaDirection.sendShare
|
|
5716
5738
|
};
|
|
5717
|
-
return this.getMediaStreams(mediaDirection, _constants.VIDEO_RESOLUTIONS[level]).then(function (
|
|
5718
|
-
var
|
|
5719
|
-
localStream =
|
|
5739
|
+
return this.getMediaStreams(mediaDirection, _constants.VIDEO_RESOLUTIONS[level]).then(function (_ref13) {
|
|
5740
|
+
var _ref14 = (0, _slicedToArray2.default)(_ref13, 1),
|
|
5741
|
+
localStream = _ref14[0];
|
|
5720
5742
|
|
|
5721
5743
|
return _this53.updateVideo({
|
|
5722
5744
|
sendVideo: true,
|
|
@@ -5932,9 +5954,9 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
5932
5954
|
|
|
5933
5955
|
}, {
|
|
5934
5956
|
key: "handleMediaLogging",
|
|
5935
|
-
value: function handleMediaLogging(
|
|
5936
|
-
var audioTrack =
|
|
5937
|
-
videoTrack =
|
|
5957
|
+
value: function handleMediaLogging(_ref15) {
|
|
5958
|
+
var audioTrack = _ref15.audioTrack,
|
|
5959
|
+
videoTrack = _ref15.videoTrack;
|
|
5938
5960
|
|
|
5939
5961
|
_util.default.handleVideoLogging(videoTrack);
|
|
5940
5962
|
|
|
@@ -6218,7 +6240,7 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6218
6240
|
* @memberof Meeting
|
|
6219
6241
|
*/
|
|
6220
6242
|
function isBnrEnabled() {
|
|
6221
|
-
return this.
|
|
6243
|
+
return this.effects && this.effects.isBnrEnabled();
|
|
6222
6244
|
}
|
|
6223
6245
|
/**
|
|
6224
6246
|
* Internal API to obtain BNR enabled MediaStream
|
|
@@ -6274,184 +6296,69 @@ var Meeting = /*#__PURE__*/function (_StatelessWebexPlugin) {
|
|
|
6274
6296
|
return internal_enableBNR;
|
|
6275
6297
|
}()
|
|
6276
6298
|
/**
|
|
6277
|
-
*
|
|
6278
|
-
* @returns {Promise
|
|
6299
|
+
* Enable the audio track with BNR for a meeting
|
|
6300
|
+
* @returns {Promise} resolves the data from enable bnr or rejects if there is no audio or audio is muted
|
|
6279
6301
|
* @public
|
|
6280
6302
|
* @memberof Meeting
|
|
6281
6303
|
*/
|
|
6282
6304
|
|
|
6283
6305
|
}, {
|
|
6284
6306
|
key: "enableBNR",
|
|
6285
|
-
value: function () {
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
while (1) {
|
|
6290
|
-
switch (_context6.prev = _context6.next) {
|
|
6291
|
-
case 0:
|
|
6292
|
-
_loggerProxy.default.logger.info('Meeting:index#enableBNR. Enable BNR called');
|
|
6293
|
-
|
|
6294
|
-
isSuccess = false;
|
|
6295
|
-
_context6.prev = 2;
|
|
6296
|
-
|
|
6297
|
-
if (!(typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined')) {
|
|
6298
|
-
_context6.next = 7;
|
|
6299
|
-
break;
|
|
6300
|
-
}
|
|
6301
|
-
|
|
6302
|
-
throw new Error("Meeting doesn't have an audioTrack attached");
|
|
6303
|
-
|
|
6304
|
-
case 7:
|
|
6305
|
-
if (!this.isAudioMuted()) {
|
|
6306
|
-
_context6.next = 9;
|
|
6307
|
-
break;
|
|
6308
|
-
}
|
|
6309
|
-
|
|
6310
|
-
throw new Error('Cannot enable BNR while meeting is muted');
|
|
6311
|
-
|
|
6312
|
-
case 9:
|
|
6313
|
-
this.bnrStatus = _constants.BNR_STATUS.SHOULD_ENABLE;
|
|
6314
|
-
audioStream = _util2.default.createMediaStream([this.mediaProperties.audioTrack]);
|
|
6315
|
-
|
|
6316
|
-
_loggerProxy.default.logger.info('Meeting:index#enableBNR. MediaStream created from meeting & sent to updateAudio');
|
|
6317
|
-
|
|
6318
|
-
_context6.next = 14;
|
|
6319
|
-
return this.updateAudio({
|
|
6320
|
-
sendAudio: true,
|
|
6321
|
-
receiveAudio: this.mediaProperties.mediaDirection.receiveAudio,
|
|
6322
|
-
stream: audioStream
|
|
6323
|
-
});
|
|
6324
|
-
|
|
6325
|
-
case 14:
|
|
6326
|
-
this.bnrStatus = _constants.BNR_STATUS.ENABLED;
|
|
6327
|
-
isSuccess = true;
|
|
6328
|
-
|
|
6329
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.ENABLE_BNR_SUCCESS);
|
|
6330
|
-
|
|
6331
|
-
_context6.next = 25;
|
|
6332
|
-
break;
|
|
6333
|
-
|
|
6334
|
-
case 19:
|
|
6335
|
-
_context6.prev = 19;
|
|
6336
|
-
_context6.t0 = _context6["catch"](2);
|
|
6337
|
-
this.bnrStatus = _constants.BNR_STATUS.NOT_ENABLED;
|
|
6338
|
-
|
|
6339
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.ENABLE_BNR_FAILURE, {
|
|
6340
|
-
reason: _context6.t0.message,
|
|
6341
|
-
stack: _context6.t0.stack
|
|
6342
|
-
});
|
|
6343
|
-
|
|
6344
|
-
_loggerProxy.default.logger.error('Meeting:index#enableBNR.', _context6.t0);
|
|
6345
|
-
|
|
6346
|
-
throw _context6.t0;
|
|
6347
|
-
|
|
6348
|
-
case 25:
|
|
6349
|
-
return _context6.abrupt("return", isSuccess);
|
|
6350
|
-
|
|
6351
|
-
case 26:
|
|
6352
|
-
case "end":
|
|
6353
|
-
return _context6.stop();
|
|
6354
|
-
}
|
|
6355
|
-
}
|
|
6356
|
-
}, _callee6, this, [[2, 19]]);
|
|
6357
|
-
}));
|
|
6307
|
+
value: function enableBNR() {
|
|
6308
|
+
if (typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined') {
|
|
6309
|
+
return _promise.default.reject(new Error("Meeting doesn't have an audioTrack attached"));
|
|
6310
|
+
}
|
|
6358
6311
|
|
|
6359
|
-
|
|
6360
|
-
return
|
|
6312
|
+
if (this.isAudioMuted()) {
|
|
6313
|
+
return _promise.default.reject(new Error('Cannot enable BNR while meeting is muted'));
|
|
6361
6314
|
}
|
|
6362
6315
|
|
|
6363
|
-
|
|
6364
|
-
|
|
6316
|
+
this.effects = this.effects || (0, _effectsState.default)('BNR');
|
|
6317
|
+
var LOG_HEADER = 'Meeting:index#enableBNR -->';
|
|
6318
|
+
return logRequest(this.effects.handleClientRequest(true, this).then(function (res) {
|
|
6319
|
+
_loggerProxy.default.logger.info('Meeting:index#enableBNR. Enable bnr completed');
|
|
6320
|
+
|
|
6321
|
+
return res;
|
|
6322
|
+
}).catch(function (error) {
|
|
6323
|
+
throw error;
|
|
6324
|
+
}), {
|
|
6325
|
+
header: "".concat(LOG_HEADER, " enable bnr"),
|
|
6326
|
+
success: "".concat(LOG_HEADER, " enable bnr success"),
|
|
6327
|
+
failure: "".concat(LOG_HEADER, " enable bnr failure, ")
|
|
6328
|
+
});
|
|
6329
|
+
}
|
|
6365
6330
|
/**
|
|
6366
|
-
*
|
|
6367
|
-
* @returns {Promise
|
|
6331
|
+
* Disable the BNR for an audio track
|
|
6332
|
+
* @returns {Promise} resolves the data from disable bnr or rejects if there is no audio set
|
|
6368
6333
|
* @public
|
|
6369
6334
|
* @memberof Meeting
|
|
6370
6335
|
*/
|
|
6371
6336
|
|
|
6372
6337
|
}, {
|
|
6373
6338
|
key: "disableBNR",
|
|
6374
|
-
value: function () {
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
while (1) {
|
|
6379
|
-
switch (_context7.prev = _context7.next) {
|
|
6380
|
-
case 0:
|
|
6381
|
-
_loggerProxy.default.logger.info('Meeting:index#disableBNR. Disable BNR called');
|
|
6382
|
-
|
|
6383
|
-
isSuccess = false;
|
|
6384
|
-
_context7.prev = 2;
|
|
6385
|
-
|
|
6386
|
-
if (this.isBnrEnabled()) {
|
|
6387
|
-
_context7.next = 7;
|
|
6388
|
-
break;
|
|
6389
|
-
}
|
|
6390
|
-
|
|
6391
|
-
throw new Error('Can not disable as BNR is not enabled');
|
|
6392
|
-
|
|
6393
|
-
case 7:
|
|
6394
|
-
if (!(typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined')) {
|
|
6395
|
-
_context7.next = 9;
|
|
6396
|
-
break;
|
|
6397
|
-
}
|
|
6398
|
-
|
|
6399
|
-
throw new Error("Meeting doesn't have an audioTrack attached");
|
|
6400
|
-
|
|
6401
|
-
case 9:
|
|
6402
|
-
audioTrack = _internalMediaCore.Media.Effects.BNR.disableBNR(this.mediaProperties.audioTrack);
|
|
6403
|
-
audioStream = _util2.default.createMediaStream([audioTrack]);
|
|
6404
|
-
|
|
6405
|
-
_loggerProxy.default.logger.info('Meeting:index#disableBNR. Raw media track obtained from WebRTC & sent to updateAudio');
|
|
6406
|
-
|
|
6407
|
-
this.bnrStatus = _constants.BNR_STATUS.SHOULD_DISABLE;
|
|
6408
|
-
_context7.next = 15;
|
|
6409
|
-
return this.updateAudio({
|
|
6410
|
-
sendAudio: true,
|
|
6411
|
-
receiveAudio: this.mediaProperties.mediaDirection.receiveAudio,
|
|
6412
|
-
stream: audioStream
|
|
6413
|
-
});
|
|
6414
|
-
|
|
6415
|
-
case 15:
|
|
6416
|
-
this.bnrStatus = _constants.BNR_STATUS.NOT_ENABLED;
|
|
6417
|
-
isSuccess = true;
|
|
6418
|
-
|
|
6419
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.DISABLE_BNR_SUCCESS);
|
|
6420
|
-
|
|
6421
|
-
_context7.next = 26;
|
|
6422
|
-
break;
|
|
6423
|
-
|
|
6424
|
-
case 20:
|
|
6425
|
-
_context7.prev = 20;
|
|
6426
|
-
_context7.t0 = _context7["catch"](2);
|
|
6427
|
-
this.bnrStatus = _constants.BNR_STATUS.ENABLED;
|
|
6428
|
-
|
|
6429
|
-
_loggerProxy.default.logger.error("Meeting:index#disableBNR. ".concat(_context7.t0));
|
|
6430
|
-
|
|
6431
|
-
_metrics.default.sendBehavioralMetric(_constants2.default.DISABLE_BNR_FAILURE, {
|
|
6432
|
-
reason: _context7.t0.message,
|
|
6433
|
-
stack: _context7.t0.stack
|
|
6434
|
-
});
|
|
6435
|
-
|
|
6436
|
-
throw _context7.t0;
|
|
6437
|
-
|
|
6438
|
-
case 26:
|
|
6439
|
-
return _context7.abrupt("return", isSuccess);
|
|
6440
|
-
|
|
6441
|
-
case 27:
|
|
6442
|
-
case "end":
|
|
6443
|
-
return _context7.stop();
|
|
6444
|
-
}
|
|
6445
|
-
}
|
|
6446
|
-
}, _callee7, this, [[2, 20]]);
|
|
6447
|
-
}));
|
|
6339
|
+
value: function disableBNR() {
|
|
6340
|
+
if (typeof this.mediaProperties === 'undefined' || typeof this.mediaProperties.audioTrack === 'undefined') {
|
|
6341
|
+
return _promise.default.reject(new Error("Meeting doesn't have an audioTrack attached"));
|
|
6342
|
+
}
|
|
6448
6343
|
|
|
6449
|
-
|
|
6450
|
-
return
|
|
6344
|
+
if (!this.isBnrEnabled()) {
|
|
6345
|
+
return _promise.default.reject(new Error('Can not disable as BNR is not enabled'));
|
|
6451
6346
|
}
|
|
6452
6347
|
|
|
6453
|
-
|
|
6454
|
-
|
|
6348
|
+
this.effects = this.effects || (0, _effectsState.default)('BNR');
|
|
6349
|
+
var LOG_HEADER = 'Meeting:index#disableBNR -->';
|
|
6350
|
+
return logRequest(this.effects.handleClientRequest(false, this).then(function (res) {
|
|
6351
|
+
_loggerProxy.default.logger.info('Meeting:index#disableBNR. Disable bnr completed');
|
|
6352
|
+
|
|
6353
|
+
return res;
|
|
6354
|
+
}).catch(function (error) {
|
|
6355
|
+
throw error;
|
|
6356
|
+
}), {
|
|
6357
|
+
header: "".concat(LOG_HEADER, " disable bnr"),
|
|
6358
|
+
success: "".concat(LOG_HEADER, " disable bnr success"),
|
|
6359
|
+
failure: "".concat(LOG_HEADER, " disable bnr failure, ")
|
|
6360
|
+
});
|
|
6361
|
+
}
|
|
6455
6362
|
}]);
|
|
6456
6363
|
return Meeting;
|
|
6457
6364
|
}(_webexCore.StatelessWebexPlugin);
|