@webex/plugin-meetings 3.0.0-beta.1 → 3.0.0-beta.11

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 (281) hide show
  1. package/dist/common/browser-detection.js.map +1 -1
  2. package/dist/common/collection.js.map +1 -1
  3. package/dist/common/config.js.map +1 -1
  4. package/dist/common/errors/captcha-error.js +7 -0
  5. package/dist/common/errors/captcha-error.js.map +1 -1
  6. package/dist/common/errors/intent-to-join.js +8 -0
  7. package/dist/common/errors/intent-to-join.js.map +1 -1
  8. package/dist/common/errors/join-meeting.js +8 -0
  9. package/dist/common/errors/join-meeting.js.map +1 -1
  10. package/dist/common/errors/media.js +7 -0
  11. package/dist/common/errors/media.js.map +1 -1
  12. package/dist/common/errors/parameter.js.map +1 -1
  13. package/dist/common/errors/password-error.js +7 -0
  14. package/dist/common/errors/password-error.js.map +1 -1
  15. package/dist/common/errors/permission.js +7 -0
  16. package/dist/common/errors/permission.js.map +1 -1
  17. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  18. package/dist/common/errors/reconnection.js +7 -0
  19. package/dist/common/errors/reconnection.js.map +1 -1
  20. package/dist/common/errors/stats.js +7 -0
  21. package/dist/common/errors/stats.js.map +1 -1
  22. package/dist/common/errors/webex-errors.js +5 -29
  23. package/dist/common/errors/webex-errors.js.map +1 -1
  24. package/dist/common/errors/webex-meetings-error.js +5 -2
  25. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  26. package/dist/common/events/events-scope.js.map +1 -1
  27. package/dist/common/events/events.js.map +1 -1
  28. package/dist/common/events/trigger-proxy.js.map +1 -1
  29. package/dist/common/events/util.js.map +1 -1
  30. package/dist/common/logs/logger-config.js.map +1 -1
  31. package/dist/common/logs/logger-proxy.js.map +1 -1
  32. package/dist/common/logs/request.js +3 -0
  33. package/dist/common/logs/request.js.map +1 -1
  34. package/dist/common/queue.js.map +1 -1
  35. package/dist/config.js +1 -0
  36. package/dist/config.js.map +1 -1
  37. package/dist/constants.js +15 -74
  38. package/dist/constants.js.map +1 -1
  39. package/dist/locus-info/controlsUtils.js.map +1 -1
  40. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  41. package/dist/locus-info/fullState.js.map +1 -1
  42. package/dist/locus-info/hostUtils.js.map +1 -1
  43. package/dist/locus-info/index.js +43 -5
  44. package/dist/locus-info/index.js.map +1 -1
  45. package/dist/locus-info/infoUtils.js +4 -0
  46. package/dist/locus-info/infoUtils.js.map +1 -1
  47. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  48. package/dist/locus-info/parser.js +12 -3
  49. package/dist/locus-info/parser.js.map +1 -1
  50. package/dist/locus-info/selfUtils.js.map +1 -1
  51. package/dist/media/index.js +71 -210
  52. package/dist/media/index.js.map +1 -1
  53. package/dist/media/internal-media-core-wrapper.js +22 -0
  54. package/dist/media/internal-media-core-wrapper.js.map +1 -0
  55. package/dist/media/properties.js +32 -25
  56. package/dist/media/properties.js.map +1 -1
  57. package/dist/media/util.js +0 -27
  58. package/dist/media/util.js.map +1 -1
  59. package/dist/mediaQualityMetrics/config.js.map +1 -1
  60. package/dist/meeting/effectsState.js +8 -1
  61. package/dist/meeting/effectsState.js.map +1 -1
  62. package/dist/meeting/index.js +1146 -602
  63. package/dist/meeting/index.js.map +1 -1
  64. package/dist/meeting/muteState.js +6 -0
  65. package/dist/meeting/muteState.js.map +1 -1
  66. package/dist/meeting/request.js +83 -24
  67. package/dist/meeting/request.js.map +1 -1
  68. package/dist/meeting/state.js.map +1 -1
  69. package/dist/meeting/util.js +5 -44
  70. package/dist/meeting/util.js.map +1 -1
  71. package/dist/meeting-info/collection.js +4 -1
  72. package/dist/meeting-info/collection.js.map +1 -1
  73. package/dist/meeting-info/index.js +5 -0
  74. package/dist/meeting-info/index.js.map +1 -1
  75. package/dist/meeting-info/meeting-info-v2.js +14 -2
  76. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  77. package/dist/meeting-info/request.js +3 -0
  78. package/dist/meeting-info/request.js.map +1 -1
  79. package/dist/meeting-info/util.js.map +1 -1
  80. package/dist/meeting-info/utilv2.js.map +1 -1
  81. package/dist/meetings/collection.js +4 -1
  82. package/dist/meetings/collection.js.map +1 -1
  83. package/dist/meetings/index.js +136 -25
  84. package/dist/meetings/index.js.map +1 -1
  85. package/dist/meetings/request.js +4 -0
  86. package/dist/meetings/request.js.map +1 -1
  87. package/dist/meetings/util.js +24 -1
  88. package/dist/meetings/util.js.map +1 -1
  89. package/dist/member/index.js +30 -7
  90. package/dist/member/index.js.map +1 -1
  91. package/dist/member/util.js +2 -1
  92. package/dist/member/util.js.map +1 -1
  93. package/dist/members/collection.js +1 -0
  94. package/dist/members/collection.js.map +1 -1
  95. package/dist/members/index.js +82 -1
  96. package/dist/members/index.js.map +1 -1
  97. package/dist/members/request.js +19 -9
  98. package/dist/members/request.js.map +1 -1
  99. package/dist/members/util.js.map +1 -1
  100. package/dist/metrics/config.js.map +1 -1
  101. package/dist/metrics/constants.js.map +1 -1
  102. package/dist/metrics/index.js +8 -0
  103. package/dist/metrics/index.js.map +1 -1
  104. package/dist/multistream/mediaRequestManager.js +133 -0
  105. package/dist/multistream/mediaRequestManager.js.map +1 -0
  106. package/dist/multistream/multistreamMedia.js +116 -0
  107. package/dist/multistream/multistreamMedia.js.map +1 -0
  108. package/dist/multistream/receiveSlot.js +209 -0
  109. package/dist/multistream/receiveSlot.js.map +1 -0
  110. package/dist/multistream/receiveSlotManager.js +195 -0
  111. package/dist/multistream/receiveSlotManager.js.map +1 -0
  112. package/dist/multistream/remoteMedia.js +289 -0
  113. package/dist/multistream/remoteMedia.js.map +1 -0
  114. package/dist/multistream/remoteMediaGroup.js +243 -0
  115. package/dist/multistream/remoteMediaGroup.js.map +1 -0
  116. package/dist/multistream/remoteMediaManager.js +1113 -0
  117. package/dist/multistream/remoteMediaManager.js.map +1 -0
  118. package/dist/networkQualityMonitor/index.js +10 -2
  119. package/dist/networkQualityMonitor/index.js.map +1 -1
  120. package/dist/personal-meeting-room/index.js +11 -0
  121. package/dist/personal-meeting-room/index.js.map +1 -1
  122. package/dist/personal-meeting-room/request.js +2 -1
  123. package/dist/personal-meeting-room/request.js.map +1 -1
  124. package/dist/personal-meeting-room/util.js.map +1 -1
  125. package/dist/reachability/index.js +17 -7
  126. package/dist/reachability/index.js.map +1 -1
  127. package/dist/reachability/request.js +1 -0
  128. package/dist/reachability/request.js.map +1 -1
  129. package/dist/reactions/reactions.js +111 -0
  130. package/dist/reactions/reactions.js.map +1 -0
  131. package/dist/reactions/reactions.type.js +40 -0
  132. package/dist/reactions/reactions.type.js.map +1 -0
  133. package/dist/reconnection-manager/index.js +130 -132
  134. package/dist/reconnection-manager/index.js.map +1 -1
  135. package/dist/roap/index.js +58 -231
  136. package/dist/roap/index.js.map +1 -1
  137. package/dist/roap/request.js +7 -116
  138. package/dist/roap/request.js.map +1 -1
  139. package/dist/roap/turnDiscovery.js +20 -6
  140. package/dist/roap/turnDiscovery.js.map +1 -1
  141. package/dist/statsAnalyzer/global.js +2 -0
  142. package/dist/statsAnalyzer/global.js.map +1 -1
  143. package/dist/statsAnalyzer/index.js +58 -37
  144. package/dist/statsAnalyzer/index.js.map +1 -1
  145. package/dist/statsAnalyzer/mqaUtil.js +9 -3
  146. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  147. package/dist/transcription/index.js +10 -3
  148. package/dist/transcription/index.js.map +1 -1
  149. package/package.json +21 -20
  150. package/src/common/{browser-detection.js → browser-detection.ts} +1 -1
  151. package/src/common/collection.ts +6 -6
  152. package/src/common/{config.js → config.ts} +1 -1
  153. package/src/common/errors/{captcha-error.js → captcha-error.ts} +5 -1
  154. package/src/common/errors/{intent-to-join.js → intent-to-join.ts} +6 -1
  155. package/src/common/errors/{join-meeting.js → join-meeting.ts} +6 -1
  156. package/src/common/errors/{media.js → media.ts} +5 -1
  157. package/src/common/errors/parameter.ts +3 -2
  158. package/src/common/errors/{password-error.js → password-error.ts} +5 -1
  159. package/src/common/errors/{permission.js → permission.ts} +5 -1
  160. package/src/common/errors/{reconnection-in-progress.js → reconnection-in-progress.ts} +0 -0
  161. package/src/common/errors/{reconnection.js → reconnection.ts} +5 -1
  162. package/src/common/errors/{stats.js → stats.ts} +5 -1
  163. package/src/common/errors/{webex-errors.js → webex-errors.ts} +1 -20
  164. package/src/common/errors/{webex-meetings-error.js → webex-meetings-error.ts} +3 -1
  165. package/src/common/events/{events-scope.js → events-scope.ts} +1 -1
  166. package/src/common/events/{events.js → events.ts} +0 -0
  167. package/src/common/events/{trigger-proxy.js → trigger-proxy.ts} +1 -2
  168. package/src/common/events/{util.js → util.ts} +1 -1
  169. package/src/common/logs/{logger-config.js → logger-config.ts} +1 -2
  170. package/src/common/logs/{logger-proxy.js → logger-proxy.ts} +1 -1
  171. package/src/common/logs/{request.js → request.ts} +12 -2
  172. package/src/common/queue.ts +1 -2
  173. package/src/{config.js → config.ts} +2 -0
  174. package/src/constants.ts +139 -179
  175. package/src/locus-info/{controlsUtils.js → controlsUtils.ts} +4 -4
  176. package/src/locus-info/{embeddedAppsUtils.js → embeddedAppsUtils.ts} +5 -6
  177. package/src/locus-info/{fullState.js → fullState.ts} +1 -1
  178. package/src/locus-info/{hostUtils.js → hostUtils.ts} +5 -5
  179. package/src/locus-info/{index.js → index.ts} +67 -32
  180. package/src/locus-info/{infoUtils.js → infoUtils.ts} +7 -4
  181. package/src/locus-info/{mediaSharesUtils.js → mediaSharesUtils.ts} +13 -13
  182. package/src/locus-info/{parser.js → parser.ts} +22 -12
  183. package/src/locus-info/{selfUtils.js → selfUtils.ts} +17 -19
  184. package/src/media/{index.js → index.ts} +130 -205
  185. package/src/media/internal-media-core-wrapper.ts +9 -0
  186. package/src/media/{properties.js → properties.ts} +35 -29
  187. package/src/media/util.ts +16 -0
  188. package/src/mediaQualityMetrics/{config.js → config.ts} +1 -1
  189. package/src/meeting/{effectsState.js → effectsState.ts} +12 -6
  190. package/src/meeting/{index.js → index.ts} +993 -474
  191. package/src/meeting/{muteState.js → muteState.ts} +16 -11
  192. package/src/meeting/{request.js → request.ts} +148 -36
  193. package/src/meeting/{state.js → state.ts} +6 -6
  194. package/src/meeting/{util.js → util.ts} +9 -51
  195. package/src/meeting-info/{collection.js → collection.ts} +4 -1
  196. package/src/meeting-info/{index.js → index.ts} +10 -6
  197. package/src/meeting-info/{meeting-info-v2.js → meeting-info-v2.ts} +28 -10
  198. package/src/meeting-info/{request.js → request.ts} +6 -2
  199. package/src/meeting-info/{util.js → util.ts} +6 -5
  200. package/src/meeting-info/{utilv2.js → utilv2.ts} +8 -7
  201. package/src/meetings/{collection.js → collection.ts} +5 -2
  202. package/src/meetings/{index.js → index.ts} +118 -22
  203. package/src/meetings/{request.js → request.ts} +6 -1
  204. package/src/meetings/{util.js → util.ts} +28 -5
  205. package/src/member/{index.js → index.ts} +46 -15
  206. package/src/member/{util.js → util.ts} +17 -16
  207. package/src/members/{collection.js → collection.ts} +2 -1
  208. package/src/members/{index.js → index.ts} +94 -26
  209. package/src/members/{request.js → request.ts} +16 -5
  210. package/src/members/{util.js → util.ts} +7 -7
  211. package/src/metrics/{config.js → config.ts} +0 -2
  212. package/src/metrics/{constants.js → constants.ts} +0 -0
  213. package/src/metrics/{index.js → index.ts} +27 -8
  214. package/src/multistream/mediaRequestManager.ts +166 -0
  215. package/src/multistream/multistreamMedia.ts +92 -0
  216. package/src/multistream/receiveSlot.ts +141 -0
  217. package/src/multistream/receiveSlotManager.ts +142 -0
  218. package/src/multistream/remoteMedia.ts +228 -0
  219. package/src/multistream/remoteMediaGroup.ts +224 -0
  220. package/src/multistream/remoteMediaManager.ts +911 -0
  221. package/src/networkQualityMonitor/{index.js → index.ts} +18 -3
  222. package/src/personal-meeting-room/{index.js → index.ts} +17 -4
  223. package/src/personal-meeting-room/{request.js → request.ts} +3 -1
  224. package/src/personal-meeting-room/{util.js → util.ts} +1 -1
  225. package/src/reachability/{index.js → index.ts} +28 -17
  226. package/src/reachability/request.ts +4 -2
  227. package/src/reactions/reactions.ts +104 -0
  228. package/src/reactions/reactions.type.ts +36 -0
  229. package/src/reconnection-manager/{index.js → index.ts} +81 -65
  230. package/src/roap/index.ts +229 -0
  231. package/src/roap/{request.js → request.ts} +15 -74
  232. package/src/roap/turnDiscovery.ts +26 -11
  233. package/src/statsAnalyzer/{global.js → global.ts} +2 -0
  234. package/src/statsAnalyzer/{index.js → index.ts} +66 -61
  235. package/src/statsAnalyzer/{mqaUtil.js → mqaUtil.ts} +6 -1
  236. package/src/transcription/{index.js → index.ts} +16 -11
  237. package/test/integration/spec/journey.js +1 -1
  238. package/test/integration/spec/space-meeting.js +1 -2
  239. package/test/unit/spec/locus-info/infoUtils.js +17 -1
  240. package/test/unit/spec/media/index.ts +207 -0
  241. package/test/unit/spec/media/properties.ts +73 -82
  242. package/test/unit/spec/meeting/effectsState.js +1 -3
  243. package/test/unit/spec/meeting/index.js +672 -245
  244. package/test/unit/spec/meeting/muteState.js +7 -0
  245. package/test/unit/spec/meeting/request.js +25 -1
  246. package/test/unit/spec/meeting/utils.js +63 -2
  247. package/test/unit/spec/meetings/index.js +0 -4
  248. package/test/unit/spec/members/index.js +164 -2
  249. package/test/unit/spec/multistream/mediaRequestManager.ts +515 -0
  250. package/test/unit/spec/multistream/receiveSlot.ts +104 -0
  251. package/test/unit/spec/multistream/receiveSlotManager.ts +173 -0
  252. package/test/unit/spec/multistream/remoteMedia.ts +225 -0
  253. package/test/unit/spec/multistream/remoteMediaGroup.ts +396 -0
  254. package/test/unit/spec/multistream/remoteMediaManager.ts +1309 -0
  255. package/test/unit/spec/reconnection-manager/index.js +68 -2
  256. package/test/unit/spec/roap/index.ts +63 -35
  257. package/test/unit/spec/stats-analyzer/index.js +19 -22
  258. package/dist/peer-connection-manager/index.js +0 -794
  259. package/dist/peer-connection-manager/index.js.map +0 -1
  260. package/dist/peer-connection-manager/util.js +0 -124
  261. package/dist/peer-connection-manager/util.js.map +0 -1
  262. package/dist/roap/collection.js +0 -73
  263. package/dist/roap/collection.js.map +0 -1
  264. package/dist/roap/handler.js +0 -337
  265. package/dist/roap/handler.js.map +0 -1
  266. package/dist/roap/state.js +0 -164
  267. package/dist/roap/state.js.map +0 -1
  268. package/dist/roap/util.js +0 -102
  269. package/dist/roap/util.js.map +0 -1
  270. package/src/media/util.js +0 -38
  271. package/src/peer-connection-manager/index.js +0 -723
  272. package/src/peer-connection-manager/util.ts +0 -117
  273. package/src/roap/collection.js +0 -63
  274. package/src/roap/handler.js +0 -252
  275. package/src/roap/index.js +0 -380
  276. package/src/roap/state.js +0 -149
  277. package/src/roap/util.js +0 -93
  278. package/test/unit/spec/peerconnection-manager/index.js +0 -188
  279. package/test/unit/spec/peerconnection-manager/utils.js +0 -48
  280. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +0 -389
  281. package/test/unit/spec/roap/util.js +0 -30
@@ -12,6 +12,7 @@ describe('plugin-meetings', () => {
12
12
  let meeting;
13
13
  let audio;
14
14
  let video;
15
+ let originalRemoteUpdateAudioVideo;
15
16
 
16
17
  const fakeLocus = {info: 'this is a fake locus'};
17
18
 
@@ -34,10 +35,16 @@ describe('plugin-meetings', () => {
34
35
  audio = createMuteState(AUDIO, meeting, {sendAudio: true});
35
36
  video = createMuteState(VIDEO, meeting, {sendVideo: true});
36
37
 
38
+ originalRemoteUpdateAudioVideo = MeetingUtil.remoteUpdateAudioVideo;
39
+
37
40
  MeetingUtil.remoteUpdateAudioVideo = sinon.stub().resolves(fakeLocus);
38
41
  Media.setLocalTrack = sinon.stub();
39
42
  });
40
43
 
44
+ afterEach(() => {
45
+ MeetingUtil.remoteUpdateAudioVideo = originalRemoteUpdateAudioVideo;
46
+ });
47
+
41
48
  describe('mute state library', () => {
42
49
  it('does not create an audio instance if we are not sending audio', async () => {
43
50
  assert.isNull(createMuteState(AUDIO, meeting, {sendAudio: false}));
@@ -1,7 +1,6 @@
1
1
  import sinon from 'sinon';
2
2
  import {assert} from '@webex/test-helper-chai';
3
3
  import MockWebex from '@webex/test-helper-mock-webex';
4
-
5
4
  import Meetings from '@webex/plugin-meetings';
6
5
  import MeetingRequest from '@webex/plugin-meetings/src/meeting/request';
7
6
 
@@ -278,5 +277,30 @@ describe('plugin-meetings', () => {
278
277
  assert.equal(requestParams.uri, keepAliveUrl);
279
278
  });
280
279
  });
280
+
281
+ describe('#sendReaction', () => {
282
+ it('sends request to sendReaction', async () => {
283
+ const reactionChannelUrl = 'reactionChannelUrl';
284
+ const participantId = 'participantId';
285
+ const reaction = {
286
+ type: 'thumb_down',
287
+ codepoints: '1F44E',
288
+ shortcodes: ':thumbsdown:',
289
+ tone: {type: 'normal_skin_tone', codepoints: '', shortcodes: ''}
290
+ };
291
+
292
+ await meetingsRequest.sendReaction({
293
+ reactionChannelUrl,
294
+ reaction,
295
+ participantId
296
+ });
297
+ const requestParams = meetingsRequest.request.getCall(0).args[0];
298
+
299
+ assert.equal(requestParams.method, 'POST');
300
+ assert.equal(requestParams.uri, reactionChannelUrl);
301
+ assert.equal(requestParams.body.sender.participantId, participantId);
302
+ assert.equal(requestParams.body.reaction, reaction);
303
+ });
304
+ });
281
305
  });
282
306
  });
@@ -41,8 +41,8 @@ describe('plugin-meetings', () => {
41
41
  meeting.unsetRemoteTracks = sinon.stub();
42
42
  meeting.unsetPeerConnections = sinon.stub();
43
43
  meeting.reconnectionManager = {cleanUp: sinon.stub()};
44
- meeting.roap = {stop: sinon.stub()};
45
44
  meeting.stopKeepAlive = sinon.stub();
45
+ meeting.updateLLMConnection = sinon.stub();
46
46
  });
47
47
 
48
48
  afterEach(() => {
@@ -63,8 +63,8 @@ describe('plugin-meetings', () => {
63
63
  assert.calledOnce(meeting.unsetRemoteTracks);
64
64
  assert.calledOnce(meeting.unsetPeerConnections);
65
65
  assert.calledOnce(meeting.reconnectionManager.cleanUp);
66
- assert.calledOnce(meeting.roap.stop);
67
66
  assert.calledOnce(meeting.stopKeepAlive);
67
+ assert.calledOnce(meeting.updateLLMConnection);
68
68
  });
69
69
  });
70
70
 
@@ -136,6 +136,48 @@ describe('plugin-meetings', () => {
136
136
  });
137
137
  });
138
138
 
139
+ describe('remoteUpdateAudioVideo', () => {
140
+ it('#Should call meetingRequest.remoteAudioVideoToggle with correct parameters (multistream)', async () => {
141
+ const meeting = {
142
+ correlationId: 'correlation id',
143
+ isMultistream: true,
144
+ mediaId: '12345',
145
+ meetingJoinUrl: 'meetingJoinUrl',
146
+ locusUrl: 'locusUrl',
147
+ deviceUrl: 'some device url',
148
+ selfId: 'self id',
149
+ meetingRequest: {remoteAudioVideoToggle: sinon.stub().returns(Promise.resolve({body: {}, headers: {}}))}
150
+ };
151
+
152
+ await MeetingUtil.remoteUpdateAudioVideo(true, false, meeting);
153
+
154
+ assert.calledOnce(meeting.meetingRequest.remoteAudioVideoToggle);
155
+ const parameter = meeting.meetingRequest.remoteAudioVideoToggle.getCall(0).args[0];
156
+
157
+ assert.equal(parameter.locusUrl, 'locusUrl');
158
+ assert.equal(parameter.selfId, 'self id');
159
+ assert.equal(parameter.correlationId, 'correlation id');
160
+ assert.equal(parameter.deviceUrl, 'some device url');
161
+ assert.deepEqual(parameter.localMedias, [{localSdp: '{"audioMuted":true,"videoMuted":false}', mediaId: '12345'}]);
162
+ assert.equal(parameter.preferTranscoding, false);
163
+ });
164
+
165
+ it('#Should call meetingRequest.remoteAudioVideoToggle with preferTranscoding:true for non multistream connections', async () => {
166
+ const meeting = {
167
+ isMultistream: false,
168
+ mediaId: '12345',
169
+ meetingRequest: {remoteAudioVideoToggle: sinon.stub().returns(Promise.resolve({body: {}, headers: {}}))}
170
+ };
171
+
172
+ await MeetingUtil.remoteUpdateAudioVideo(true, false, meeting);
173
+
174
+ assert.calledOnce(meeting.meetingRequest.remoteAudioVideoToggle);
175
+ const parameter = meeting.meetingRequest.remoteAudioVideoToggle.getCall(0).args[0];
176
+
177
+ assert.equal(parameter.preferTranscoding, true);
178
+ });
179
+ });
180
+
139
181
  describe('joinMeeting', () => {
140
182
  it('#Should call `meetingRequest.joinMeeting', async () => {
141
183
  const meeting = {meetingJoinUrl: 'meetingJoinUrl', locusUrl: 'locusUrl', meetingRequest: {joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}}))}};
@@ -147,6 +189,25 @@ describe('plugin-meetings', () => {
147
189
  const parameter = meeting.meetingRequest.joinMeeting.getCall(0).args[0];
148
190
 
149
191
  assert.equal(parameter.inviteeAddress, 'meetingJoinUrl');
192
+ assert.equal(parameter.preferTranscoding, true);
193
+ });
194
+
195
+ it('#Should call meetingRequest.joinMeeting with preferTranscoding=false when multistream is enabled', async () => {
196
+ const meeting = {
197
+ isMultistream: true,
198
+ meetingJoinUrl: 'meetingJoinUrl',
199
+ locusUrl: 'locusUrl',
200
+ meetingRequest: {joinMeeting: sinon.stub().returns(Promise.resolve({body: {}, headers: {}}))}
201
+ };
202
+
203
+ MeetingUtil.parseLocusJoin = sinon.stub();
204
+ await MeetingUtil.joinMeeting(meeting, {});
205
+
206
+ assert.calledOnce(meeting.meetingRequest.joinMeeting);
207
+ const parameter = meeting.meetingRequest.joinMeeting.getCall(0).args[0];
208
+
209
+ assert.equal(parameter.inviteeAddress, 'meetingJoinUrl');
210
+ assert.equal(parameter.preferTranscoding, false);
150
211
  });
151
212
 
152
213
  it('#Should fallback sipUrl if meetingJoinUrl does not exists', async () => {
@@ -12,7 +12,6 @@ import uuid from 'uuid';
12
12
  import StaticConfig from '@webex/plugin-meetings/src/common/config';
13
13
  import TriggerProxy from '@webex/plugin-meetings/src/common/events/trigger-proxy';
14
14
  import LoggerConfig from '@webex/plugin-meetings/src/common/logs/logger-config';
15
- import MediaUtil from '@webex/plugin-meetings/src/media/util';
16
15
  import Meeting from '@webex/plugin-meetings/src/meeting';
17
16
  import MeetingUtil from '@webex/plugin-meetings/src/meeting/util';
18
17
  import Meetings from '@webex/plugin-meetings/src/meetings';
@@ -787,7 +786,6 @@ describe('plugin-meetings', () => {
787
786
  });
788
787
  describe('#createMeeting', () => {
789
788
  beforeEach(() => {
790
- MediaUtil.createPeerConnection = sinon.stub().returns(true);
791
789
  webex.internal.device.userId = uuid1;
792
790
  webex.internal.device.url = url1;
793
791
  MeetingCollection.set = sinon.stub().returns(true);
@@ -1024,7 +1022,6 @@ describe('plugin-meetings', () => {
1024
1022
  describe('Public Event Triggers', () => {
1025
1023
  describe('#destroy', () => {
1026
1024
  beforeEach(() => {
1027
- MediaUtil.createPeerConnection = sinon.stub().returns(true);
1028
1025
  MeetingUtil.cleanUp = sinon.stub();
1029
1026
  });
1030
1027
  it('should have #destroy', () => {
@@ -1116,7 +1113,6 @@ describe('plugin-meetings', () => {
1116
1113
  let meeting;
1117
1114
 
1118
1115
  beforeEach(async () => {
1119
- MediaUtil.createPeerConnection = sinon.stub().returns(true);
1120
1116
  webex.internal.device.userId = uuid1;
1121
1117
  webex.internal.device.url = url1;
1122
1118
  MeetingCollection.set = sinon.stub().returns(true);
@@ -10,9 +10,8 @@ import chaiAsPromised from 'chai-as-promised';
10
10
  import {Credentials} from '@webex/webex-core';
11
11
  import Support from '@webex/internal-plugin-support';
12
12
  import MockWebex from '@webex/test-helper-mock-webex';
13
-
14
- import Meetings from '@webex/plugin-meetings';
15
13
  import ParameterError from '@webex/plugin-meetings/src/common/errors/parameter';
14
+ import Meetings from '@webex/plugin-meetings';
16
15
  import Members from '@webex/plugin-meetings/src/members';
17
16
  import MembersUtil from '@webex/plugin-meetings/src/members/util';
18
17
 
@@ -311,5 +310,168 @@ describe('plugin-meetings', () => {
311
310
  await checkValid(resultPromise, spies, requestingMemberId, url1);
312
311
  });
313
312
  });
313
+
314
+ describe('findMemberByCsi()', () => {
315
+ let members;
316
+
317
+ // fake collection that contains all combinations of members data structure (with respect to CSIs)
318
+ const fakeCollection = {
319
+ oneWithoutDevices: {
320
+ participant: {
321
+ }
322
+ },
323
+ oneWithEmptyDevices: {
324
+ participant: {
325
+ devices: [],
326
+ }
327
+ },
328
+ oneWithDevicesWithoutCsis: {
329
+ participant: {
330
+ devices: [
331
+ {
332
+ url: 'https://fakeURL1.com',
333
+ deviceType: 'SIP',
334
+ state: 'JOINED',
335
+ csis: [],
336
+ },
337
+ {
338
+ url: 'dialout:///fakeagain',
339
+ deviceType: 'PROVISIONAL',
340
+ state: 'JOINED',
341
+ }
342
+ ],
343
+ },
344
+ id: 'abc-123-abc-123',
345
+ status: 'IN_MEETING',
346
+ },
347
+ oneWithSomeCsis: {
348
+ participant: {
349
+ devices: [
350
+ {
351
+ url: 'https://fakeURL2.com',
352
+ deviceType: 'SIP',
353
+ state: 'JOINED',
354
+ csis: [1000, 1001, 1002],
355
+ },
356
+ {
357
+ url: 'https://fakeURL3.com',
358
+ deviceType: 'SIP',
359
+ state: 'JOINED',
360
+ csis: [2000, 2001, 2002],
361
+ }
362
+ ]
363
+ }
364
+ }
365
+ };
366
+
367
+ beforeEach(() => {
368
+ members = createMembers({url: url1});
369
+ members.membersCollection.setAll(fakeCollection);
370
+ });
371
+
372
+ it('returns undefined if member not found', () => {
373
+ assert.strictEqual(members.findMemberByCsi(123), undefined);
374
+ });
375
+
376
+ it('returns correct member when CSI matches the first device', () => {
377
+ assert.strictEqual(members.findMemberByCsi(1001), fakeCollection.oneWithSomeCsis);
378
+ });
379
+
380
+ it('returns correct member when CSI matches the second device', () => {
381
+ assert.strictEqual(members.findMemberByCsi(2001), fakeCollection.oneWithSomeCsis);
382
+ });
383
+ });
384
+
385
+ describe('getCsisForMember()', () => {
386
+ let members;
387
+
388
+ // fake collection that contains all combinations of members data structure (with respect to CSIs)
389
+ const fakeCollection = {
390
+ oneWithoutParticipant: {
391
+ id: 'oneWithoutParticipant',
392
+ },
393
+ oneWithoutDevices: {
394
+ id: 'oneWithoutDevices',
395
+ participant: {
396
+ }
397
+ },
398
+ oneWithEmptyDevices: {
399
+ id: 'oneWithEmptyDevices',
400
+ participant: {
401
+ devices: [],
402
+ }
403
+ },
404
+ oneWithDevicesWithoutCsis: {
405
+ id: 'oneWithDevicesWithoutCsis',
406
+ participant: {
407
+ devices: [
408
+ {
409
+ url: 'https://fakeURL1.com',
410
+ deviceType: 'SIP',
411
+ state: 'JOINED',
412
+ mediaSessions: [],
413
+ },
414
+ {
415
+ url: 'dialout:///fakeagain',
416
+ deviceType: 'PROVISIONAL',
417
+ state: 'JOINED',
418
+ }
419
+ ],
420
+ },
421
+ status: 'IN_MEETING',
422
+ },
423
+ oneWithSomeCsis: {
424
+ id: 'oneWithSomeCsis',
425
+ participant: {
426
+ devices: [
427
+ {
428
+ url: 'https://fakeURL2.com',
429
+ deviceType: 'SIP',
430
+ state: 'JOINED',
431
+ mediaSessions: [
432
+ {mediaType: 'audio', mediaContent: 'main', csi: 1000},
433
+ {mediaType: 'video', mediaContent: 'main', csi: 1001},
434
+ {mediaType: 'video', mediaContent: 'content', csi: 1002}
435
+ ],
436
+ },
437
+ {
438
+ url: 'https://fakeURL3.com',
439
+ deviceType: 'SIP',
440
+ state: 'JOINED',
441
+ mediaSessions: [
442
+ {mediaType: 'audio', mediaContent: 'main', csi: 2000},
443
+ {mediaType: 'video', mediaContent: 'main', csi: 2001},
444
+ {mediaType: 'video', mediaContent: 'content', csi: 2002}
445
+ ],
446
+ }
447
+ ]
448
+ }
449
+ }
450
+ };
451
+
452
+ beforeEach(() => {
453
+ members = createMembers({url: url1});
454
+ members.membersCollection.setAll(fakeCollection);
455
+ });
456
+
457
+ it('returns empty array if member not found', () => {
458
+ assert.deepEqual(members.getCsisForMember('wrong id'), []);
459
+ });
460
+
461
+ it('returns empty array if member does not have CSIs', () => {
462
+ assert.deepEqual(members.getCsisForMember('oneWithoutParticipant'), []);
463
+ assert.deepEqual(members.getCsisForMember('oneWithoutDevices'), []);
464
+ assert.deepEqual(members.getCsisForMember('oneWithEmptyDevices'), []);
465
+ assert.deepEqual(members.getCsisForMember('oneWithDevicesWithoutCsis'), []);
466
+ });
467
+
468
+ it('returns empty array if mediaType and mediaContent do not match', () => {
469
+ assert.deepEqual(members.getCsisForMember('oneWithSomeCsis', 'audio', 'content'), []);
470
+ });
471
+
472
+ it('returns correct CSI values when there is a match', () => {
473
+ assert.deepEqual(members.getCsisForMember('oneWithSomeCsis', 'video', 'main'), [1001, 2001]);
474
+ });
475
+ });
314
476
  });
315
477
  });