@webex/plugin-meetings 3.0.0-beta.250 → 3.0.0-beta.252

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 (65) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/constants.js +3 -1
  4. package/dist/constants.js.map +1 -1
  5. package/dist/index.js +30 -24
  6. package/dist/index.js.map +1 -1
  7. package/dist/interpretation/index.js +1 -1
  8. package/dist/interpretation/siLanguage.js +1 -1
  9. package/dist/media/index.js +18 -19
  10. package/dist/media/index.js.map +1 -1
  11. package/dist/media/properties.js +52 -52
  12. package/dist/media/properties.js.map +1 -1
  13. package/dist/meeting/index.js +417 -372
  14. package/dist/meeting/index.js.map +1 -1
  15. package/dist/meeting/muteState.js +39 -38
  16. package/dist/meeting/muteState.js.map +1 -1
  17. package/dist/meeting/util.js +9 -9
  18. package/dist/meeting/util.js.map +1 -1
  19. package/dist/meeting-info/index.js +45 -23
  20. package/dist/meeting-info/index.js.map +1 -1
  21. package/dist/meeting-info/meeting-info-v2.js +22 -4
  22. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  23. package/dist/meetings/index.js +4 -2
  24. package/dist/meetings/index.js.map +1 -1
  25. package/dist/multistream/sendSlotManager.js +233 -0
  26. package/dist/multistream/sendSlotManager.js.map +1 -0
  27. package/dist/reconnection-manager/index.js +10 -10
  28. package/dist/reconnection-manager/index.js.map +1 -1
  29. package/dist/types/constants.d.ts +2 -0
  30. package/dist/types/index.d.ts +1 -1
  31. package/dist/types/media/index.d.ts +2 -2
  32. package/dist/types/media/properties.d.ts +24 -24
  33. package/dist/types/meeting/index.d.ts +61 -51
  34. package/dist/types/meeting/muteState.d.ts +16 -16
  35. package/dist/types/meeting/util.d.ts +2 -2
  36. package/dist/types/meeting-info/index.d.ts +7 -0
  37. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  38. package/dist/types/multistream/sendSlotManager.d.ts +61 -0
  39. package/dist/types/reconnection-manager/index.d.ts +2 -2
  40. package/package.json +20 -20
  41. package/src/constants.ts +2 -0
  42. package/src/index.ts +14 -13
  43. package/src/media/index.ts +32 -34
  44. package/src/media/properties.ts +47 -46
  45. package/src/meeting/index.ts +402 -331
  46. package/src/meeting/muteState.ts +35 -34
  47. package/src/meeting/util.ts +11 -10
  48. package/src/meeting-info/index.ts +45 -20
  49. package/src/meeting-info/meeting-info-v2.ts +25 -5
  50. package/src/meetings/index.ts +9 -2
  51. package/src/multistream/sendSlotManager.ts +170 -0
  52. package/src/reconnection-manager/index.ts +8 -8
  53. package/test/integration/spec/converged-space-meetings.js +7 -7
  54. package/test/integration/spec/journey.js +85 -103
  55. package/test/integration/spec/space-meeting.js +9 -9
  56. package/test/unit/spec/media/index.ts +23 -66
  57. package/test/unit/spec/meeting/index.js +786 -848
  58. package/test/unit/spec/meeting/muteState.js +113 -75
  59. package/test/unit/spec/meeting/utils.js +14 -16
  60. package/test/unit/spec/meeting-info/index.js +173 -61
  61. package/test/unit/spec/meeting-info/meetinginfov2.js +186 -52
  62. package/test/unit/spec/meetings/index.js +6 -5
  63. package/test/unit/spec/multistream/sendSlotManager.ts +242 -0
  64. package/test/unit/spec/reconnection-manager/index.js +4 -3
  65. package/test/utils/integrationTestUtils.js +4 -4
@@ -0,0 +1,242 @@
1
+ import SendSlotManager from '@webex/plugin-meetings/src/multistream/sendSlotManager';
2
+ import { LocalStream, MediaType, MultistreamRoapMediaConnection } from "@webex/internal-media-core";
3
+ import {expect} from '@webex/test-helper-chai';
4
+ import sinon from 'sinon';
5
+
6
+ describe('SendSlotsManager', () => {
7
+ let sendSlotsManager: SendSlotManager;
8
+ const LoggerProxy = {
9
+ logger: {
10
+ info: sinon.stub(),
11
+ },
12
+ };
13
+
14
+ beforeEach(() => {
15
+ sendSlotsManager = new SendSlotManager(LoggerProxy);
16
+ });
17
+
18
+ describe('createSlot', () => {
19
+ let mediaConnection;
20
+ const mediaType = MediaType.AudioMain;
21
+
22
+ beforeEach(() => {
23
+ mediaConnection = {
24
+ createSendSlot: sinon.stub(),
25
+ } as MultistreamRoapMediaConnection;
26
+ });
27
+
28
+ it('should create a slot for the given mediaType', () => {
29
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
30
+
31
+ expect(mediaConnection.createSendSlot.calledWith(mediaType, true));
32
+ });
33
+
34
+ it('should create a slot for the given mediaType & active state', () => {
35
+ sendSlotsManager.createSlot(mediaConnection, mediaType, false);
36
+
37
+ expect(mediaConnection.createSendSlot.calledWith(mediaType, false));
38
+ });
39
+
40
+ it('should throw an error if a slot for the given mediaType already exists', () => {
41
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
42
+
43
+ expect(() => sendSlotsManager.createSlot(mediaConnection, mediaType)).to.throw(`Slot for ${mediaType} already exists`);
44
+ });
45
+ });
46
+
47
+ describe('getSlot', () => {
48
+ const mediaType = MediaType.AudioMain;
49
+ let mediaConnection;
50
+
51
+ beforeEach(() => {
52
+ mediaConnection = {
53
+ createSendSlot: sinon.stub().returns({}),
54
+ } as MultistreamRoapMediaConnection;
55
+ });
56
+
57
+ it('should return the slot for the given mediaType', () => {
58
+ const slot = sendSlotsManager.createSlot(mediaConnection,mediaType);
59
+
60
+ expect(sendSlotsManager.getSlot(mediaType)).to.equal(slot);
61
+ });
62
+
63
+ it('should throw an error if a slot for the given mediaType does not exist', () => {
64
+ expect(() => sendSlotsManager.getSlot(mediaType)).to.throw(`Slot for ${mediaType} does not exist`);
65
+ });
66
+ });
67
+
68
+ describe('publishStream', () => {
69
+ let mediaConnection;
70
+ const mediaType = MediaType.AudioMain;
71
+ const stream = {} as LocalStream;
72
+
73
+ beforeEach(() => {
74
+ mediaConnection = {
75
+ createSendSlot: sinon.stub(),
76
+ } as MultistreamRoapMediaConnection;
77
+ });
78
+
79
+ it('should publish the given stream to the sendSlot for the given mediaType', async () => {
80
+ const slot = {
81
+ publishStream: sinon.stub().resolves(),
82
+ };
83
+ mediaConnection.createSendSlot.returns(slot);
84
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
85
+
86
+ await sendSlotsManager.publishStream(mediaType, stream);
87
+
88
+ expect(slot.publishStream.calledWith(stream));
89
+ });
90
+
91
+ it('should throw an error if a slot for the given mediaType does not exist', (done) => {
92
+ sendSlotsManager.publishStream(mediaType, stream).catch((error) => {
93
+ expect(error.message).to.equal(`Slot for ${mediaType} does not exist`);
94
+ done();
95
+ });
96
+ });
97
+ });
98
+
99
+ describe('unpublishStream', () => {
100
+ let mediaConnection;
101
+ const mediaType = MediaType.AudioMain;
102
+
103
+ beforeEach(() => {
104
+ mediaConnection = {
105
+ createSendSlot: sinon.stub(),
106
+ } as MultistreamRoapMediaConnection;
107
+ });
108
+
109
+ it('should unpublish the stream from the sendSlot of the given mediaType', async () => {
110
+ const slot = {
111
+ unpublishStream: sinon.stub().resolves(),
112
+ };
113
+ mediaConnection.createSendSlot.returns(slot);
114
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
115
+
116
+ await sendSlotsManager.unpublishStream(mediaType);
117
+
118
+ expect(slot.unpublishStream.called);
119
+ });
120
+
121
+ it('should throw an error if a slot for the given mediaType does not exist',(done) => {
122
+ sendSlotsManager.unpublishStream(mediaType).catch((error) => {
123
+ expect(error.message).to.equal(`Slot for ${mediaType} does not exist`);
124
+ done();
125
+ });
126
+ });
127
+ });
128
+
129
+ describe('setActive', () => {
130
+ let mediaConnection;
131
+ const mediaType = MediaType.AudioMain;
132
+
133
+ beforeEach(() => {
134
+ mediaConnection = {
135
+ createSendSlot: sinon.stub(),
136
+ } as MultistreamRoapMediaConnection;
137
+ });
138
+
139
+ it('should set the active state of the sendSlot for the given mediaType', async () => {
140
+ const slot = {
141
+ setActive: sinon.stub().resolves(),
142
+ };
143
+ mediaConnection.createSendSlot.returns(slot);
144
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
145
+
146
+ await sendSlotsManager.setActive(mediaType,true);
147
+
148
+ expect(slot.setActive.called);
149
+ });
150
+
151
+ it('should throw an error if a slot for the given mediaType does not exist', () => {
152
+ expect(() => sendSlotsManager.setActive(mediaType)).to.throw(`Slot for ${mediaType} does not exist`)
153
+ });
154
+ });
155
+
156
+ describe('setCodecParameters', () => {
157
+ let mediaConnection;
158
+ const mediaType = MediaType.AudioMain;
159
+ const codecParameters = {};
160
+
161
+ beforeEach(() => {
162
+ mediaConnection = {
163
+ createSendSlot: sinon.stub(),
164
+ } as MultistreamRoapMediaConnection;
165
+ });
166
+
167
+ it('should set the codec parameters of the sendSlot for the given mediaType', async () => {
168
+ const slot = {
169
+ setCodecParameters: sinon.stub().resolves(),
170
+ };
171
+ mediaConnection.createSendSlot.returns(slot);
172
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
173
+
174
+ await sendSlotsManager.setCodecParameters(mediaType, codecParameters);
175
+
176
+ expect(slot.setCodecParameters.calledWith(codecParameters));
177
+ });
178
+
179
+ it('should throw an error if a slot for the given mediaType does not exist', (done) => {
180
+ sendSlotsManager.setCodecParameters(mediaType, codecParameters).catch((error) => {
181
+ expect(error.message).to.equal(`Slot for ${mediaType} does not exist`);
182
+ done();
183
+ });
184
+ });
185
+ });
186
+
187
+ describe('deleteCodecParameters', () => {
188
+ let mediaConnection;
189
+ const mediaType = MediaType.AudioMain;
190
+
191
+ beforeEach(() => {
192
+ mediaConnection = {
193
+ createSendSlot: sinon.stub(),
194
+ } as MultistreamRoapMediaConnection;
195
+ });
196
+
197
+ it('should delete the codec parameters of the sendSlot for the given mediaType', async () => {
198
+ const slot = {
199
+ deleteCodecParameters: sinon.stub().resolves(),
200
+ };
201
+ mediaConnection.createSendSlot.returns(slot);
202
+ sendSlotsManager.createSlot(mediaConnection, mediaType);
203
+
204
+ await sendSlotsManager.deleteCodecParameters(mediaType,[]);
205
+
206
+ expect(slot.deleteCodecParameters.called);
207
+ });
208
+
209
+ it('should throw an error if a slot for the given mediaType does not exist', (done) => {
210
+ sendSlotsManager.deleteCodecParameters(mediaType,[]).catch((error) => {
211
+ expect(error.message).to.equal(`Slot for ${mediaType} does not exist`);
212
+ done();
213
+ });
214
+ });
215
+ });
216
+
217
+ describe('reset', () => {
218
+ let mediaConnection;
219
+
220
+ beforeEach(() => {
221
+ mediaConnection = {
222
+ createSendSlot: sinon.stub().returns({}),
223
+ } as MultistreamRoapMediaConnection;
224
+ });
225
+
226
+ it('should reset the send slot manager', () => {
227
+ const AudioSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.AudioMain);
228
+ const VideoSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.VideoMain);
229
+ const AudioSlidesSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.AudioSlides);
230
+ const VideoSlidesSlot = sendSlotsManager.createSlot(mediaConnection, MediaType.VideoSlides);
231
+ expect(sendSlotsManager.getSlot(MediaType.AudioMain)).to.equal(AudioSlot);
232
+ expect(sendSlotsManager.getSlot(MediaType.VideoMain)).to.equal(VideoSlot);
233
+ expect(sendSlotsManager.getSlot(MediaType.AudioSlides)).to.equal(AudioSlidesSlot);
234
+ expect(sendSlotsManager.getSlot(MediaType.VideoSlides)).to.equal(VideoSlidesSlot);
235
+ sendSlotsManager.reset();
236
+ expect(() => sendSlotsManager.getSlot(MediaType.AudioMain)).to.throw();
237
+ expect(() => sendSlotsManager.getSlot(MediaType.VideoMain)).to.throw();
238
+ expect(() => sendSlotsManager.getSlot(MediaType.AudioSlides)).to.throw();
239
+ expect(() => sendSlotsManager.getSlot(MediaType.VideoSlides)).to.throw();
240
+ });
241
+ });
242
+ });
@@ -184,7 +184,7 @@ describe('plugin-meetings', () => {
184
184
  * level causes testing errors in CI based around related files. Skipping this here until a solution
185
185
  * to this problem is generated.
186
186
  */
187
- describe.skip('ReconnectionManager', () => {
187
+ describe('ReconnectionManager', () => {
188
188
  let reconnectionManager;
189
189
 
190
190
  beforeEach(() => {
@@ -277,10 +277,11 @@ describe('plugin-meetings', () => {
277
277
  assert.isTrue(reconnectionManager.iceState.disconnected);
278
278
  });
279
279
 
280
- it('should return a promise that rejects after a duration', () => {
280
+ it('should return a promise that rejects after a duration', (done) => {
281
281
  reconnectionManager.iceState.timeoutDuration = 100;
282
282
 
283
- return assert.isRejected(reconnectionManager.waitForIceReconnect());
283
+ assert.isRejected(reconnectionManager.waitForIceReconnect());
284
+ done();
284
285
  });
285
286
 
286
287
  it('should resolve return a resolved promise when triggered', () => {
@@ -6,7 +6,7 @@ const addMedia = async (user, options = {}) => {
6
6
  const {microphone, camera} = options;
7
7
 
8
8
  if (options.multistream) {
9
- await user.meeting.addMedia({localTracks: {microphone, camera}});
9
+ await user.meeting.addMedia({localStreams: {microphone, camera}});
10
10
  } else {
11
11
  const mediaReadyPromises = Array.isArray(options.expectedMediaReadyTypes)
12
12
  ? options.expectedMediaReadyTypes.reduce((output, expectedMediaReadyType) => {
@@ -31,13 +31,13 @@ const addMedia = async (user, options = {}) => {
31
31
 
32
32
  user.meeting.on('media:ready', mediaReady);
33
33
 
34
- await user.meeting.addMedia({localTracks: {microphone, camera}});
34
+ await user.meeting.addMedia({localStreams: {microphone, camera}});
35
35
  await Promise.all(Object.values(mediaReadyPromises).map((defer) => defer.promise));
36
36
  };
37
37
 
38
38
 
39
- assert.exists(user.meeting.mediaProperties.audioTrack, 'audioTrack not present');
40
- assert.exists(user.meeting.mediaProperties.videoTrack, 'videoTrack not present');
39
+ assert.exists(user.meeting.mediaProperties.audioStream, 'audioStream not present');
40
+ assert.exists(user.meeting.mediaProperties.videoStream, 'videoStream not present');
41
41
 
42
42
  };
43
43