@webex/plugin-meetings 3.8.0-next.56 → 3.8.0-next.58

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.
@@ -142,6 +142,7 @@ Media.createMediaConnection = (
142
142
  turnServerInfo?: TurnServerInfo;
143
143
  bundlePolicy?: BundlePolicy;
144
144
  iceCandidatesTimeout?: number;
145
+ disableAudioMainDtx?: boolean;
145
146
  }
146
147
  ) => {
147
148
  const {
@@ -153,6 +154,7 @@ Media.createMediaConnection = (
153
154
  turnServerInfo,
154
155
  bundlePolicy,
155
156
  iceCandidatesTimeout,
157
+ disableAudioMainDtx,
156
158
  } = options;
157
159
 
158
160
  const iceServers = [];
@@ -176,6 +178,10 @@ Media.createMediaConnection = (
176
178
  config.bundlePolicy = bundlePolicy;
177
179
  }
178
180
 
181
+ if (disableAudioMainDtx !== undefined) {
182
+ config.disableAudioMainDtx = disableAudioMainDtx;
183
+ }
184
+
179
185
  return new MultistreamRoapMediaConnection(
180
186
  config,
181
187
  meetingId,
@@ -7012,6 +7012,8 @@ export default class Meeting extends StatelessWebexPlugin {
7012
7012
  bundlePolicy,
7013
7013
  // @ts-ignore - config coming from registerPlugin
7014
7014
  iceCandidatesTimeout: this.config.iceCandidatesGatheringTimeout,
7015
+ // @ts-ignore - config coming from registerPlugin
7016
+ disableAudioMainDtx: this.config.experimental.disableAudioMainDtx,
7015
7017
  }
7016
7018
  );
7017
7019
 
@@ -807,6 +807,26 @@ export default class Meetings extends WebexPlugin {
807
807
  }
808
808
  }
809
809
 
810
+ /**
811
+ * API to toggle usage of audio main DTX, needs to be called before webex.meetings.register()
812
+ *
813
+ * @param {Boolean} newValue
814
+ * @private
815
+ * @memberof Meetings
816
+ * @returns {undefined}
817
+ */
818
+ private _toggleDisableAudioMainDtx(newValue: boolean) {
819
+ if (typeof newValue !== 'boolean') {
820
+ return;
821
+ }
822
+
823
+ // @ts-ignore
824
+ if (this.config.experimental.disableAudioMainDtx !== newValue) {
825
+ // @ts-ignore
826
+ this.config.experimental.disableAudioMainDtx = newValue;
827
+ }
828
+ }
829
+
810
830
  /**
811
831
  * Executes a registration step and updates the registration status.
812
832
  * @param {Function} step - The registration step to execute.
@@ -159,6 +159,7 @@ describe('createMediaConnection', () => {
159
159
  password: 'turn password',
160
160
  },
161
161
  bundlePolicy: 'max-bundle',
162
+ disableAudioMainDtx: false,
162
163
  });
163
164
  assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
164
165
  assert.calledWith(
@@ -172,6 +173,7 @@ describe('createMediaConnection', () => {
172
173
  },
173
174
  ],
174
175
  bundlePolicy: 'max-bundle',
176
+ disableAudioMainDtx: false,
175
177
  },
176
178
  'meeting id'
177
179
  );
@@ -262,6 +264,34 @@ describe('createMediaConnection', () => {
262
264
  );
263
265
  });
264
266
 
267
+ it('does not pass disableAudioMainDtx to MultistreamRoapMediaConnection if disableAudioMainDtx is undefined', () => {
268
+ const multistreamRoapMediaConnectionConstructorStub = sinon
269
+ .stub(InternalMediaCoreModule, 'MultistreamRoapMediaConnection')
270
+ .returns(fakeRoapMediaConnection);
271
+
272
+ Media.createMediaConnection(true, 'debug string', 'meeting id', {
273
+ mediaProperties: {
274
+ mediaDirection: {
275
+ sendAudio: true,
276
+ sendVideo: true,
277
+ sendShare: false,
278
+ receiveAudio: true,
279
+ receiveVideo: true,
280
+ receiveShare: true,
281
+ },
282
+ },
283
+ disableAudioMainDtx: undefined,
284
+ });
285
+ assert.calledOnce(multistreamRoapMediaConnectionConstructorStub);
286
+ assert.calledWith(
287
+ multistreamRoapMediaConnectionConstructorStub,
288
+ {
289
+ iceServers: [],
290
+ },
291
+ 'meeting id'
292
+ );
293
+ });
294
+
265
295
  [
266
296
  {testCase: 'turnServerInfo is undefined', turnServerInfo: undefined},
267
297
  {
@@ -400,6 +400,19 @@ describe('plugin-meetings', () => {
400
400
  });
401
401
  });
402
402
 
403
+ describe('#_toggleDisableAudioMainDtx', () => {
404
+ it('should have _toggleDisableAudioMainDtx', () => {
405
+ assert.equal(typeof webex.meetings._toggleDisableAudioMainDtx, 'function');
406
+ });
407
+
408
+ describe('success', () => {
409
+ it('should update meetings to disable audio main dtx', () => {
410
+ webex.meetings._toggleDisableAudioMainDtx(true);
411
+ assert.equal(webex.meetings.config.experimental.disableAudioMainDtx, true);
412
+ });
413
+ });
414
+ });
415
+
403
416
  describe('Public API Contracts', () => {
404
417
  describe('#register', () => {
405
418
  it('emits an event and resolves when register succeeds', async () => {
@@ -658,7 +671,7 @@ describe('plugin-meetings', () => {
658
671
  quality: 'LOW',
659
672
  authToken: 'fake_token',
660
673
  mirror: false,
661
- canvasResolutionScaling: 1
674
+ canvasResolutionScaling: 1,
662
675
  });
663
676
  assert.exists(result.enable);
664
677
  assert.exists(result.disable);
@@ -674,7 +687,7 @@ describe('plugin-meetings', () => {
674
687
  quality: 'HIGH',
675
688
  blurStrength: 'STRONG',
676
689
  bgImageUrl: 'https://test.webex.com/landscape.5a535788.jpg',
677
- canvasResolutionScaling: 1
690
+ canvasResolutionScaling: 1,
678
691
  };
679
692
 
680
693
  const result = await webex.meetings.createVirtualBackgroundEffect(effectOptions);