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

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 +46 -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,43 @@ 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
+
355
390
  describe('MemberUtil.isBreakoutsSupported', () => {
356
- it('throws error when there is no participant', () => {
391
+ it('throws an error when there is no participant', () => {
357
392
  assert.throws(() => {
358
393
  MemberUtil.isBreakoutsSupported();
359
394
  }, 'Breakout support could not be processed, participant is undefined.');
@@ -377,7 +412,7 @@ describe('plugin-meetings', () => {
377
412
  });
378
413
 
379
414
  describe('MemberUtil.isLiveAnnotationSupported', () => {
380
- it('throws error when there is no participant', () => {
415
+ it('throws an error when there is no participant', () => {
381
416
  assert.throws(() => {
382
417
  MemberUtil.isLiveAnnotationSupported();
383
418
  }, 'LiveAnnotation support could not be processed, participant is undefined.');
@@ -401,7 +436,7 @@ describe('plugin-meetings', () => {
401
436
  });
402
437
 
403
438
  describe('MemberUtil.isInterpretationSupported', () => {
404
- it('throws error when there is no participant', () => {
439
+ it('throws an error when there is no participant', () => {
405
440
  assert.throws(() => {
406
441
  MemberUtil.isInterpretationSupported();
407
442
  }, 'Interpretation support could not be processed, participant is undefined.');
@@ -432,7 +467,7 @@ describe('plugin-meetings', () => {
432
467
  };
433
468
 
434
469
  describe('MemberUtil.isAudioMuted', () => {
435
- it('throws error when there is no participant', () => {
470
+ it('throws an error when there is no participant', () => {
436
471
  assert.throws(() => {
437
472
  MemberUtil.isAudioMuted();
438
473
  }, 'Audio could not be processed, participant is undefined.');
@@ -475,7 +510,7 @@ describe('plugin-meetings', () => {
475
510
  });
476
511
 
477
512
  describe('MemberUtil.isVideoMuted', () => {
478
- it('throws error when there is no participant', () => {
513
+ it('throws an error when there is no participant', () => {
479
514
  assert.throws(() => {
480
515
  MemberUtil.isVideoMuted();
481
516
  }, 'Video could not be processed, participant is undefined.');
@@ -519,7 +554,7 @@ describe('plugin-meetings', () => {
519
554
  });
520
555
 
521
556
  describe('extractMediaStatus', () => {
522
- it('throws error when there is no participant', () => {
557
+ it('throws an error when there is no participant', () => {
523
558
  assert.throws(() => {
524
559
  MemberUtil.extractMediaStatus()
525
560
  }, 'Media status could not be extracted, participant is undefined.');
@@ -529,7 +564,7 @@ describe('extractMediaStatus', () => {
529
564
  const participant = {
530
565
  status: {}
531
566
  };
532
-
567
+
533
568
  const mediaStatus = MemberUtil.extractMediaStatus(participant)
534
569
 
535
570
  assert.deepEqual(mediaStatus, {audio: undefined, video: undefined});
@@ -542,7 +577,7 @@ describe('extractMediaStatus', () => {
542
577
  videoStatus: 'SENDRECV'
543
578
  }
544
579
  };
545
-
580
+
546
581
  const mediaStatus = MemberUtil.extractMediaStatus(participant)
547
582
 
548
583
  assert.deepEqual(mediaStatus, {audio: 'RECVONLY', video: 'SENDRECV'});