@webex/plugin-meetings 3.7.0-next.22 → 3.7.0-next.24

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.
Files changed (46) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/constants.js +2 -0
  4. package/dist/constants.js.map +1 -1
  5. package/dist/interpretation/index.js +1 -1
  6. package/dist/interpretation/siLanguage.js +1 -1
  7. package/dist/locus-info/index.js +8 -0
  8. package/dist/locus-info/index.js.map +1 -1
  9. package/dist/locus-info/selfUtils.js +20 -11
  10. package/dist/locus-info/selfUtils.js.map +1 -1
  11. package/dist/meeting/index.js +710 -645
  12. package/dist/meeting/index.js.map +1 -1
  13. package/dist/meeting/request.js +30 -0
  14. package/dist/meeting/request.js.map +1 -1
  15. package/dist/meeting/request.type.js.map +1 -1
  16. package/dist/member/index.js +9 -0
  17. package/dist/member/index.js.map +1 -1
  18. package/dist/member/types.js.map +1 -1
  19. package/dist/member/util.js +39 -28
  20. package/dist/member/util.js.map +1 -1
  21. package/dist/multistream/sendSlotManager.js +24 -0
  22. package/dist/multistream/sendSlotManager.js.map +1 -1
  23. package/dist/types/constants.d.ts +2 -0
  24. package/dist/types/meeting/index.d.ts +8 -0
  25. package/dist/types/meeting/request.d.ts +12 -1
  26. package/dist/types/meeting/request.type.d.ts +6 -0
  27. package/dist/types/member/index.d.ts +1 -0
  28. package/dist/types/member/types.d.ts +7 -0
  29. package/dist/types/multistream/sendSlotManager.d.ts +8 -1
  30. package/dist/webinar/index.js +1 -1
  31. package/package.json +3 -3
  32. package/src/constants.ts +2 -0
  33. package/src/locus-info/index.ts +13 -0
  34. package/src/locus-info/selfUtils.ts +6 -0
  35. package/src/meeting/index.ts +58 -0
  36. package/src/meeting/request.ts +26 -1
  37. package/src/meeting/request.type.ts +7 -0
  38. package/src/member/index.ts +9 -0
  39. package/src/member/types.ts +8 -0
  40. package/src/member/util.ts +34 -24
  41. package/src/multistream/sendSlotManager.ts +31 -0
  42. package/test/unit/spec/locus-info/index.js +93 -0
  43. package/test/unit/spec/locus-info/selfConstant.js +7 -0
  44. package/test/unit/spec/locus-info/selfUtils.js +39 -0
  45. package/test/unit/spec/meeting/index.js +108 -0
  46. package/test/unit/spec/member/util.js +52 -11
@@ -3742,6 +3742,93 @@ describe('plugin-meetings', () => {
3742
3742
  });
3743
3743
  });
3744
3744
 
3745
+ describe(`#beRightBack`, () => {
3746
+ const fakeMultistreamRoapMediaConnection = {
3747
+ createSendSlot: sinon.stub().returns({
3748
+ setSourceStateOverride: sinon.stub().resolves(),
3749
+ clearSourceStateOverride: sinon.stub().resolves(),
3750
+ }),
3751
+ };
3752
+
3753
+ beforeEach(() => {
3754
+ meeting.meetingRequest.setBrb = sinon.stub().resolves({body: 'test'});
3755
+ meeting.mediaProperties.webrtcMediaConnection = {createSendSlot: sinon.stub()};
3756
+ meeting.sendSlotManager.createSlot(
3757
+ fakeMultistreamRoapMediaConnection,
3758
+ MediaType.VideoMain
3759
+ );
3760
+
3761
+ meeting.locusUrl = 'locus url';
3762
+ meeting.deviceUrl = 'device url';
3763
+ meeting.selfId = 'self id';
3764
+ });
3765
+
3766
+ afterEach(() => {
3767
+ sinon.restore();
3768
+ });
3769
+
3770
+ it('should have #beRightBack', () => {
3771
+ assert.exists(meeting.beRightBack);
3772
+ });
3773
+
3774
+ describe('when in a multistream meeting', () => {
3775
+
3776
+ beforeEach(() => {
3777
+ meeting.isMultistream = true;
3778
+ });
3779
+
3780
+ it('should enable #beRightBack and return a promise', async () => {
3781
+ const brbResult = meeting.beRightBack(true);
3782
+
3783
+ await brbResult;
3784
+ assert.exists(brbResult.then);
3785
+ assert.calledOnce(meeting.meetingRequest.setBrb);
3786
+ })
3787
+
3788
+ it('should disable #beRightBack and return a promise', async () => {
3789
+ const brbResult = meeting.beRightBack(false);
3790
+
3791
+ await brbResult;
3792
+ assert.exists(brbResult.then);
3793
+ assert.calledOnce(meeting.meetingRequest.setBrb);
3794
+ })
3795
+
3796
+ it('should throw an error and reject the promise if setBrb fails', async () => {
3797
+ const error = new Error('setBrb failed');
3798
+ meeting.meetingRequest.setBrb.rejects(error);
3799
+
3800
+ try {
3801
+ await meeting.beRightBack(true);
3802
+ } catch (err) {
3803
+ assert.instanceOf(err, Error);
3804
+ assert.equal(err.message, 'setBrb failed');
3805
+ assert.isRejected((Promise.reject()));
3806
+ }
3807
+ })
3808
+ });
3809
+
3810
+ describe('when in a transcoded meeting', () => {
3811
+
3812
+ beforeEach(() => {
3813
+ meeting.isMultistream = false;
3814
+ });
3815
+
3816
+ it('should ignore enabling #beRightBack', async () => {
3817
+ meeting.beRightBack(true);
3818
+
3819
+ assert.isRejected((Promise.reject()));
3820
+ assert.notCalled(meeting.meetingRequest.setBrb);
3821
+ })
3822
+
3823
+ it('should ignore disabling #beRightBack', async () => {
3824
+ meeting.beRightBack(false);
3825
+
3826
+ assert.isRejected((Promise.reject()));
3827
+ assert.notCalled(meeting.meetingRequest.setBrb);
3828
+ })
3829
+ });
3830
+ });
3831
+
3745
3832
  /* This set of tests are like semi-integration tests, they use real MuteState, Media, LocusMediaRequest and Roap classes.
3746
3833
  They mock the @webex/internal-media-core and sending of /media http requests to Locus.
3747
3834
  Their main purpose is to test that we send the right http requests to Locus and make right calls
@@ -8719,6 +8806,7 @@ describe('plugin-meetings', () => {
8719
8806
  });
8720
8807
  });
8721
8808
  });
8809
+
8722
8810
  describe('#setUpLocusInfoSelfListener', () => {
8723
8811
  it('listens to the self unadmitted guest event', (done) => {
8724
8812
  meeting.startKeepAlive = sinon.stub();
@@ -8813,6 +8901,26 @@ describe('plugin-meetings', () => {
8813
8901
  );
8814
8902
  });
8815
8903
 
8904
+ it('listens to the brb state changed event', () => {
8905
+ const assertBrb = (enabled) => {
8906
+ meeting.locusInfo.emit(
8907
+ { function: 'test', file: 'test' },
8908
+ LOCUSINFO.EVENTS.SELF_MEETING_BRB_CHANGED,
8909
+ { brb: { enabled } },
8910
+ )
8911
+ assert.calledWithExactly(
8912
+ TriggerProxy.trigger,
8913
+ meeting,
8914
+ {file: 'meeting/index', function: 'setUpLocusInfoSelfListener'},
8915
+ EVENT_TRIGGERS.MEETING_SELF_BRB_UPDATE,
8916
+ { payload: { brb: { enabled } } },
8917
+ );
8918
+ }
8919
+
8920
+ assertBrb(true);
8921
+ assertBrb(false);
8922
+ })
8923
+
8816
8924
  it('listens to the interpretation changed event', () => {
8817
8925
  meeting.simultaneousInterpretation.updateSelfInterpretation = sinon.stub();
8818
8926
 
@@ -5,13 +5,13 @@ import {_SEND_RECEIVE_, _RECEIVE_ONLY_} from '../../../../src/constants';
5
5
 
6
6
  describe('plugin-meetings', () => {
7
7
  describe('isHandRaised', () => {
8
- it('throws error when there is no participant', () => {
8
+ it('throws an error when there is no participant', () => {
9
9
  assert.throws(() => {
10
10
  MemberUtil.isHandRaised();
11
11
  }, 'Raise hand could not be processed, participant is undefined.');
12
12
  });
13
13
 
14
- it('returns false when controls is not there', () => {
14
+ it('returns false when controls are not present', () => {
15
15
  const participant = {};
16
16
 
17
17
  assert.isFalse(MemberUtil.isHandRaised(participant));
@@ -51,7 +51,7 @@ describe('plugin-meetings', () => {
51
51
  });
52
52
 
53
53
  describe('MemberUtil.canReclaimHost', () => {
54
- it('throws error when there is no participant', () => {
54
+ it('throws an error when there is no participant', () => {
55
55
  assert.throws(() => {
56
56
  MemberUtil.canReclaimHost();
57
57
  }, 'canReclaimHostRole could not be processed, participant is undefined.');
@@ -352,8 +352,49 @@ describe('plugin-meetings', () => {
352
352
  });
353
353
  });
354
354
 
355
+ describe('MemberUtil.isBrb', () => {
356
+ it('returns true when brb is enabled', () => {
357
+ const participant = {
358
+ controls: {
359
+ brb: {
360
+ enabled: true,
361
+ },
362
+ },
363
+ };
364
+
365
+ assert.isTrue(MemberUtil.isBrb(participant));
366
+ });
367
+
368
+ it('returns false when brb is disabled', () => {
369
+ const participant = {
370
+ controls: {
371
+ brb: {
372
+ enabled: false,
373
+ },
374
+ },
375
+ };
376
+
377
+ assert.isFalse(MemberUtil.isBrb(participant));
378
+ });
379
+
380
+
381
+ it('returns false when brb is not present', () => {
382
+ const participant = {
383
+ controls: {},
384
+ };
385
+
386
+ assert.isFalse(MemberUtil.isBrb(participant));
387
+ });
388
+
389
+ it('returns false when controls is not present', () => {
390
+ const participant = {};
391
+
392
+ assert.isFalse(MemberUtil.isBrb(participant));
393
+ });
394
+ });
395
+
355
396
  describe('MemberUtil.isBreakoutsSupported', () => {
356
- it('throws error when there is no participant', () => {
397
+ it('throws an error when there is no participant', () => {
357
398
  assert.throws(() => {
358
399
  MemberUtil.isBreakoutsSupported();
359
400
  }, 'Breakout support could not be processed, participant is undefined.');
@@ -377,7 +418,7 @@ describe('plugin-meetings', () => {
377
418
  });
378
419
 
379
420
  describe('MemberUtil.isLiveAnnotationSupported', () => {
380
- it('throws error when there is no participant', () => {
421
+ it('throws an error when there is no participant', () => {
381
422
  assert.throws(() => {
382
423
  MemberUtil.isLiveAnnotationSupported();
383
424
  }, 'LiveAnnotation support could not be processed, participant is undefined.');
@@ -401,7 +442,7 @@ describe('plugin-meetings', () => {
401
442
  });
402
443
 
403
444
  describe('MemberUtil.isInterpretationSupported', () => {
404
- it('throws error when there is no participant', () => {
445
+ it('throws an error when there is no participant', () => {
405
446
  assert.throws(() => {
406
447
  MemberUtil.isInterpretationSupported();
407
448
  }, 'Interpretation support could not be processed, participant is undefined.');
@@ -432,7 +473,7 @@ describe('plugin-meetings', () => {
432
473
  };
433
474
 
434
475
  describe('MemberUtil.isAudioMuted', () => {
435
- it('throws error when there is no participant', () => {
476
+ it('throws an error when there is no participant', () => {
436
477
  assert.throws(() => {
437
478
  MemberUtil.isAudioMuted();
438
479
  }, 'Audio could not be processed, participant is undefined.');
@@ -475,7 +516,7 @@ describe('plugin-meetings', () => {
475
516
  });
476
517
 
477
518
  describe('MemberUtil.isVideoMuted', () => {
478
- it('throws error when there is no participant', () => {
519
+ it('throws an error when there is no participant', () => {
479
520
  assert.throws(() => {
480
521
  MemberUtil.isVideoMuted();
481
522
  }, 'Video could not be processed, participant is undefined.');
@@ -519,7 +560,7 @@ describe('plugin-meetings', () => {
519
560
  });
520
561
 
521
562
  describe('extractMediaStatus', () => {
522
- it('throws error when there is no participant', () => {
563
+ it('throws an error when there is no participant', () => {
523
564
  assert.throws(() => {
524
565
  MemberUtil.extractMediaStatus()
525
566
  }, 'Media status could not be extracted, participant is undefined.');
@@ -529,7 +570,7 @@ describe('extractMediaStatus', () => {
529
570
  const participant = {
530
571
  status: {}
531
572
  };
532
-
573
+
533
574
  const mediaStatus = MemberUtil.extractMediaStatus(participant)
534
575
 
535
576
  assert.deepEqual(mediaStatus, {audio: undefined, video: undefined});
@@ -542,7 +583,7 @@ describe('extractMediaStatus', () => {
542
583
  videoStatus: 'SENDRECV'
543
584
  }
544
585
  };
545
-
586
+
546
587
  const mediaStatus = MemberUtil.extractMediaStatus(participant)
547
588
 
548
589
  assert.deepEqual(mediaStatus, {audio: 'RECVONLY', video: 'SENDRECV'});