@webex/plugin-meetings 3.0.0-beta.134 → 3.0.0-beta.136

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.
@@ -97,6 +97,53 @@ describe('RemoteMediaGroup', () => {
97
97
  });
98
98
  });
99
99
 
100
+ describe('setPreferLiveVideo', () => {
101
+ it('updates prefer live video', () => {
102
+
103
+ const group = new RemoteMediaGroup(fakeMediaRequestManager, fakeReceiveSlots, 255, true, {
104
+ resolution: 'medium',
105
+ preferLiveVideo: false,
106
+ });
107
+ fakeMediaRequestManager.addRequest.resetHistory();
108
+ group.setPreferLiveVideo(true, false);
109
+
110
+ assert.calledOnce(fakeMediaRequestManager.cancelRequest);
111
+
112
+ assert.calledOnce(fakeMediaRequestManager.addRequest);
113
+
114
+ assert.calledWith(
115
+ fakeMediaRequestManager.addRequest,
116
+ sinon.match({
117
+ policyInfo: sinon.match({
118
+ policy: 'active-speaker',
119
+ priority: 255,
120
+ preferLiveVideo: true
121
+ }),
122
+ receiveSlots: fakeReceiveSlots,
123
+ codecInfo: sinon.match({
124
+ codec: 'h264',
125
+ maxFs: 3600,
126
+ }),
127
+ }),
128
+ false,
129
+ );
130
+ });
131
+
132
+ it('does not call add request when prefer live video has not changed', () => {
133
+ const group = new RemoteMediaGroup(fakeMediaRequestManager, fakeReceiveSlots, 255, true, {
134
+ resolution: 'medium',
135
+ preferLiveVideo: true,
136
+ });
137
+ fakeMediaRequestManager.addRequest.resetHistory();
138
+ group.setPreferLiveVideo(true, false);
139
+
140
+ assert.notCalled(fakeMediaRequestManager.cancelRequest);
141
+
142
+ assert.notCalled(fakeMediaRequestManager.addRequest);
143
+ });
144
+
145
+ });
146
+
100
147
  describe('pinning', () => {
101
148
  it('works as expected', () => {
102
149
  const PINNED_INDEX = 2;
@@ -663,6 +663,42 @@ describe('RemoteMediaManager', () => {
663
663
  remoteMediaManager.stop();
664
664
  });
665
665
  });
666
+
667
+ describe('setPreferLiveVideo', () => {
668
+
669
+ it('sets preferLiveVideo', async () => {
670
+ const config = cloneDeep(DefaultTestConfiguration);
671
+ let stubs = [];
672
+
673
+ config.video.initialLayoutId = 'OnePlusFive';
674
+
675
+ remoteMediaManager = new RemoteMediaManager(
676
+ fakeReceiveSlotManager,
677
+ fakeMediaRequestManagers,
678
+ config
679
+ );
680
+
681
+ remoteMediaManager.on(Event.VideoLayoutChanged, (layoutInfo: VideoLayoutChangedEventData) => {
682
+ console.log(layoutInfo.activeSpeakerVideoPanes);
683
+ Object.values(layoutInfo.activeSpeakerVideoPanes).forEach((group) => stubs.push(sinon.stub(group, 'setPreferLiveVideo')));
684
+ });
685
+
686
+ await remoteMediaManager.start();
687
+ resetHistory();
688
+ assert(stubs.length > 0);
689
+ await remoteMediaManager.setPreferLiveVideo(true);
690
+
691
+
692
+ stubs.forEach((stub) => {
693
+ assert.calledWith(stub, true, false)
694
+ });
695
+
696
+ expect(config.video.preferLiveVideo).to.equal(true);
697
+
698
+ assert.calledOnce(fakeMediaRequestManagers.video.commit);
699
+ });
700
+ });
701
+
666
702
  describe('setLayout', () => {
667
703
  it('rejects if called with invalid layoutId', async () => {
668
704
  await assert.isRejected(remoteMediaManager.setLayout('invalid value'));