@webex/plugin-meetings 3.0.0-beta.397 → 3.0.0-beta.398

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.
@@ -432,11 +432,11 @@ skipInNode(describe)('plugin-meetings', () => {
432
432
  {scope: bob.meeting.members, event: 'members:update', match: checkEvent},
433
433
  ]);
434
434
 
435
- localStreams.alice.microphone.setMuted(true);
435
+ localStreams.alice.microphone.setUserMuted(true);
436
436
 
437
437
  await membersUpdate;
438
438
 
439
- assert.equal(localStreams.alice.microphone.muted, true);
439
+ assert.equal(localStreams.alice.microphone.userMuted, true);
440
440
  });
441
441
 
442
442
  it('alice Audio unMute ', async () => {
@@ -451,11 +451,11 @@ skipInNode(describe)('plugin-meetings', () => {
451
451
  {scope: bob.meeting.members, event: 'members:update', match: checkEvent},
452
452
  ]);
453
453
 
454
- localStreams.alice.microphone.setMuted(false);
454
+ localStreams.alice.microphone.setUserMuted(false);
455
455
 
456
456
  await membersUpdate;
457
457
 
458
- assert.equal(localStreams.alice.microphone.muted, false);
458
+ assert.equal(localStreams.alice.microphone.userMuted, false);
459
459
  });
460
460
 
461
461
  it('alice video mute', async () => {
@@ -470,11 +470,11 @@ skipInNode(describe)('plugin-meetings', () => {
470
470
  {scope: bob.meeting.members, event: 'members:update', match: checkEvent},
471
471
  ]);
472
472
 
473
- localStreams.alice.camera.setMuted(true);
473
+ localStreams.alice.camera.setUserMuted(true);
474
474
 
475
475
  await membersUpdate;
476
476
 
477
- assert.equal(localStreams.alice.camera.muted, true);
477
+ assert.equal(localStreams.alice.camera.userMuted, true);
478
478
  });
479
479
 
480
480
  it('alice video unmute', async () => {
@@ -489,11 +489,11 @@ skipInNode(describe)('plugin-meetings', () => {
489
489
  {scope: bob.meeting.members, event: 'members:update', match: checkEvent},
490
490
  ]);
491
491
 
492
- localStreams.alice.camera.setMuted(false);
492
+ localStreams.alice.camera.setUserMuted(false);
493
493
 
494
494
  await membersUpdate;
495
495
 
496
- assert.equal(localStreams.alice.camera.muted, false);
496
+ assert.equal(localStreams.alice.camera.userMuted, false);
497
497
  });
498
498
 
499
499
  it('alice update Audio', async () => {
@@ -574,11 +574,11 @@ skipInNode(describe)('plugin-meetings', () => {
574
574
  ]);
575
575
 
576
576
  // first bob mutes himself
577
- localStreams.bob.microphone.setMuted(true);
577
+ localStreams.bob.microphone.setUserMuted(true);
578
578
 
579
579
  await membersUpdate;
580
580
 
581
- assert.equal(localStreams.bob.microphone.muted, true);
581
+ assert.equal(localStreams.bob.microphone.userMuted, true);
582
582
 
583
583
  // now alice tries to unmmute bob
584
584
  await testUtils.delayedPromise(alice.meeting.mute(bob.meeting.members.selfId, false))
@@ -593,7 +593,7 @@ skipInNode(describe)('plugin-meetings', () => {
593
593
  assert.fail('bob received unexpected meeting:self:unmutedByOthers event');
594
594
  })
595
595
  .catch(() => {
596
- assert.equal(localStreams.bob.microphone.muted, true);
596
+ assert.equal(localStreams.bob.microphone.userMuted, true);
597
597
  });
598
598
  });
599
599
 
@@ -607,11 +607,11 @@ skipInNode(describe)('plugin-meetings', () => {
607
607
  {scope: alice.meeting.members, event: 'members:update', match: checkEvent},
608
608
  ]);
609
609
 
610
- localStreams.bob.microphone.setMuted(false);
610
+ localStreams.bob.microphone.setUserMuted(false);
611
611
 
612
612
  await membersUpdate;
613
613
 
614
- assert.equal(localStreams.bob.microphone.muted, false);
614
+ assert.equal(localStreams.bob.microphone.userMuted, false);
615
615
  });
616
616
 
617
617
  it('alice shares the screen with highFrameRate', async () => {
@@ -43,7 +43,7 @@ import {
43
43
  RemoteTrackType,
44
44
  MediaType,
45
45
  } from '@webex/internal-media-core';
46
- import {StreamEventNames} from '@webex/media-helpers';
46
+ import {LocalStreamEventNames} from '@webex/media-helpers';
47
47
  import * as StatsAnalyzerModule from '@webex/plugin-meetings/src/statsAnalyzer';
48
48
  import EventsScope from '@webex/plugin-meetings/src/common/events/events-scope';
49
49
  import Meetings, {CONSTANTS} from '@webex/plugin-meetings';
@@ -1548,7 +1548,6 @@ describe('plugin-meetings', () => {
1548
1548
  describe('#addMedia', () => {
1549
1549
  const muteStateStub = {
1550
1550
  handleClientRequest: sinon.stub().returns(Promise.resolve(true)),
1551
- applyClientStateLocally: sinon.stub().returns(Promise.resolve(true)),
1552
1551
  };
1553
1552
 
1554
1553
  let fakeMediaConnection;
@@ -3028,9 +3027,13 @@ describe('plugin-meetings', () => {
3028
3027
  getSettings: sinon.stub().returns({
3029
3028
  deviceId: 'some device id',
3030
3029
  }),
3031
- muted: false,
3030
+ userMuted: false,
3031
+ systemMuted: false,
3032
+ get muted() {
3033
+ return this.userMuted || this.systemMuted;
3034
+ },
3032
3035
  setUnmuteAllowed: sinon.stub(),
3033
- setMuted: sinon.stub(),
3036
+ setUserMuted: sinon.stub(),
3034
3037
  setServerMuted: sinon.stub(),
3035
3038
  outputStream: {
3036
3039
  getTracks: () => {
@@ -3314,7 +3317,7 @@ describe('plugin-meetings', () => {
3314
3317
  }
3315
3318
  };
3316
3319
 
3317
- it('addMedia() works correctly when media is enabled without tracks to publish', async () => {
3320
+ it('addMedia() works correctly when media is enabled without streams to publish', async () => {
3318
3321
  await meeting.addMedia();
3319
3322
  await simulateRoapOffer();
3320
3323
  await simulateRoapOk();
@@ -3380,8 +3383,42 @@ describe('plugin-meetings', () => {
3380
3383
  assert.calledTwice(locusMediaRequestStub);
3381
3384
  });
3382
3385
 
3383
- it('addMedia() works correctly when media is enabled with tracks to publish and track is muted', async () => {
3384
- fakeMicrophoneStream.muted = true;
3386
+ it('addMedia() works correctly when media is enabled with streams to publish and stream is user muted', async () => {
3387
+ fakeMicrophoneStream.userMuted = true;
3388
+
3389
+ await meeting.addMedia({localStreams: {microphone: fakeMicrophoneStream}});
3390
+ await simulateRoapOffer();
3391
+ await simulateRoapOk();
3392
+
3393
+ // check RoapMediaConnection was created correctly
3394
+ checkMediaConnectionCreated({
3395
+ mediaConnectionConfig: expectedMediaConnectionConfig,
3396
+ localStreams: {
3397
+ audio: fakeMicrophoneStream,
3398
+ video: undefined,
3399
+ screenShareVideo: undefined,
3400
+ screenShareAudio: undefined,
3401
+ },
3402
+ direction: {
3403
+ audio: 'sendrecv',
3404
+ video: 'sendrecv',
3405
+ screenShare: 'recvonly',
3406
+ },
3407
+ remoteQualityLevel: 'HIGH',
3408
+ expectedDebugId,
3409
+ meetingId: meeting.id,
3410
+ });
3411
+ // and SDP offer was sent with the right audioMuted/videoMuted values
3412
+ checkSdpOfferSent({audioMuted: true, videoMuted: true});
3413
+ // check OK was sent with the right audioMuted/videoMuted values
3414
+ checkOkSent({audioMuted: true, videoMuted: true});
3415
+
3416
+ // and that these were the only /media requests that were sent
3417
+ assert.calledTwice(locusMediaRequestStub);
3418
+ });
3419
+
3420
+ it('addMedia() works correctly when media is enabled with streams to publish and stream is system muted', async () => {
3421
+ fakeMicrophoneStream.systemMuted = true;
3385
3422
 
3386
3423
  await meeting.addMedia({localStreams: {microphone: fakeMicrophoneStream}});
3387
3424
  await simulateRoapOffer();
@@ -3414,7 +3451,7 @@ describe('plugin-meetings', () => {
3414
3451
  assert.calledTwice(locusMediaRequestStub);
3415
3452
  });
3416
3453
 
3417
- it('addMedia() works correctly when media is disabled with tracks to publish', async () => {
3454
+ it('addMedia() works correctly when media is disabled with streams to publish', async () => {
3418
3455
  await meeting.addMedia({
3419
3456
  localStreams: {microphone: fakeMicrophoneStream},
3420
3457
  audioEnabled: false,
@@ -3450,7 +3487,7 @@ describe('plugin-meetings', () => {
3450
3487
  assert.calledTwice(locusMediaRequestStub);
3451
3488
  });
3452
3489
 
3453
- it('addMedia() works correctly when media is disabled with no tracks to publish', async () => {
3490
+ it('addMedia() works correctly when media is disabled with no streams to publish', async () => {
3454
3491
  await meeting.addMedia({audioEnabled: false});
3455
3492
  await simulateRoapOffer();
3456
3493
  await simulateRoapOk();
@@ -3483,7 +3520,7 @@ describe('plugin-meetings', () => {
3483
3520
  assert.calledTwice(locusMediaRequestStub);
3484
3521
  });
3485
3522
 
3486
- it('addMedia() works correctly when video is disabled with no tracks to publish', async () => {
3523
+ it('addMedia() works correctly when video is disabled with no streams to publish', async () => {
3487
3524
  await meeting.addMedia({videoEnabled: false});
3488
3525
  await simulateRoapOffer();
3489
3526
  await simulateRoapOk();
@@ -3516,7 +3553,7 @@ describe('plugin-meetings', () => {
3516
3553
  assert.calledTwice(locusMediaRequestStub);
3517
3554
  });
3518
3555
 
3519
- it('addMedia() works correctly when screen share is disabled with no tracks to publish', async () => {
3556
+ it('addMedia() works correctly when screen share is disabled with no streams to publish', async () => {
3520
3557
  await meeting.addMedia({shareAudioEnabled: false, shareVideoEnabled: false});
3521
3558
  await simulateRoapOffer();
3522
3559
  await simulateRoapOk();
@@ -3617,9 +3654,13 @@ describe('plugin-meetings', () => {
3617
3654
  const fakeMicrophoneStream2 = {
3618
3655
  on: sinon.stub(),
3619
3656
  off: sinon.stub(),
3620
- muted: false,
3657
+ userMuted: false,
3658
+ systemMuted: false,
3659
+ get muted() {
3660
+ return this.userMuted || this.systemMuted;
3661
+ },
3621
3662
  setUnmuteAllowed: sinon.stub(),
3622
- setMuted: sinon.stub(),
3663
+ setUserMuted: sinon.stub(),
3623
3664
  outputStream: {
3624
3665
  getTracks: () => {
3625
3666
  return [
@@ -3856,12 +3897,55 @@ describe('plugin-meetings', () => {
3856
3897
  });
3857
3898
 
3858
3899
  [
3859
- {mute: true, title: 'muting a track before confluence is created'},
3860
- {mute: false, title: 'unmuting a track before confluence is created'},
3900
+ {mute: true, title: 'user muting a track before confluence is created'},
3901
+ {mute: false, title: 'user unmuting a track before confluence is created'},
3902
+ ].forEach(({mute, title}) =>
3903
+ it(title, async () => {
3904
+ // initialize the microphone mute state to opposite of what we do in the test
3905
+ fakeMicrophoneStream.userMuted = !mute;
3906
+
3907
+ await meeting.addMedia({localStreams: {microphone: fakeMicrophoneStream}});
3908
+ await stableState();
3909
+
3910
+ resetHistory();
3911
+
3912
+ assert.equal(
3913
+ fakeMicrophoneStream.on.getCall(0).args[0],
3914
+ LocalStreamEventNames.UserMuteStateChange
3915
+ );
3916
+ const mutedListener = fakeMicrophoneStream.on.getCall(0).args[1];
3917
+ // simulate track being muted
3918
+ fakeMicrophoneStream.userMuted = mute;
3919
+ mutedListener(mute);
3920
+
3921
+ await stableState();
3922
+
3923
+ // nothing should happen
3924
+ assert.notCalled(locusMediaRequestStub);
3925
+ assert.notCalled(fakeRoapMediaConnection.update);
3926
+
3927
+ // now simulate roap offer and ok
3928
+ await simulateRoapOffer();
3929
+ await simulateRoapOk();
3930
+
3931
+ // it should be sent with the right mute status
3932
+ checkSdpOfferSent({audioMuted: mute, videoMuted: true});
3933
+ // check OK was sent with the right audioMuted/videoMuted values
3934
+ checkOkSent({audioMuted: mute, videoMuted: true});
3935
+
3936
+ // nothing else should happen
3937
+ assert.calledTwice(locusMediaRequestStub);
3938
+ assert.notCalled(fakeRoapMediaConnection.update);
3939
+ })
3940
+ );
3941
+
3942
+ [
3943
+ {mute: true, title: 'system muting a track before confluence is created'},
3944
+ {mute: false, title: 'system unmuting a track before confluence is created'},
3861
3945
  ].forEach(({mute, title}) =>
3862
3946
  it(title, async () => {
3863
3947
  // initialize the microphone mute state to opposite of what we do in the test
3864
- fakeMicrophoneStream.muted = !mute;
3948
+ fakeMicrophoneStream.systemMuted = !mute;
3865
3949
 
3866
3950
  await meeting.addMedia({localStreams: {microphone: fakeMicrophoneStream}});
3867
3951
  await stableState();
@@ -3870,10 +3954,11 @@ describe('plugin-meetings', () => {
3870
3954
 
3871
3955
  assert.equal(
3872
3956
  fakeMicrophoneStream.on.getCall(0).args[0],
3873
- StreamEventNames.MuteStateChange
3957
+ LocalStreamEventNames.UserMuteStateChange
3874
3958
  );
3875
3959
  const mutedListener = fakeMicrophoneStream.on.getCall(0).args[1];
3876
3960
  // simulate track being muted
3961
+ fakeMicrophoneStream.systemMuted = mute;
3877
3962
  mutedListener(mute);
3878
3963
 
3879
3964
  await stableState();
@@ -6408,11 +6493,11 @@ describe('plugin-meetings', () => {
6408
6493
  meeting.sendSlotManager.setNamedMediaGroups = sinon.stub().returns(undefined);
6409
6494
  });
6410
6495
  it('should throw error if not audio type', () => {
6411
- expect(() => meeting.setSendNamedMediaGroup(MediaType.VideoMain, 20)).to.throw(`cannot set send named media group which media type is ${MediaType.VideoMain}`)
6412
-
6496
+ expect(() => meeting.setSendNamedMediaGroup(MediaType.VideoMain, 20)).to.throw(
6497
+ `cannot set send named media group which media type is ${MediaType.VideoMain}`
6498
+ );
6413
6499
  });
6414
6500
  it('fails if there is no media connection', () => {
6415
-
6416
6501
  meeting.mediaProperties.webrtcMediaConnection = undefined;
6417
6502
  meeting.setSendNamedMediaGroup('AUDIO-MAIN', 20);
6418
6503
  assert.notCalled(meeting.sendSlotManager.setNamedMediaGroups);
@@ -6421,8 +6506,10 @@ describe('plugin-meetings', () => {
6421
6506
  it('success if there is media connection', () => {
6422
6507
  meeting.isMultistream = true;
6423
6508
  meeting.mediaProperties.webrtcMediaConnection = true;
6424
- meeting.setSendNamedMediaGroup("AUDIO-MAIN", 20);
6425
- assert.calledOnceWithExactly(meeting.sendSlotManager.setNamedMediaGroups, "AUDIO-MAIN", [{type: 1, value: 20}]);
6509
+ meeting.setSendNamedMediaGroup('AUDIO-MAIN', 20);
6510
+ assert.calledOnceWithExactly(meeting.sendSlotManager.setNamedMediaGroups, 'AUDIO-MAIN', [
6511
+ {type: 1, value: 20},
6512
+ ]);
6426
6513
  });
6427
6514
  });
6428
6515