@webex/plugin-meetings 3.6.0 → 3.7.0-next.1

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 (314) hide show
  1. package/README.md +2 -1
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/common/errors/webinar-registration-error.js +50 -0
  5. package/dist/common/errors/webinar-registration-error.js.map +1 -0
  6. package/dist/config.js +3 -1
  7. package/dist/config.js.map +1 -1
  8. package/dist/constants.js +31 -2
  9. package/dist/constants.js.map +1 -1
  10. package/dist/controls-options-manager/enums.js +1 -0
  11. package/dist/controls-options-manager/enums.js.map +1 -1
  12. package/dist/controls-options-manager/index.js +10 -3
  13. package/dist/controls-options-manager/index.js.map +1 -1
  14. package/dist/controls-options-manager/types.js.map +1 -1
  15. package/dist/controls-options-manager/util.js +12 -0
  16. package/dist/controls-options-manager/util.js.map +1 -1
  17. package/dist/index.js +7 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/interpretation/index.js +1 -1
  20. package/dist/interpretation/siLanguage.js +1 -1
  21. package/dist/locus-info/controlsUtils.js +28 -4
  22. package/dist/locus-info/controlsUtils.js.map +1 -1
  23. package/dist/locus-info/fullState.js +2 -1
  24. package/dist/locus-info/fullState.js.map +1 -1
  25. package/dist/locus-info/index.js +61 -3
  26. package/dist/locus-info/index.js.map +1 -1
  27. package/dist/locus-info/parser.js +5 -1
  28. package/dist/locus-info/parser.js.map +1 -1
  29. package/dist/meeting/in-meeting-actions.js +19 -1
  30. package/dist/meeting/in-meeting-actions.js.map +1 -1
  31. package/dist/meeting/index.js +692 -522
  32. package/dist/meeting/index.js.map +1 -1
  33. package/dist/meeting/locusMediaRequest.js +2 -6
  34. package/dist/meeting/locusMediaRequest.js.map +1 -1
  35. package/dist/meeting/muteState.js +5 -2
  36. package/dist/meeting/muteState.js.map +1 -1
  37. package/dist/meeting/request.js +21 -29
  38. package/dist/meeting/request.js.map +1 -1
  39. package/dist/meeting/util.js +97 -61
  40. package/dist/meeting/util.js.map +1 -1
  41. package/dist/meeting-info/meeting-info-v2.js +68 -17
  42. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  43. package/dist/meetings/index.js +25 -1
  44. package/dist/meetings/index.js.map +1 -1
  45. package/dist/members/index.js +3 -2
  46. package/dist/members/index.js.map +1 -1
  47. package/dist/members/util.js +9 -5
  48. package/dist/members/util.js.map +1 -1
  49. package/dist/metrics/constants.js +2 -1
  50. package/dist/metrics/constants.js.map +1 -1
  51. package/dist/multistream/remoteMedia.js +4 -0
  52. package/dist/multistream/remoteMedia.js.map +1 -1
  53. package/dist/reachability/clusterReachability.js +0 -4
  54. package/dist/reachability/clusterReachability.js.map +1 -1
  55. package/dist/reachability/index.js +433 -136
  56. package/dist/reachability/index.js.map +1 -1
  57. package/dist/{rtcMetrics/constants.js → reachability/reachability.types.js} +1 -5
  58. package/dist/reachability/reachability.types.js.map +1 -0
  59. package/dist/reachability/request.js +23 -9
  60. package/dist/reachability/request.js.map +1 -1
  61. package/dist/roap/index.js +5 -7
  62. package/dist/roap/index.js.map +1 -1
  63. package/dist/roap/request.js +45 -79
  64. package/dist/roap/request.js.map +1 -1
  65. package/dist/roap/turnDiscovery.js +3 -6
  66. package/dist/roap/turnDiscovery.js.map +1 -1
  67. package/dist/{common/errors/parameter.d.ts → types/common/errors/webinar-registration-error.d.ts} +4 -5
  68. package/dist/types/config.d.ts +2 -0
  69. package/dist/types/constants.d.ts +25 -0
  70. package/dist/types/controls-options-manager/enums.d.ts +2 -1
  71. package/dist/types/controls-options-manager/index.d.ts +2 -1
  72. package/dist/types/controls-options-manager/types.d.ts +2 -0
  73. package/dist/types/index.d.ts +2 -1
  74. package/dist/types/locus-info/index.d.ts +9 -0
  75. package/dist/types/meeting/in-meeting-actions.d.ts +18 -0
  76. package/dist/types/meeting/index.d.ts +14 -3
  77. package/dist/types/meeting/locusMediaRequest.d.ts +2 -3
  78. package/dist/types/meeting/muteState.d.ts +2 -1
  79. package/dist/types/meeting/request.d.ts +2 -2
  80. package/dist/types/meeting/util.d.ts +2 -2
  81. package/dist/types/meeting-info/meeting-info-v2.d.ts +23 -0
  82. package/dist/types/meetings/index.d.ts +10 -1
  83. package/dist/types/members/index.d.ts +2 -1
  84. package/dist/types/members/util.d.ts +3 -1
  85. package/dist/types/metrics/constants.d.ts +1 -0
  86. package/dist/types/multistream/remoteMedia.d.ts +1 -0
  87. package/dist/types/reachability/clusterReachability.d.ts +1 -10
  88. package/dist/types/reachability/index.d.ts +74 -35
  89. package/dist/types/reachability/reachability.types.d.ts +64 -0
  90. package/dist/types/reachability/request.d.ts +5 -1
  91. package/dist/types/roap/request.d.ts +1 -13
  92. package/dist/webinar/index.js +32 -19
  93. package/dist/webinar/index.js.map +1 -1
  94. package/package.json +22 -22
  95. package/src/common/errors/webinar-registration-error.ts +27 -0
  96. package/src/config.ts +2 -0
  97. package/src/constants.ts +31 -0
  98. package/src/controls-options-manager/enums.ts +1 -0
  99. package/src/controls-options-manager/index.ts +19 -2
  100. package/src/controls-options-manager/types.ts +2 -0
  101. package/src/controls-options-manager/util.ts +12 -0
  102. package/src/index.ts +2 -0
  103. package/src/locus-info/controlsUtils.ts +46 -2
  104. package/src/locus-info/fullState.ts +1 -0
  105. package/src/locus-info/index.ts +60 -0
  106. package/src/locus-info/parser.ts +8 -1
  107. package/src/meeting/in-meeting-actions.ts +37 -0
  108. package/src/meeting/index.ts +154 -22
  109. package/src/meeting/locusMediaRequest.ts +4 -8
  110. package/src/meeting/muteState.ts +6 -2
  111. package/src/meeting/request.ts +4 -11
  112. package/src/meeting/util.ts +30 -6
  113. package/src/meeting-info/meeting-info-v2.ts +51 -0
  114. package/src/meetings/index.ts +68 -40
  115. package/src/members/index.ts +4 -2
  116. package/src/members/util.ts +3 -1
  117. package/src/metrics/constants.ts +1 -0
  118. package/src/multistream/remoteMedia.ts +5 -0
  119. package/src/reachability/clusterReachability.ts +1 -14
  120. package/src/reachability/index.ts +285 -77
  121. package/src/reachability/reachability.types.ts +85 -0
  122. package/src/reachability/request.ts +55 -30
  123. package/src/roap/index.ts +4 -5
  124. package/src/roap/request.ts +32 -44
  125. package/src/roap/turnDiscovery.ts +2 -4
  126. package/src/webinar/index.ts +31 -17
  127. package/test/unit/spec/controls-options-manager/index.js +56 -32
  128. package/test/unit/spec/controls-options-manager/util.js +44 -0
  129. package/test/unit/spec/locus-info/controlsUtils.js +80 -4
  130. package/test/unit/spec/locus-info/index.js +88 -2
  131. package/test/unit/spec/meeting/in-meeting-actions.ts +18 -0
  132. package/test/unit/spec/meeting/index.js +272 -82
  133. package/test/unit/spec/meeting/locusMediaRequest.ts +18 -11
  134. package/test/unit/spec/meeting/muteState.js +8 -4
  135. package/test/unit/spec/meeting/request.js +3 -26
  136. package/test/unit/spec/meeting/utils.js +69 -14
  137. package/test/unit/spec/meeting-info/meetinginfov2.js +37 -0
  138. package/test/unit/spec/meetings/index.js +32 -1
  139. package/test/unit/spec/members/index.js +25 -2
  140. package/test/unit/spec/members/request.js +37 -3
  141. package/test/unit/spec/members/utils.js +15 -1
  142. package/test/unit/spec/multistream/remoteMedia.ts +16 -2
  143. package/test/unit/spec/reachability/index.ts +265 -1
  144. package/test/unit/spec/reachability/request.js +56 -15
  145. package/test/unit/spec/roap/index.ts +1 -1
  146. package/test/unit/spec/roap/request.ts +51 -109
  147. package/test/unit/spec/roap/turnDiscovery.ts +202 -147
  148. package/test/unit/spec/webinar/index.ts +82 -16
  149. package/dist/annotation/annotation.types.d.ts +0 -42
  150. package/dist/annotation/constants.d.ts +0 -31
  151. package/dist/annotation/index.d.ts +0 -117
  152. package/dist/breakouts/breakout.d.ts +0 -8
  153. package/dist/breakouts/collection.d.ts +0 -5
  154. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  155. package/dist/breakouts/events.d.ts +0 -8
  156. package/dist/breakouts/index.d.ts +0 -5
  157. package/dist/breakouts/request.d.ts +0 -22
  158. package/dist/breakouts/utils.d.ts +0 -15
  159. package/dist/common/browser-detection.d.ts +0 -9
  160. package/dist/common/collection.d.ts +0 -48
  161. package/dist/common/config.d.ts +0 -2
  162. package/dist/common/errors/captcha-error.d.ts +0 -15
  163. package/dist/common/errors/intent-to-join.d.ts +0 -16
  164. package/dist/common/errors/join-meeting.d.ts +0 -17
  165. package/dist/common/errors/media.d.ts +0 -15
  166. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  167. package/dist/common/errors/password-error.d.ts +0 -15
  168. package/dist/common/errors/permission.d.ts +0 -14
  169. package/dist/common/errors/reclaim-host-role-error.js +0 -149
  170. package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
  171. package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
  172. package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
  173. package/dist/common/errors/reconnection-in-progress.js +0 -33
  174. package/dist/common/errors/reconnection-in-progress.js.map +0 -1
  175. package/dist/common/errors/reconnection.d.ts +0 -15
  176. package/dist/common/errors/stats.d.ts +0 -15
  177. package/dist/common/errors/webex-errors.d.ts +0 -93
  178. package/dist/common/errors/webex-meetings-error.d.ts +0 -20
  179. package/dist/common/events/events-scope.d.ts +0 -17
  180. package/dist/common/events/events.d.ts +0 -12
  181. package/dist/common/events/trigger-proxy.d.ts +0 -2
  182. package/dist/common/events/util.d.ts +0 -2
  183. package/dist/common/logs/logger-config.d.ts +0 -2
  184. package/dist/common/logs/logger-proxy.d.ts +0 -2
  185. package/dist/common/logs/request.d.ts +0 -36
  186. package/dist/common/queue.d.ts +0 -34
  187. package/dist/config.d.ts +0 -72
  188. package/dist/constants.d.ts +0 -1088
  189. package/dist/controls-options-manager/constants.d.ts +0 -4
  190. package/dist/controls-options-manager/enums.d.ts +0 -15
  191. package/dist/controls-options-manager/index.d.ts +0 -136
  192. package/dist/controls-options-manager/types.d.ts +0 -43
  193. package/dist/controls-options-manager/util.d.ts +0 -1
  194. package/dist/index.d.ts +0 -7
  195. package/dist/interceptors/index.d.ts +0 -2
  196. package/dist/interceptors/locusRetry.d.ts +0 -27
  197. package/dist/interpretation/collection.d.ts +0 -5
  198. package/dist/interpretation/index.d.ts +0 -5
  199. package/dist/interpretation/siLanguage.d.ts +0 -5
  200. package/dist/locus-info/controlsUtils.d.ts +0 -2
  201. package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
  202. package/dist/locus-info/fullState.d.ts +0 -2
  203. package/dist/locus-info/hostUtils.d.ts +0 -2
  204. package/dist/locus-info/index.d.ts +0 -322
  205. package/dist/locus-info/infoUtils.d.ts +0 -2
  206. package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
  207. package/dist/locus-info/parser.d.ts +0 -272
  208. package/dist/locus-info/selfUtils.d.ts +0 -2
  209. package/dist/media/index.d.ts +0 -34
  210. package/dist/media/properties.d.ts +0 -93
  211. package/dist/media/util.d.ts +0 -2
  212. package/dist/mediaQualityMetrics/config.d.ts +0 -241
  213. package/dist/mediaQualityMetrics/config.js +0 -502
  214. package/dist/mediaQualityMetrics/config.js.map +0 -1
  215. package/dist/meeting/effectsState.js +0 -260
  216. package/dist/meeting/effectsState.js.map +0 -1
  217. package/dist/meeting/in-meeting-actions.d.ts +0 -167
  218. package/dist/meeting/index.d.ts +0 -1825
  219. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  220. package/dist/meeting/muteState.d.ts +0 -178
  221. package/dist/meeting/request.d.ts +0 -295
  222. package/dist/meeting/request.type.d.ts +0 -11
  223. package/dist/meeting/state.d.ts +0 -9
  224. package/dist/meeting/util.d.ts +0 -119
  225. package/dist/meeting/voicea-meeting.d.ts +0 -16
  226. package/dist/meeting-info/collection.d.ts +0 -20
  227. package/dist/meeting-info/index.d.ts +0 -69
  228. package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
  229. package/dist/meeting-info/request.d.ts +0 -22
  230. package/dist/meeting-info/util.d.ts +0 -2
  231. package/dist/meeting-info/utilv2.d.ts +0 -2
  232. package/dist/meetings/collection.d.ts +0 -40
  233. package/dist/meetings/index.d.ts +0 -390
  234. package/dist/meetings/meetings.types.d.ts +0 -4
  235. package/dist/meetings/request.d.ts +0 -27
  236. package/dist/meetings/util.d.ts +0 -18
  237. package/dist/member/index.d.ts +0 -160
  238. package/dist/member/member.types.js +0 -17
  239. package/dist/member/member.types.js.map +0 -1
  240. package/dist/member/types.d.ts +0 -32
  241. package/dist/member/util.d.ts +0 -2
  242. package/dist/members/collection.d.ts +0 -29
  243. package/dist/members/index.d.ts +0 -353
  244. package/dist/members/request.d.ts +0 -114
  245. package/dist/members/types.d.ts +0 -25
  246. package/dist/members/util.d.ts +0 -215
  247. package/dist/metrics/config.js +0 -276
  248. package/dist/metrics/config.js.map +0 -1
  249. package/dist/metrics/constants.d.ts +0 -70
  250. package/dist/metrics/index.d.ts +0 -45
  251. package/dist/multistream/mediaRequestManager.d.ts +0 -119
  252. package/dist/multistream/receiveSlot.d.ts +0 -68
  253. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  254. package/dist/multistream/remoteMedia.d.ts +0 -72
  255. package/dist/multistream/remoteMediaGroup.d.ts +0 -49
  256. package/dist/multistream/remoteMediaManager.d.ts +0 -300
  257. package/dist/multistream/sendSlotManager.d.ts +0 -69
  258. package/dist/networkQualityMonitor/index.d.ts +0 -70
  259. package/dist/networkQualityMonitor/index.js +0 -221
  260. package/dist/networkQualityMonitor/index.js.map +0 -1
  261. package/dist/peer-connection-manager/index.js +0 -671
  262. package/dist/peer-connection-manager/index.js.map +0 -1
  263. package/dist/peer-connection-manager/util.js +0 -109
  264. package/dist/peer-connection-manager/util.js.map +0 -1
  265. package/dist/personal-meeting-room/index.d.ts +0 -47
  266. package/dist/personal-meeting-room/request.d.ts +0 -14
  267. package/dist/personal-meeting-room/util.d.ts +0 -2
  268. package/dist/reachability/clusterReachability.d.ts +0 -109
  269. package/dist/reachability/index.d.ts +0 -105
  270. package/dist/reachability/request.d.ts +0 -39
  271. package/dist/reachability/util.d.ts +0 -8
  272. package/dist/reactions/constants.d.ts +0 -3
  273. package/dist/reactions/reactions.d.ts +0 -4
  274. package/dist/reactions/reactions.type.d.ts +0 -52
  275. package/dist/reconnection-manager/index.d.ts +0 -136
  276. package/dist/recording-controller/enums.d.ts +0 -7
  277. package/dist/recording-controller/index.d.ts +0 -207
  278. package/dist/recording-controller/util.d.ts +0 -14
  279. package/dist/roap/collection.js +0 -62
  280. package/dist/roap/collection.js.map +0 -1
  281. package/dist/roap/handler.js +0 -275
  282. package/dist/roap/handler.js.map +0 -1
  283. package/dist/roap/index.d.ts +0 -86
  284. package/dist/roap/request.d.ts +0 -39
  285. package/dist/roap/state.js +0 -126
  286. package/dist/roap/state.js.map +0 -1
  287. package/dist/roap/turnDiscovery.d.ts +0 -155
  288. package/dist/roap/util.js +0 -75
  289. package/dist/roap/util.js.map +0 -1
  290. package/dist/rtcMetrics/constants.d.ts +0 -4
  291. package/dist/rtcMetrics/constants.js.map +0 -1
  292. package/dist/rtcMetrics/index.d.ts +0 -61
  293. package/dist/rtcMetrics/index.js +0 -197
  294. package/dist/rtcMetrics/index.js.map +0 -1
  295. package/dist/statsAnalyzer/global.d.ts +0 -36
  296. package/dist/statsAnalyzer/global.js +0 -126
  297. package/dist/statsAnalyzer/global.js.map +0 -1
  298. package/dist/statsAnalyzer/index.d.ts +0 -217
  299. package/dist/statsAnalyzer/index.js +0 -1013
  300. package/dist/statsAnalyzer/index.js.map +0 -1
  301. package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
  302. package/dist/statsAnalyzer/mqaUtil.js +0 -179
  303. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  304. package/dist/transcription/index.d.ts +0 -64
  305. package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
  306. package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
  307. package/dist/types/networkQualityMonitor/index.d.ts +0 -70
  308. package/dist/types/rtcMetrics/constants.d.ts +0 -4
  309. package/dist/types/rtcMetrics/index.d.ts +0 -71
  310. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  311. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  312. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  313. package/dist/webinar/collection.d.ts +0 -16
  314. package/dist/webinar/index.d.ts +0 -5
@@ -91,12 +91,14 @@ import ParameterError from '../../../../src/common/errors/parameter';
91
91
  import PasswordError from '../../../../src/common/errors/password-error';
92
92
  import CaptchaError from '../../../../src/common/errors/captcha-error';
93
93
  import PermissionError from '../../../../src/common/errors/permission';
94
+ import WebinarRegistrationError from '../../../../src/common/errors/webinar-registration-error';
94
95
  import IntentToJoinError from '../../../../src/common/errors/intent-to-join';
95
96
  import testUtils from '../../../utils/testUtils';
96
97
  import {
97
98
  MeetingInfoV2CaptchaError,
98
99
  MeetingInfoV2PasswordError,
99
100
  MeetingInfoV2PolicyError,
101
+ MeetingInfoV2WebinarRegistrationError,
100
102
  } from '../../../../src/meeting-info/meeting-info-v2';
101
103
  import {
102
104
  DTLS_HANDSHAKE_FAILED_CLIENT_CODE,
@@ -375,7 +377,10 @@ describe('plugin-meetings', () => {
375
377
  }
376
378
  );
377
379
  assert.equal(newMeeting.correlationId, newMeeting.id);
378
- assert.deepEqual(newMeeting.callStateForMetrics, {correlationId: newMeeting.id, sessionCorrelationId: ''});
380
+ assert.deepEqual(newMeeting.callStateForMetrics, {
381
+ correlationId: newMeeting.id,
382
+ sessionCorrelationId: '',
383
+ });
379
384
  });
380
385
 
381
386
  it('correlationId can be provided in callStateForMetrics', () => {
@@ -644,7 +649,6 @@ describe('plugin-meetings', () => {
644
649
  });
645
650
 
646
651
  const fakeRoapMessage = {id: 'fake TURN discovery message'};
647
- const fakeReachabilityResults = {id: 'fake reachability'};
648
652
  const fakeTurnServerInfo = {id: 'fake turn info'};
649
653
  const fakeJoinResult = {id: 'join result'};
650
654
 
@@ -662,8 +666,6 @@ describe('plugin-meetings', () => {
662
666
  .stub(meeting, 'addMediaInternal')
663
667
  .returns(Promise.resolve(test4));
664
668
 
665
- webex.meetings.reachability.getReachabilityResults.resolves(fakeReachabilityResults);
666
-
667
669
  generateTurnDiscoveryRequestMessageStub = sinon
668
670
  .stub(meeting.roap, 'generateTurnDiscoveryRequestMessage')
669
671
  .resolves({roapMessage: fakeRoapMessage});
@@ -683,7 +685,6 @@ describe('plugin-meetings', () => {
683
685
  assert.calledOnceWithExactly(meeting.join, {
684
686
  ...joinOptions,
685
687
  roapMessage: fakeRoapMessage,
686
- reachability: fakeReachabilityResults,
687
688
  });
688
689
  assert.calledOnceWithExactly(generateTurnDiscoveryRequestMessageStub, meeting, true);
689
690
  assert.calledOnceWithExactly(
@@ -720,7 +721,6 @@ describe('plugin-meetings', () => {
720
721
  assert.calledOnceWithExactly(meeting.join, {
721
722
  ...joinOptions,
722
723
  roapMessage: undefined,
723
- reachability: fakeReachabilityResults,
724
724
  });
725
725
  assert.calledOnceWithExactly(generateTurnDiscoveryRequestMessageStub, meeting, true);
726
726
  assert.notCalled(handleTurnDiscoveryHttpResponseStub);
@@ -752,7 +752,6 @@ describe('plugin-meetings', () => {
752
752
  assert.calledOnceWithExactly(meeting.join, {
753
753
  ...joinOptions,
754
754
  roapMessage: fakeRoapMessage,
755
- reachability: fakeReachabilityResults,
756
755
  });
757
756
  assert.calledOnceWithExactly(generateTurnDiscoveryRequestMessageStub, meeting, true);
758
757
  assert.calledOnceWithExactly(
@@ -3440,47 +3439,60 @@ describe('plugin-meetings', () => {
3440
3439
  });
3441
3440
  });
3442
3441
 
3443
- it('should pass bundlePolicy to createMediaConnection', async () => {
3442
+ describe('bundlePolicy', () => {
3444
3443
  const FAKE_TURN_URL = 'turns:webex.com:3478';
3445
3444
  const FAKE_TURN_USER = 'some-turn-username';
3446
3445
  const FAKE_TURN_PASSWORD = 'some-password';
3447
3446
 
3448
- meeting.meetingState = 'ACTIVE';
3449
- Media.createMediaConnection.resetHistory();
3450
-
3451
- meeting.roap.doTurnDiscovery = sinon.stub().resolves({
3452
- turnServerInfo: {
3453
- url: FAKE_TURN_URL,
3454
- username: FAKE_TURN_USER,
3455
- password: FAKE_TURN_PASSWORD,
3456
- },
3457
- turnDiscoverySkippedReason: undefined,
3458
- });
3459
- const media = meeting.addMedia({
3460
- mediaSettings: {},
3461
- bundlePolicy: 'bundlePolicy-value',
3462
- });
3447
+ beforeEach(() => {
3448
+ meeting.meetingState = 'ACTIVE';
3449
+ Media.createMediaConnection.resetHistory();
3463
3450
 
3464
- assert.exists(media);
3465
- await media;
3466
- assert.calledOnce(meeting.roap.doTurnDiscovery);
3467
- assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
3468
- assert.calledOnce(Media.createMediaConnection);
3469
- assert.calledWith(
3470
- Media.createMediaConnection,
3471
- false,
3472
- meeting.getMediaConnectionDebugId(),
3473
- meeting.id,
3474
- sinon.match({
3451
+ meeting.roap.doTurnDiscovery = sinon.stub().resolves({
3475
3452
  turnServerInfo: {
3476
3453
  url: FAKE_TURN_URL,
3477
3454
  username: FAKE_TURN_USER,
3478
3455
  password: FAKE_TURN_PASSWORD,
3479
3456
  },
3480
- bundlePolicy: 'bundlePolicy-value',
3481
- })
3482
- );
3483
- assert.calledOnce(fakeMediaConnection.initiateOffer);
3457
+ turnDiscoverySkippedReason: undefined,
3458
+ });
3459
+ });
3460
+
3461
+ const runCheck = async (bundlePolicy, expectedValue) => {
3462
+ const media = meeting.addMedia({
3463
+ mediaSettings: {},
3464
+ bundlePolicy,
3465
+ });
3466
+
3467
+ assert.exists(media);
3468
+ await media;
3469
+ assert.calledOnce(meeting.roap.doTurnDiscovery);
3470
+ assert.calledWith(meeting.roap.doTurnDiscovery, meeting, false);
3471
+ assert.calledOnce(Media.createMediaConnection);
3472
+ assert.calledWith(
3473
+ Media.createMediaConnection,
3474
+ false,
3475
+ meeting.getMediaConnectionDebugId(),
3476
+ meeting.id,
3477
+ sinon.match({
3478
+ turnServerInfo: {
3479
+ url: FAKE_TURN_URL,
3480
+ username: FAKE_TURN_USER,
3481
+ password: FAKE_TURN_PASSWORD,
3482
+ },
3483
+ bundlePolicy: expectedValue,
3484
+ })
3485
+ );
3486
+ assert.calledOnce(fakeMediaConnection.initiateOffer);
3487
+ };
3488
+
3489
+ it('should pass bundlePolicy to createMediaConnection', async () => {
3490
+ await runCheck('max-compat', 'max-compat');
3491
+ });
3492
+
3493
+ it('should pass max-bundle to createMediaConnection if bundlePolicy is not provided', async () => {
3494
+ await runCheck(undefined, 'max-bundle');
3495
+ });
3484
3496
  });
3485
3497
 
3486
3498
  it('succeeds even if getDevices() throws', async () => {
@@ -3674,6 +3686,8 @@ describe('plugin-meetings', () => {
3674
3686
  meeting.setMercuryListener = sinon.stub();
3675
3687
  meeting.locusInfo.onFullLocus = sinon.stub();
3676
3688
  meeting.webex.meetings.geoHintInfo = {regionCode: 'EU', countryCode: 'UK'};
3689
+ meeting.webex.meetings.reachability.getReachabilityReportToAttachToRoap = sinon.stub().resolves({id: 'fake reachability'});
3690
+ meeting.webex.meetings.reachability.getClientMediaPreferences = sinon.stub().resolves({id: 'fake clientMediaPreferences'});
3677
3691
  meeting.roap.doTurnDiscovery = sinon.stub().resolves({
3678
3692
  turnServerInfo: {
3679
3693
  url: 'turns:turn-server-url:443?transport=tcp',
@@ -3793,12 +3807,12 @@ describe('plugin-meetings', () => {
3793
3807
  id: 'fake locus from mocked join request',
3794
3808
  locusUrl: 'fake locus url',
3795
3809
  mediaId: 'fake media id',
3796
- })
3810
+ });
3797
3811
  sinon.stub(meeting.meetingRequest, 'joinMeeting').resolves({
3798
3812
  headers: {
3799
3813
  trackingid: 'fake tracking id',
3800
- }
3801
- })
3814
+ },
3815
+ });
3802
3816
  await meeting.join({enableMultistream: isMultistream});
3803
3817
  });
3804
3818
 
@@ -3859,6 +3873,9 @@ describe('plugin-meetings', () => {
3859
3873
  const checkSdpOfferSent = ({audioMuted, videoMuted}) => {
3860
3874
  const {sdp, seq, tieBreaker} = roapOfferMessage;
3861
3875
 
3876
+ assert.calledWith(meeting.webex.meetings.reachability.getClientMediaPreferences, meeting.isMultistream, 0);
3877
+ assert.calledWith(meeting.webex.meetings.reachability.getReachabilityReportToAttachToRoap);
3878
+
3862
3879
  assert.calledWith(locusMediaRequestStub, {
3863
3880
  method: 'PUT',
3864
3881
  uri: `${meeting.selfUrl}/media`,
@@ -3872,14 +3889,12 @@ describe('plugin-meetings', () => {
3872
3889
  correlationId: meeting.correlationId,
3873
3890
  localMedias: [
3874
3891
  {
3875
- localSdp: `{"audioMuted":${audioMuted},"videoMuted":${videoMuted},"roapMessage":{"messageType":"OFFER","sdps":["${sdp}"],"version":"2","seq":"${seq}","tieBreaker":"${tieBreaker}","headers":["includeAnswerInHttpResponse","noOkInTransaction"]}}`,
3892
+ localSdp: `{"audioMuted":${audioMuted},"videoMuted":${videoMuted},"roapMessage":{"messageType":"OFFER","sdps":["${sdp}"],"version":"2","seq":"${seq}","tieBreaker":"${tieBreaker}","headers":["includeAnswerInHttpResponse","noOkInTransaction"]},"reachability":{"id":"fake reachability"}}`,
3876
3893
  mediaId: 'fake media id',
3877
3894
  },
3878
3895
  ],
3879
3896
  clientMediaPreferences: {
3880
- preferTranscoding: !meeting.isMultistream,
3881
- joinCookie: undefined,
3882
- ipver: 0,
3897
+ id: 'fake clientMediaPreferences',
3883
3898
  },
3884
3899
  },
3885
3900
  });
@@ -3900,13 +3915,11 @@ describe('plugin-meetings', () => {
3900
3915
  },
3901
3916
  correlationId: meeting.correlationId,
3902
3917
  clientMediaPreferences: {
3903
- preferTranscoding: !meeting.isMultistream,
3904
- ipver: undefined,
3905
- joinCookie: undefined,
3918
+ id: 'fake clientMediaPreferences',
3906
3919
  },
3907
3920
  localMedias: [
3908
3921
  {
3909
- localSdp: `{"audioMuted":${audioMuted},"videoMuted":${videoMuted},"roapMessage":{"messageType":"OK","version":"2","seq":"${seq}"}}`,
3922
+ localSdp: `{"audioMuted":${audioMuted},"videoMuted":${videoMuted},"roapMessage":{"messageType":"OK","version":"2","seq":"${seq}"},"reachability":{"id":"fake reachability"}}`,
3910
3923
  mediaId: 'fake media id',
3911
3924
  },
3912
3925
  ],
@@ -3932,10 +3945,6 @@ describe('plugin-meetings', () => {
3932
3945
  mediaId: 'fake media id',
3933
3946
  },
3934
3947
  ],
3935
- clientMediaPreferences: {
3936
- preferTranscoding: !meeting.isMultistream,
3937
- ipver: undefined,
3938
- },
3939
3948
  respOnlySdp: true,
3940
3949
  usingResource: null,
3941
3950
  },
@@ -3991,6 +4000,10 @@ describe('plugin-meetings', () => {
3991
4000
  assert.notCalled(
3992
4001
  meeting.sendSlotManager.getSlot(MediaType.AudioMain).publishStream
3993
4002
  );
4003
+ assert.throws(
4004
+ meeting.publishStreams(localStreams),
4005
+ `Attempted to publish microphone stream with ended readyState, correlationId=${meeting.correlationId}`
4006
+ );
3994
4007
  } else {
3995
4008
  assert.calledOnceWithExactly(
3996
4009
  meeting.sendSlotManager.getSlot(MediaType.AudioMain).publishStream,
@@ -4003,6 +4016,10 @@ describe('plugin-meetings', () => {
4003
4016
  assert.notCalled(
4004
4017
  meeting.sendSlotManager.getSlot(MediaType.VideoMain).publishStream
4005
4018
  );
4019
+ assert.throws(
4020
+ meeting.publishStreams(localStreams),
4021
+ `Attempted to publish camera stream with ended readyState, correlationId=${meeting.correlationId}`
4022
+ );
4006
4023
  } else {
4007
4024
  assert.calledOnceWithExactly(
4008
4025
  meeting.sendSlotManager.getSlot(MediaType.VideoMain).publishStream,
@@ -4015,6 +4032,10 @@ describe('plugin-meetings', () => {
4015
4032
  assert.notCalled(
4016
4033
  meeting.sendSlotManager.getSlot(MediaType.AudioSlides).publishStream
4017
4034
  );
4035
+ assert.throws(
4036
+ meeting.publishStreams(localStreams),
4037
+ `Attempted to publish screenShare audio stream with ended readyState, correlationId=${meeting.correlationId}`
4038
+ );
4018
4039
  } else {
4019
4040
  assert.calledOnceWithExactly(
4020
4041
  meeting.sendSlotManager.getSlot(MediaType.AudioSlides).publishStream,
@@ -4027,6 +4048,10 @@ describe('plugin-meetings', () => {
4027
4048
  assert.notCalled(
4028
4049
  meeting.sendSlotManager.getSlot(MediaType.VideoSlides).publishStream
4029
4050
  );
4051
+ assert.throws(
4052
+ meeting.publishStreams(localStreams),
4053
+ `Attempted to publish screenShare video stream with ended readyState, correlationId=${meeting.correlationId}`
4054
+ );
4030
4055
  } else {
4031
4056
  assert.calledOnceWithExactly(
4032
4057
  meeting.sendSlotManager.getSlot(MediaType.VideoSlides).publishStream,
@@ -4321,14 +4346,14 @@ describe('plugin-meetings', () => {
4321
4346
  const handleDeviceLoggingSpy = sinon.spy(Meeting, 'handleDeviceLogging');
4322
4347
  await meeting.addMedia({audioEnabled: false});
4323
4348
  //calling handleDeviceLogging with audioEnaled as true adn videoEnabled as false
4324
- assert.calledWith(handleDeviceLoggingSpy,false,true);
4349
+ assert.calledWith(handleDeviceLoggingSpy, false, true);
4325
4350
  });
4326
4351
 
4327
4352
  it('addMedia() works correctly when video is disabled with no streams to publish', async () => {
4328
4353
  const handleDeviceLoggingSpy = sinon.spy(Meeting, 'handleDeviceLogging');
4329
4354
  await meeting.addMedia({videoEnabled: false});
4330
4355
  //calling handleDeviceLogging audioEnabled as true videoEnabled as false
4331
- assert.calledWith(handleDeviceLoggingSpy,true,false);
4356
+ assert.calledWith(handleDeviceLoggingSpy, true, false);
4332
4357
  });
4333
4358
 
4334
4359
  it('addMedia() works correctly when video is disabled with no streams to publish', async () => {
@@ -4397,12 +4422,11 @@ describe('plugin-meetings', () => {
4397
4422
  assert.calledTwice(locusMediaRequestStub);
4398
4423
  });
4399
4424
 
4400
-
4401
4425
  it('addMedia() works correctly when both shareAudio and shareVideo is disabled with no streams publish', async () => {
4402
4426
  const handleDeviceLoggingSpy = sinon.spy(Meeting, 'handleDeviceLogging');
4403
4427
  await meeting.addMedia({shareAudioEnabled: false, shareVideoEnabled: false});
4404
4428
  //calling handleDeviceLogging with audioEnabled true and videoEnabled as true
4405
- assert.calledWith(handleDeviceLoggingSpy,true,true);
4429
+ assert.calledWith(handleDeviceLoggingSpy, true, true);
4406
4430
  });
4407
4431
 
4408
4432
  describe('publishStreams()/unpublishStreams() calls', () => {
@@ -6250,6 +6274,30 @@ describe('plugin-meetings', () => {
6250
6274
 
6251
6275
  assert.equal(meeting.fetchMeetingInfoTimeoutId, undefined);
6252
6276
  });
6277
+
6278
+ it('handles meetingInfoProvider webinar need registration error', async () => {
6279
+ meeting.destination = FAKE_DESTINATION;
6280
+ meeting.destinationType = FAKE_TYPE;
6281
+ meeting.attrs.meetingInfoProvider = {
6282
+ fetchMeetingInfo: sinon
6283
+ .stub()
6284
+ .throws(
6285
+ new MeetingInfoV2WebinarRegistrationError(403021, FAKE_MEETING_INFO, 'a message')
6286
+ ),
6287
+ };
6288
+
6289
+ await assert.isRejected(
6290
+ meeting.fetchMeetingInfo({sendCAevents: true}),
6291
+ WebinarRegistrationError
6292
+ );
6293
+
6294
+ assert.deepEqual(meeting.meetingInfo, FAKE_MEETING_INFO);
6295
+ assert.equal(meeting.meetingInfoFailureCode, 403021);
6296
+ assert.equal(
6297
+ meeting.meetingInfoFailureReason,
6298
+ MEETING_INFO_FAILURE_REASON.WEBINAR_REGISTRATION
6299
+ );
6300
+ });
6253
6301
  });
6254
6302
 
6255
6303
  describe('#refreshPermissionToken', () => {
@@ -6963,7 +7011,10 @@ describe('plugin-meetings', () => {
6963
7011
  assert.deepEqual(meeting.callStateForMetrics, {correlationId, sessionCorrelationId: ''});
6964
7012
  meeting.setCorrelationId(uuid1);
6965
7013
  assert.equal(meeting.correlationId, uuid1);
6966
- assert.deepEqual(meeting.callStateForMetrics, {correlationId: uuid1, sessionCorrelationId: ''});
7014
+ assert.deepEqual(meeting.callStateForMetrics, {
7015
+ correlationId: uuid1,
7016
+ sessionCorrelationId: '',
7017
+ });
6967
7018
  });
6968
7019
  });
6969
7020
 
@@ -7635,11 +7686,11 @@ describe('plugin-meetings', () => {
7635
7686
  id: 'stream',
7636
7687
  getTracks: () => [{id: 'track', addEventListener: sinon.stub()}],
7637
7688
  };
7638
- const simulateConnectionStateChange = (newState) => {
7689
+ const simulateConnectionStateChange = async (newState) => {
7639
7690
  meeting.mediaProperties.webrtcMediaConnection.getConnectionState = sinon
7640
7691
  .stub()
7641
7692
  .returns(newState);
7642
- eventListeners[MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED]();
7693
+ await eventListeners[MediaConnectionEventNames.PEER_CONNECTION_STATE_CHANGED]();
7643
7694
  };
7644
7695
 
7645
7696
  beforeEach(() => {
@@ -7709,11 +7760,17 @@ describe('plugin-meetings', () => {
7709
7760
  });
7710
7761
 
7711
7762
  it('should collect ice candidates', () => {
7712
- eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: 'candidate'});
7763
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: {candidate: 'candidate'}});
7713
7764
 
7714
7765
  assert.equal(meeting.iceCandidatesCount, 1);
7715
7766
  });
7716
7767
 
7768
+ it('should not collect empty ice candidates', () => {
7769
+ eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: {candidate: ''}});
7770
+
7771
+ assert.equal(meeting.iceCandidatesCount, 0);
7772
+ });
7773
+
7717
7774
  it('should not collect null ice candidates', () => {
7718
7775
  eventListeners[MediaConnectionEventNames.ICE_CANDIDATE]({candidate: null});
7719
7776
 
@@ -7895,7 +7952,7 @@ describe('plugin-meetings', () => {
7895
7952
  meeting.reconnectionManager = new ReconnectionManager(meeting);
7896
7953
  meeting.reconnectionManager.iceReconnected = sinon.stub().returns(undefined);
7897
7954
  meeting.setNetworkStatus = sinon.stub().returns(undefined);
7898
- meeting.statsAnalyzer = {startAnalyzer: sinon.stub()};
7955
+ meeting.statsAnalyzer = {startAnalyzer: sinon.stub(), stopAnalyzer: sinon.stub()};
7899
7956
  meeting.mediaProperties.webrtcMediaConnection = {
7900
7957
  // mock the on() method and store all the listeners
7901
7958
  on: sinon.stub().callsFake((event, listener) => {
@@ -7970,10 +8027,10 @@ describe('plugin-meetings', () => {
7970
8027
  });
7971
8028
 
7972
8029
  describe('CONNECTION_STATE_CHANGED event when state = "Failed"', () => {
7973
- const mockFailedEvent = () => {
8030
+ const mockFailedEvent = async () => {
7974
8031
  meeting.setupMediaConnectionListeners();
7975
8032
 
7976
- simulateConnectionStateChange(ConnectionState.Failed);
8033
+ await simulateConnectionStateChange(ConnectionState.Failed);
7977
8034
  };
7978
8035
 
7979
8036
  const checkBehavioralMetricSent = (hasMediaConnectionConnectedAtLeastOnce = false) => {
@@ -8003,6 +8060,22 @@ describe('plugin-meetings', () => {
8003
8060
  assert.notCalled(webex.internal.newMetrics.submitClientEvent);
8004
8061
  checkBehavioralMetricSent(true);
8005
8062
  });
8063
+
8064
+ it('stop stats analyzer during reconnection ', async () => {
8065
+ meeting.hasMediaConnectionConnectedAtLeastOnce = true;
8066
+ meeting.statsAnalyzer.stopAnalyzer = sinon.stub().resolves();
8067
+ meeting.reconnectionManager = {
8068
+ reconnect: sinon.stub().resolves(),
8069
+ resetReconnectionTimer: () => {}
8070
+ };
8071
+ meeting.currentMediaStatus = {
8072
+ video: true
8073
+ };
8074
+
8075
+ await mockFailedEvent();
8076
+
8077
+ assert.calledOnce(meeting.statsAnalyzer.stopAnalyzer);
8078
+ });
8006
8079
  });
8007
8080
 
8008
8081
  describe('should send correct metrics for ROAP_FAILURE event', () => {
@@ -8863,6 +8936,78 @@ describe('plugin-meetings', () => {
8863
8936
  );
8864
8937
  });
8865
8938
 
8939
+ it('listens to MEETING_CONTROLS_WEBCAST_UPDATED', async () => {
8940
+ const state = {example: 'value'};
8941
+
8942
+ await meeting.locusInfo.emitScoped(
8943
+ {function: 'test', file: 'test'},
8944
+ LOCUSINFO.EVENTS.CONTROLS_WEBCAST_CHANGED,
8945
+ {state}
8946
+ );
8947
+
8948
+ assert.calledWith(
8949
+ TriggerProxy.trigger,
8950
+ meeting,
8951
+ {file: 'meeting/index', function: 'setupLocusControlsListener'},
8952
+ EVENT_TRIGGERS.MEETING_CONTROLS_WEBCAST_UPDATED,
8953
+ {state}
8954
+ );
8955
+ });
8956
+
8957
+ it('listens to MEETING_CONTROLS_MEETING_FULL_UPDATED', async () => {
8958
+ const state = {example: 'value'};
8959
+
8960
+ await meeting.locusInfo.emitScoped(
8961
+ {function: 'test', file: 'test'},
8962
+ LOCUSINFO.EVENTS.CONTROLS_MEETING_FULL_CHANGED,
8963
+ {state}
8964
+ );
8965
+
8966
+ assert.calledWith(
8967
+ TriggerProxy.trigger,
8968
+ meeting,
8969
+ {file: 'meeting/index', function: 'setupLocusControlsListener'},
8970
+ EVENT_TRIGGERS.MEETING_CONTROLS_MEETING_FULL_UPDATED,
8971
+ {state}
8972
+ );
8973
+ });
8974
+
8975
+ it('listens to MEETING_CONTROLS_PRACTICE_SESSION_STATUS_UPDATED', async () => {
8976
+ const state = {example: 'value'};
8977
+
8978
+ await meeting.locusInfo.emitScoped(
8979
+ {function: 'test', file: 'test'},
8980
+ LOCUSINFO.EVENTS.CONTROLS_PRACTICE_SESSION_STATUS_UPDATED,
8981
+ {state}
8982
+ );
8983
+
8984
+ assert.calledWith(
8985
+ TriggerProxy.trigger,
8986
+ meeting,
8987
+ {file: 'meeting/index', function: 'setupLocusControlsListener'},
8988
+ EVENT_TRIGGERS.MEETING_CONTROLS_PRACTICE_SESSION_STATUS_UPDATED,
8989
+ {state}
8990
+ );
8991
+ });
8992
+
8993
+ it('listens to MEETING_CONTROLS_STAGE_VIEW_UPDATED', async () => {
8994
+ const state = {example: 'value'};
8995
+
8996
+ await meeting.locusInfo.emitScoped(
8997
+ {function: 'test', file: 'test'},
8998
+ LOCUSINFO.EVENTS.CONTROLS_STAGE_VIEW_UPDATED,
8999
+ {state}
9000
+ );
9001
+
9002
+ assert.calledWith(
9003
+ TriggerProxy.trigger,
9004
+ meeting,
9005
+ {file: 'meeting/index', function: 'setupLocusControlsListener'},
9006
+ EVENT_TRIGGERS.MEETING_CONTROLS_STAGE_VIEW_UPDATED,
9007
+ {state}
9008
+ );
9009
+ });
9010
+
8866
9011
  it('listens to MEETING_CONTROLS_VIDEO_UPDATED', async () => {
8867
9012
  const state = {example: 'value'};
8868
9013
 
@@ -8976,12 +9121,6 @@ describe('plugin-meetings', () => {
8976
9121
  approval: {
8977
9122
  url: 'url',
8978
9123
  },
8979
- webcast: {
8980
- url: 'url',
8981
- },
8982
- webinarAttendeesSearching: {
8983
- url: 'url',
8984
- },
8985
9124
  },
8986
9125
  };
8987
9126
 
@@ -8995,10 +9134,6 @@ describe('plugin-meetings', () => {
8995
9134
  meeting.simultaneousInterpretation = {
8996
9135
  approvalUrlUpdate: sinon.stub().returns(undefined),
8997
9136
  };
8998
- meeting.webinar = {
8999
- webcastUrlUpdate: sinon.stub().returns(undefined),
9000
- webinarAttendeesSearchingUrlUpdate: sinon.stub().returns(undefined),
9001
- };
9002
9137
 
9003
9138
  meeting.locusInfo.emit(
9004
9139
  {function: 'test', file: 'test'},
@@ -9018,19 +9153,37 @@ describe('plugin-meetings', () => {
9018
9153
  meeting.simultaneousInterpretation.approvalUrlUpdate,
9019
9154
  newLocusServices.services.approval.url
9020
9155
  );
9021
- assert.calledWith(
9022
- meeting.webinar.webcastUrlUpdate,
9023
- newLocusServices.services.webcast.url
9024
- );
9025
- assert.calledWith(
9026
- meeting.webinar.webinarAttendeesSearchingUrlUpdate,
9027
- newLocusServices.services.webinarAttendeesSearching.url
9028
- );
9029
9156
  assert.calledOnce(meeting.recordingController.setSessionId);
9030
9157
  done();
9031
9158
  });
9032
9159
  });
9033
9160
 
9161
+ describe('#setUpLocusResourcesListener', () => {
9162
+ it('listens to the locus resources update event', (done) => {
9163
+ const newLocusResources = {
9164
+ resources: {
9165
+ webcastInstance: {
9166
+ url: 'url',
9167
+ },
9168
+ },
9169
+ };
9170
+
9171
+ meeting.webinar = {
9172
+ updateWebcastUrl: sinon.stub().returns(undefined),
9173
+ };
9174
+
9175
+ meeting.locusInfo.emit(
9176
+ {function: 'test', file: 'test'},
9177
+ 'LINKS_RESOURCES',
9178
+ newLocusResources
9179
+ );
9180
+
9181
+ assert.calledWith(meeting.webinar.updateWebcastUrl, newLocusResources);
9182
+
9183
+ done();
9184
+ });
9185
+ });
9186
+
9034
9187
  describe('#setUpLocusInfoMediaInactiveListener', () => {
9035
9188
  it('listens to disconnect due to un activity ', (done) => {
9036
9189
  TriggerProxy.trigger.reset();
@@ -12178,6 +12331,43 @@ describe('plugin-meetings', () => {
12178
12331
  await testEmit(false);
12179
12332
  });
12180
12333
  });
12334
+
12335
+ describe('LOCAL_UNMUTE_REQUIRED locus event', () => {
12336
+ const testEmit = async (unmuteAllowed) => {
12337
+ meeting.audio = {
12338
+ handleServerLocalUnmuteRequired: sinon.stub(),
12339
+ };
12340
+ await meeting.locusInfo.emitScoped({}, LOCUSINFO.EVENTS.LOCAL_UNMUTE_REQUIRED, {
12341
+ unmuteAllowed,
12342
+ });
12343
+
12344
+ assert.calledWith(
12345
+ TriggerProxy.trigger,
12346
+ sinon.match.instanceOf(Meeting),
12347
+ {
12348
+ file: 'meeting/index',
12349
+ function: 'setUpLocusInfoSelfListener',
12350
+ },
12351
+ EVENT_TRIGGERS.MEETING_SELF_UNMUTED_BY_OTHERS,
12352
+ {
12353
+ payload: {
12354
+ unmuteAllowed,
12355
+ },
12356
+ }
12357
+ );
12358
+ assert.calledOnceWithExactly(
12359
+ meeting.audio.handleServerLocalUnmuteRequired,
12360
+ meeting,
12361
+ unmuteAllowed
12362
+ );
12363
+ };
12364
+
12365
+ [true, false].forEach((unmuteAllowed) => {
12366
+ it(`emits the expected event and calls handleServerLocalUnmuteRequired() when unmuteAllowed=${unmuteAllowed}`, async () => {
12367
+ await testEmit(unmuteAllowed);
12368
+ });
12369
+ });
12370
+ });
12181
12371
  });
12182
12372
  });
12183
12373
 
@@ -34,12 +34,19 @@ describe('LocusMediaRequest.send()', () => {
34
34
  'wjfkm.wjfkm.*': {udp:{reachable: true}, tcp:{reachable:false}},
35
35
  '1eb65fdf-9643-417f-9974-ad72cae0e10f.59268c12-7a04-4b23-a1a1-4c74be03019a.*': {udp:{reachable: false}, tcp:{reachable:true}},
36
36
  },
37
- joinCookie: {
38
- anycastEntryPoint: 'aws-eu-west-1',
39
- clientIpAddress: 'some ip',
40
- timeShot: '2023-05-23T08:03:49Z',
41
- },
42
- ipVersion: IP_VERSION.only_ipv4,
37
+ clientMediaPreferences: {
38
+ preferTranscoding: false,
39
+ joinCookie: {
40
+ anycastEntryPoint: 'aws-eu-west-1',
41
+ clientIpAddress: 'some ip',
42
+ timeShot: '2023-05-23T08:03:49Z',
43
+ },
44
+ ipver: IP_VERSION.only_ipv4,
45
+ reachability: {
46
+ version: '1',
47
+ result: 'some fake reachability result',
48
+ }
49
+ }
43
50
  };
44
51
 
45
52
  const createExpectedRoapBody = (expectedMessageType, expectedMute:{audioMuted: boolean, videoMuted: boolean}) => {
@@ -53,12 +60,16 @@ describe('LocusMediaRequest.send()', () => {
53
60
  }
54
61
  ],
55
62
  clientMediaPreferences: {
56
- preferTranscoding: true,
63
+ preferTranscoding: false,
57
64
  ipver: 4,
58
65
  joinCookie: {
59
66
  anycastEntryPoint: 'aws-eu-west-1',
60
67
  clientIpAddress: 'some ip',
61
68
  timeShot: '2023-05-23T08:03:49Z'
69
+ },
70
+ reachability: {
71
+ version: '1',
72
+ result: 'some fake reachability result',
62
73
  }
63
74
  }
64
75
  };
@@ -87,10 +98,6 @@ describe('LocusMediaRequest.send()', () => {
87
98
  localSdp: `{"audioMuted":${expectedMute.audioMuted},"videoMuted":${expectedMute.videoMuted}}`,
88
99
  },
89
100
  ],
90
- clientMediaPreferences: {
91
- preferTranscoding: true,
92
- ipver: undefined,
93
- },
94
101
  };
95
102
 
96
103
  if (sequence) {