@webex/plugin-meetings 3.8.0 → 3.8.1-next.10

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 (361) hide show
  1. package/README.md +26 -13
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +70 -6
  4. package/dist/breakouts/index.js.map +1 -1
  5. package/dist/common/errors/webex-errors.js +12 -2
  6. package/dist/common/errors/webex-errors.js.map +1 -1
  7. package/dist/config.js +5 -1
  8. package/dist/config.js.map +1 -1
  9. package/dist/constants.js +28 -123
  10. package/dist/constants.js.map +1 -1
  11. package/dist/controls-options-manager/enums.js +3 -0
  12. package/dist/controls-options-manager/enums.js.map +1 -1
  13. package/dist/controls-options-manager/types.js.map +1 -1
  14. package/dist/controls-options-manager/util.js +78 -0
  15. package/dist/controls-options-manager/util.js.map +1 -1
  16. package/dist/interpretation/index.js +4 -4
  17. package/dist/interpretation/index.js.map +1 -1
  18. package/dist/interpretation/siLanguage.js +1 -1
  19. package/dist/locus-info/controlsUtils.js +37 -11
  20. package/dist/locus-info/controlsUtils.js.map +1 -1
  21. package/dist/locus-info/index.js +92 -12
  22. package/dist/locus-info/index.js.map +1 -1
  23. package/dist/locus-info/selfUtils.js +432 -418
  24. package/dist/locus-info/selfUtils.js.map +1 -1
  25. package/dist/media/index.js +17 -17
  26. package/dist/media/index.js.map +1 -1
  27. package/dist/media/properties.js +94 -6
  28. package/dist/media/properties.js.map +1 -1
  29. package/dist/meeting/brbState.js +9 -2
  30. package/dist/meeting/brbState.js.map +1 -1
  31. package/dist/meeting/in-meeting-actions.js +21 -1
  32. package/dist/meeting/in-meeting-actions.js.map +1 -1
  33. package/dist/meeting/index.js +678 -344
  34. package/dist/meeting/index.js.map +1 -1
  35. package/dist/meeting/locusMediaRequest.js +21 -22
  36. package/dist/meeting/locusMediaRequest.js.map +1 -1
  37. package/dist/meeting/muteState.js +4 -4
  38. package/dist/meeting/muteState.js.map +1 -1
  39. package/dist/meeting/request.js +30 -0
  40. package/dist/meeting/request.js.map +1 -1
  41. package/dist/meeting/request.type.js.map +1 -1
  42. package/dist/meeting/util.js +13 -2
  43. package/dist/meeting/util.js.map +1 -1
  44. package/dist/meeting-info/meeting-info-v2.js +373 -68
  45. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  46. package/dist/meeting-info/utilv2.js +5 -1
  47. package/dist/meeting-info/utilv2.js.map +1 -1
  48. package/dist/meetings/index.js +136 -1
  49. package/dist/meetings/index.js.map +1 -1
  50. package/dist/meetings/util.js +14 -0
  51. package/dist/meetings/util.js.map +1 -1
  52. package/dist/member/index.js +55 -9
  53. package/dist/member/index.js.map +1 -1
  54. package/dist/member/types.js +3 -0
  55. package/dist/member/types.js.map +1 -1
  56. package/dist/member/util.js +335 -353
  57. package/dist/member/util.js.map +1 -1
  58. package/dist/members/collection.js.map +1 -1
  59. package/dist/members/index.js +137 -29
  60. package/dist/members/index.js.map +1 -1
  61. package/dist/members/request.js +38 -0
  62. package/dist/members/request.js.map +1 -1
  63. package/dist/members/util.js +36 -1
  64. package/dist/members/util.js.map +1 -1
  65. package/dist/metrics/constants.js +10 -0
  66. package/dist/metrics/constants.js.map +1 -1
  67. package/dist/multistream/remoteMediaManager.js +40 -8
  68. package/dist/multistream/remoteMediaManager.js.map +1 -1
  69. package/dist/reachability/clusterReachability.js +63 -27
  70. package/dist/reachability/clusterReachability.js.map +1 -1
  71. package/dist/reachability/index.js +107 -47
  72. package/dist/reachability/index.js.map +1 -1
  73. package/dist/reachability/reachability.types.js +14 -0
  74. package/dist/reachability/reachability.types.js.map +1 -1
  75. package/dist/reachability/request.js +19 -3
  76. package/dist/reachability/request.js.map +1 -1
  77. package/dist/reconnection-manager/index.js +2 -2
  78. package/dist/reconnection-manager/index.js.map +1 -1
  79. package/dist/recording-controller/util.js +5 -5
  80. package/dist/recording-controller/util.js.map +1 -1
  81. package/dist/roap/index.js.map +1 -1
  82. package/dist/roap/turnDiscovery.js +45 -27
  83. package/dist/roap/turnDiscovery.js.map +1 -1
  84. package/dist/roap/types.js +17 -0
  85. package/dist/roap/types.js.map +1 -0
  86. package/dist/types/common/errors/webex-errors.d.ts +7 -1
  87. package/dist/types/config.d.ts +3 -0
  88. package/dist/types/constants.d.ts +20 -85
  89. package/dist/types/controls-options-manager/enums.d.ts +4 -1
  90. package/dist/types/controls-options-manager/types.d.ts +10 -1
  91. package/dist/types/locus-info/index.d.ts +3 -3
  92. package/dist/types/locus-info/selfUtils.d.ts +216 -1
  93. package/dist/types/media/properties.d.ts +15 -0
  94. package/dist/types/meeting/in-meeting-actions.d.ts +20 -0
  95. package/dist/types/meeting/index.d.ts +65 -1
  96. package/dist/types/meeting/muteState.d.ts +0 -1
  97. package/dist/types/meeting/request.d.ts +12 -1
  98. package/dist/types/meeting/request.type.d.ts +6 -0
  99. package/dist/types/meeting/util.d.ts +3 -1
  100. package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
  101. package/dist/types/meetings/index.d.ts +57 -0
  102. package/dist/types/member/index.d.ts +21 -6
  103. package/dist/types/member/types.d.ts +73 -14
  104. package/dist/types/member/util.d.ts +156 -1
  105. package/dist/types/members/collection.d.ts +6 -5
  106. package/dist/types/members/index.d.ts +32 -43
  107. package/dist/types/members/request.d.ts +26 -0
  108. package/dist/types/members/util.d.ts +27 -0
  109. package/dist/types/metrics/constants.d.ts +10 -0
  110. package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
  111. package/dist/types/reachability/clusterReachability.d.ts +15 -7
  112. package/dist/types/reachability/index.d.ts +10 -1
  113. package/dist/types/reachability/reachability.types.d.ts +5 -0
  114. package/dist/types/roap/index.d.ts +3 -2
  115. package/dist/types/roap/turnDiscovery.d.ts +5 -17
  116. package/dist/types/roap/types.d.ts +16 -0
  117. package/dist/webinar/index.js +2 -2
  118. package/dist/webinar/index.js.map +1 -1
  119. package/package.json +24 -23
  120. package/src/breakouts/index.ts +69 -0
  121. package/src/common/errors/webex-errors.ts +8 -1
  122. package/src/config.ts +3 -0
  123. package/src/constants.ts +30 -90
  124. package/src/controls-options-manager/enums.ts +3 -0
  125. package/src/controls-options-manager/types.ts +16 -1
  126. package/src/controls-options-manager/util.ts +93 -0
  127. package/src/interpretation/index.ts +3 -3
  128. package/src/locus-info/controlsUtils.ts +59 -14
  129. package/src/locus-info/index.ts +97 -13
  130. package/src/locus-info/selfUtils.ts +496 -442
  131. package/src/media/index.ts +23 -21
  132. package/src/media/properties.ts +96 -0
  133. package/src/meeting/brbState.ts +11 -2
  134. package/src/meeting/in-meeting-actions.ts +40 -0
  135. package/src/meeting/index.ts +470 -105
  136. package/src/meeting/locusMediaRequest.ts +27 -22
  137. package/src/meeting/muteState.ts +4 -4
  138. package/src/meeting/request.ts +36 -1
  139. package/src/meeting/request.type.ts +7 -0
  140. package/src/meeting/util.ts +11 -2
  141. package/src/meeting-info/meeting-info-v2.ts +254 -8
  142. package/src/meeting-info/utilv2.ts +5 -0
  143. package/src/meetings/index.ts +148 -1
  144. package/src/meetings/util.ts +18 -0
  145. package/src/member/index.ts +68 -22
  146. package/src/member/types.ts +82 -16
  147. package/src/member/util.ts +357 -350
  148. package/src/members/collection.ts +4 -3
  149. package/src/members/index.ts +137 -18
  150. package/src/members/request.ts +44 -0
  151. package/src/members/util.ts +43 -1
  152. package/src/metrics/constants.ts +10 -0
  153. package/src/multistream/remoteMediaManager.ts +32 -10
  154. package/src/reachability/clusterReachability.ts +73 -26
  155. package/src/reachability/index.ts +62 -1
  156. package/src/reachability/reachability.types.ts +6 -0
  157. package/src/reachability/request.ts +7 -0
  158. package/src/reconnection-manager/index.ts +2 -2
  159. package/src/recording-controller/util.ts +17 -13
  160. package/src/roap/index.ts +3 -7
  161. package/src/roap/turnDiscovery.ts +34 -39
  162. package/src/roap/types.ts +23 -0
  163. package/src/webinar/index.ts +1 -1
  164. package/test/unit/spec/breakouts/index.ts +167 -95
  165. package/test/unit/spec/controls-options-manager/util.js +178 -0
  166. package/test/unit/spec/interpretation/index.ts +39 -1
  167. package/test/unit/spec/locus-info/controlsUtils.js +155 -9
  168. package/test/unit/spec/locus-info/index.js +209 -73
  169. package/test/unit/spec/locus-info/selfUtils.js +98 -24
  170. package/test/unit/spec/media/index.ts +150 -18
  171. package/test/unit/spec/media/properties.ts +130 -0
  172. package/test/unit/spec/meeting/brbState.ts +40 -2
  173. package/test/unit/spec/meeting/in-meeting-actions.ts +23 -4
  174. package/test/unit/spec/meeting/index.js +804 -139
  175. package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
  176. package/test/unit/spec/meeting/muteState.js +73 -2
  177. package/test/unit/spec/meeting/request.js +32 -1
  178. package/test/unit/spec/meeting/utils.js +119 -18
  179. package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
  180. package/test/unit/spec/meeting-info/utilv2.js +19 -0
  181. package/test/unit/spec/meetings/index.js +146 -2
  182. package/test/unit/spec/member/index.js +7 -0
  183. package/test/unit/spec/member/util.js +24 -0
  184. package/test/unit/spec/members/index.js +304 -78
  185. package/test/unit/spec/members/request.js +68 -22
  186. package/test/unit/spec/members/utils.js +75 -0
  187. package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
  188. package/test/unit/spec/reachability/clusterReachability.ts +88 -56
  189. package/test/unit/spec/reachability/index.ts +97 -0
  190. package/test/unit/spec/reachability/request.js +47 -2
  191. package/test/unit/spec/reconnection-manager/index.js +4 -4
  192. package/test/unit/spec/roap/turnDiscovery.ts +110 -28
  193. package/test/unit/spec/webinar/index.ts +5 -0
  194. package/dist/annotation/annotation.types.d.ts +0 -42
  195. package/dist/annotation/constants.d.ts +0 -31
  196. package/dist/annotation/index.d.ts +0 -117
  197. package/dist/breakouts/breakout.d.ts +0 -8
  198. package/dist/breakouts/collection.d.ts +0 -5
  199. package/dist/breakouts/edit-lock-error.d.ts +0 -15
  200. package/dist/breakouts/events.d.ts +0 -8
  201. package/dist/breakouts/index.d.ts +0 -5
  202. package/dist/breakouts/request.d.ts +0 -22
  203. package/dist/breakouts/utils.d.ts +0 -15
  204. package/dist/common/browser-detection.d.ts +0 -9
  205. package/dist/common/collection.d.ts +0 -48
  206. package/dist/common/config.d.ts +0 -2
  207. package/dist/common/errors/captcha-error.d.ts +0 -15
  208. package/dist/common/errors/intent-to-join.d.ts +0 -16
  209. package/dist/common/errors/join-meeting.d.ts +0 -17
  210. package/dist/common/errors/media.d.ts +0 -15
  211. package/dist/common/errors/no-meeting-info.d.ts +0 -14
  212. package/dist/common/errors/parameter.d.ts +0 -15
  213. package/dist/common/errors/password-error.d.ts +0 -15
  214. package/dist/common/errors/permission.d.ts +0 -14
  215. package/dist/common/errors/reclaim-host-role-error.js +0 -149
  216. package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
  217. package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
  218. package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
  219. package/dist/common/errors/reconnection-in-progress.js +0 -33
  220. package/dist/common/errors/reconnection-in-progress.js.map +0 -1
  221. package/dist/common/errors/reconnection.d.ts +0 -15
  222. package/dist/common/errors/stats.d.ts +0 -15
  223. package/dist/common/errors/webex-errors.d.ts +0 -93
  224. package/dist/common/errors/webex-meetings-error.d.ts +0 -20
  225. package/dist/common/events/events-scope.d.ts +0 -17
  226. package/dist/common/events/events.d.ts +0 -12
  227. package/dist/common/events/trigger-proxy.d.ts +0 -2
  228. package/dist/common/events/util.d.ts +0 -2
  229. package/dist/common/logs/logger-config.d.ts +0 -2
  230. package/dist/common/logs/logger-proxy.d.ts +0 -2
  231. package/dist/common/logs/request.d.ts +0 -36
  232. package/dist/common/queue.d.ts +0 -34
  233. package/dist/config.d.ts +0 -72
  234. package/dist/constants.d.ts +0 -1088
  235. package/dist/controls-options-manager/constants.d.ts +0 -4
  236. package/dist/controls-options-manager/enums.d.ts +0 -15
  237. package/dist/controls-options-manager/index.d.ts +0 -136
  238. package/dist/controls-options-manager/types.d.ts +0 -43
  239. package/dist/controls-options-manager/util.d.ts +0 -1
  240. package/dist/index.d.ts +0 -7
  241. package/dist/interceptors/index.d.ts +0 -2
  242. package/dist/interceptors/locusRetry.d.ts +0 -27
  243. package/dist/interpretation/collection.d.ts +0 -5
  244. package/dist/interpretation/index.d.ts +0 -5
  245. package/dist/interpretation/siLanguage.d.ts +0 -5
  246. package/dist/locus-info/controlsUtils.d.ts +0 -2
  247. package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
  248. package/dist/locus-info/fullState.d.ts +0 -2
  249. package/dist/locus-info/hostUtils.d.ts +0 -2
  250. package/dist/locus-info/index.d.ts +0 -322
  251. package/dist/locus-info/infoUtils.d.ts +0 -2
  252. package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
  253. package/dist/locus-info/parser.d.ts +0 -272
  254. package/dist/locus-info/selfUtils.d.ts +0 -2
  255. package/dist/media/index.d.ts +0 -34
  256. package/dist/media/properties.d.ts +0 -93
  257. package/dist/media/util.d.ts +0 -2
  258. package/dist/mediaQualityMetrics/config.d.ts +0 -241
  259. package/dist/mediaQualityMetrics/config.js +0 -502
  260. package/dist/mediaQualityMetrics/config.js.map +0 -1
  261. package/dist/meeting/effectsState.js +0 -260
  262. package/dist/meeting/effectsState.js.map +0 -1
  263. package/dist/meeting/in-meeting-actions.d.ts +0 -167
  264. package/dist/meeting/index.d.ts +0 -1825
  265. package/dist/meeting/locusMediaRequest.d.ts +0 -74
  266. package/dist/meeting/muteState.d.ts +0 -178
  267. package/dist/meeting/request.d.ts +0 -295
  268. package/dist/meeting/request.type.d.ts +0 -11
  269. package/dist/meeting/state.d.ts +0 -9
  270. package/dist/meeting/util.d.ts +0 -119
  271. package/dist/meeting/voicea-meeting.d.ts +0 -16
  272. package/dist/meeting-info/collection.d.ts +0 -20
  273. package/dist/meeting-info/index.d.ts +0 -69
  274. package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
  275. package/dist/meeting-info/request.d.ts +0 -22
  276. package/dist/meeting-info/util.d.ts +0 -2
  277. package/dist/meeting-info/utilv2.d.ts +0 -2
  278. package/dist/meetings/collection.d.ts +0 -40
  279. package/dist/meetings/index.d.ts +0 -390
  280. package/dist/meetings/meetings.types.d.ts +0 -4
  281. package/dist/meetings/request.d.ts +0 -27
  282. package/dist/meetings/util.d.ts +0 -18
  283. package/dist/member/index.d.ts +0 -160
  284. package/dist/member/member.types.js +0 -17
  285. package/dist/member/member.types.js.map +0 -1
  286. package/dist/member/types.d.ts +0 -32
  287. package/dist/member/util.d.ts +0 -2
  288. package/dist/members/collection.d.ts +0 -29
  289. package/dist/members/index.d.ts +0 -353
  290. package/dist/members/request.d.ts +0 -114
  291. package/dist/members/types.d.ts +0 -25
  292. package/dist/members/util.d.ts +0 -215
  293. package/dist/metrics/config.js +0 -276
  294. package/dist/metrics/config.js.map +0 -1
  295. package/dist/metrics/constants.d.ts +0 -70
  296. package/dist/metrics/index.d.ts +0 -45
  297. package/dist/multistream/mediaRequestManager.d.ts +0 -119
  298. package/dist/multistream/receiveSlot.d.ts +0 -68
  299. package/dist/multistream/receiveSlotManager.d.ts +0 -56
  300. package/dist/multistream/remoteMedia.d.ts +0 -72
  301. package/dist/multistream/remoteMediaGroup.d.ts +0 -49
  302. package/dist/multistream/remoteMediaManager.d.ts +0 -300
  303. package/dist/multistream/sendSlotManager.d.ts +0 -69
  304. package/dist/networkQualityMonitor/index.d.ts +0 -70
  305. package/dist/networkQualityMonitor/index.js +0 -221
  306. package/dist/networkQualityMonitor/index.js.map +0 -1
  307. package/dist/peer-connection-manager/index.js +0 -671
  308. package/dist/peer-connection-manager/index.js.map +0 -1
  309. package/dist/peer-connection-manager/util.js +0 -109
  310. package/dist/peer-connection-manager/util.js.map +0 -1
  311. package/dist/personal-meeting-room/index.d.ts +0 -47
  312. package/dist/personal-meeting-room/request.d.ts +0 -14
  313. package/dist/personal-meeting-room/util.d.ts +0 -2
  314. package/dist/reachability/clusterReachability.d.ts +0 -109
  315. package/dist/reachability/index.d.ts +0 -105
  316. package/dist/reachability/request.d.ts +0 -39
  317. package/dist/reachability/util.d.ts +0 -8
  318. package/dist/reactions/constants.d.ts +0 -3
  319. package/dist/reactions/reactions.d.ts +0 -4
  320. package/dist/reactions/reactions.type.d.ts +0 -52
  321. package/dist/reconnection-manager/index.d.ts +0 -136
  322. package/dist/recording-controller/enums.d.ts +0 -7
  323. package/dist/recording-controller/index.d.ts +0 -207
  324. package/dist/recording-controller/util.d.ts +0 -14
  325. package/dist/roap/collection.js +0 -62
  326. package/dist/roap/collection.js.map +0 -1
  327. package/dist/roap/handler.js +0 -275
  328. package/dist/roap/handler.js.map +0 -1
  329. package/dist/roap/index.d.ts +0 -86
  330. package/dist/roap/request.d.ts +0 -39
  331. package/dist/roap/state.js +0 -126
  332. package/dist/roap/state.js.map +0 -1
  333. package/dist/roap/turnDiscovery.d.ts +0 -155
  334. package/dist/roap/util.js +0 -75
  335. package/dist/roap/util.js.map +0 -1
  336. package/dist/rtcMetrics/constants.d.ts +0 -4
  337. package/dist/rtcMetrics/constants.js +0 -11
  338. package/dist/rtcMetrics/constants.js.map +0 -1
  339. package/dist/rtcMetrics/index.d.ts +0 -61
  340. package/dist/rtcMetrics/index.js +0 -197
  341. package/dist/rtcMetrics/index.js.map +0 -1
  342. package/dist/statsAnalyzer/global.d.ts +0 -36
  343. package/dist/statsAnalyzer/global.js +0 -126
  344. package/dist/statsAnalyzer/global.js.map +0 -1
  345. package/dist/statsAnalyzer/index.d.ts +0 -217
  346. package/dist/statsAnalyzer/index.js +0 -1013
  347. package/dist/statsAnalyzer/index.js.map +0 -1
  348. package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
  349. package/dist/statsAnalyzer/mqaUtil.js +0 -179
  350. package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
  351. package/dist/transcription/index.d.ts +0 -64
  352. package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
  353. package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
  354. package/dist/types/networkQualityMonitor/index.d.ts +0 -70
  355. package/dist/types/rtcMetrics/constants.d.ts +0 -4
  356. package/dist/types/rtcMetrics/index.d.ts +0 -71
  357. package/dist/types/statsAnalyzer/global.d.ts +0 -36
  358. package/dist/types/statsAnalyzer/index.d.ts +0 -217
  359. package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
  360. package/dist/webinar/collection.d.ts +0 -16
  361. package/dist/webinar/index.d.ts +0 -5
@@ -19,6 +19,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpe
19
19
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
20
20
  var _lodash = require("lodash");
21
21
  var _common = require("@webex/common");
22
+ var _events = require("events");
22
23
  var _webexCore = require("@webex/webex-core");
23
24
  var _constants = require("../constants");
24
25
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
@@ -214,14 +215,6 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
214
215
  localMedias.roapMessage = request.roapMessage;
215
216
  localMedias.reachability = request.reachability;
216
217
  body.clientMediaPreferences = request.clientMediaPreferences;
217
-
218
- // @ts-ignore
219
- this.webex.internal.newMetrics.submitClientEvent({
220
- name: 'client.locus.media.request',
221
- options: {
222
- meetingId: this.config.meetingId
223
- }
224
- });
225
218
  break;
226
219
  }
227
220
  if (request.sequence) {
@@ -236,25 +229,21 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
236
229
  if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {
237
230
  this.confluenceState = 'creation in progress';
238
231
  }
239
-
240
- // @ts-ignore
241
- return this.request({
232
+ var upload = new _events.EventEmitter();
233
+ var download = new _events.EventEmitter();
234
+ var options = {
242
235
  method: _constants.HTTP_VERBS.PUT,
243
236
  uri: uri,
244
- body: body
245
- }).then(function (result) {
237
+ body: body,
238
+ upload: upload,
239
+ download: download
240
+ };
241
+
242
+ // @ts-ignore
243
+ var promise = this.request(options).then(function (result) {
246
244
  if (isRequestAffectingConfluenceState(request)) {
247
245
  _this4.confluenceState = 'created';
248
246
  }
249
- if (request.type === 'RoapMessage') {
250
- // @ts-ignore
251
- _this4.webex.internal.newMetrics.submitClientEvent({
252
- name: 'client.locus.media.response',
253
- options: {
254
- meetingId: _this4.config.meetingId
255
- }
256
- });
257
- }
258
247
  return result;
259
248
  }).catch(function (e) {
260
249
  if (isRequestAffectingConfluenceState(request) && _this4.confluenceState === 'creation in progress') {
@@ -272,6 +261,16 @@ var LocusMediaRequest = exports.LocusMediaRequest = /*#__PURE__*/function (_Webe
272
261
  }
273
262
  throw e;
274
263
  });
264
+ if (request.type === 'RoapMessage') {
265
+ var setupProgressListener = function setupProgressListener(direction, eventEmitter) {
266
+ eventEmitter.on('progress', function (progressEvent) {
267
+ _loggerProxy.default.logger.info("".concat(request.type, ": ").concat(direction, " Progress, Timestamp: ").concat(progressEvent.timeStamp, ", Progress: ").concat(progressEvent.loaded, "/").concat(progressEvent.total));
268
+ });
269
+ };
270
+ setupProgressListener('Upload', options.upload);
271
+ setupProgressListener('Download', options.download);
272
+ }
273
+ return promise;
275
274
  }
276
275
 
277
276
  /**
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","require","_common","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","forEach","d","resolve","catch","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","_inherits2","_super","config","options","_this2","_assertThisInitialized2","isRequestInProgress","queuedRequests","confluenceState","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","sendHttpRequest","_this4","uri","concat","selfUrl","MEDIA","_this$getLatestMuteSt","body","device","correlationId","localMedias","respOnlySdp","usingResource","reachability","clientMediaPreferences","webex","internal","newMetrics","submitClientEvent","name","meetingId","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","method","HTTP_VERBS","PUT","rawError","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","promise","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer} from '@webex/common';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.request',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n // @ts-ignore\n return this.request({\n method: HTTP_VERBS.PUT,\n uri,\n body,\n })\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n },\n });\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AAAsD,SAAAM,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA,sBALtD;AAkCA;AAAA,IACMC,mBAAmB;EAKvB;EACA,SAAAA,oBACEC,OAAgB,EAChBC,cAAqB,EACrBC,aAA2D,EAC3D;IAAA,IAAAC,gBAAA,CAAApB,OAAA,QAAAgB,mBAAA;IAAA,IAAAK,gBAAA,CAAArB,OAAA;IAAA,IAAAqB,gBAAA,CAAArB,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,MAAM,CAACxC,IAAI,CACrB,6FACF,CAAC;UAED,OAAOiD,QAAA,CAAA5G,OAAA,CAAQoC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B;MACF;MAEA,IAAMlB,cAAc,GAAG,IAAI2F,aAAK,CAAC,CAAC;MAElC,IAAMC,UAAU,GAAG,IAAI9F,mBAAmB,CACxCC,OAAO,EACPC,cAAc,EACd,IAAI,CAACuD,eAAe,CAACsC,IAAI,CAAC,IAAI,CAChC,CAAC;MAED,IAAI,CAACrD,UAAU,CAACoD,UAAU,CAAC;MAE3B,IAAAE,aAAK,EAAC;QAAA,OAAMP,MAAI,CAAC1C,wBAAwB,CAAC,CAAC;MAAA,EAAC;MAE5C,OAAO7C,cAAc,CAAC+F,OAAO;IAC/B;;IAEA;EAAA;IAAAzF,GAAA;IAAAC,KAAA,EACA,SAAAyF,oBAAA,EAA6B;MAC3B,OAAO,IAAI,CAACzD,eAAe,KAAK,SAAS;IAC3C;;IAEA;AACF;AACA;EAFE;IAAAjC,GAAA;IAAAC,KAAA,EAGA,SAAA0F,qCAAA,EAA8C;MAC5C,IAAI,CAAChE,MAAM,CAACiE,iBAAiB,GAAG,IAAI;IACtC;EAAC;EAAA,OAAAtE,iBAAA;AAAA,EAnPoCuE,sBAAW"}
1
+ {"version":3,"names":["_lodash","require","_common","_events","_webexCore","_constants","_loggerProxy","_interopRequireDefault","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","InternalRequestInfo","request","pendingPromise","sendRequestFn","_classCallCheck2","_defineProperty2","pendingPromises","_createClass2","key","value","getPendingPromises","addPendingPromises","_this$pendingPromises","push","_toConsumableArray2","execute","_this","then","forEach","d","resolve","catch","reject","isRequestAffectingConfluenceState","type","roapMessage","messageType","ROAP","ROAP_TYPES","OFFER","LocusMediaRequest","exports","_WebexPlugin","_inherits2","_super","config","options","_this2","_assertThisInitialized2","isRequestInProgress","queuedRequests","confluenceState","addToQueue","info","length","filter","r","executeNextQueuedRequest","_this3","nextRequest","shift","getLatestMuteState","audioMuted","latestAudioMuted","undefined","videoMuted","latestVideoMuted","sendHttpRequest","_this4","uri","concat","selfUrl","MEDIA","_this$getLatestMuteSt","body","device","correlationId","localMedias","respOnlySdp","usingResource","reachability","clientMediaPreferences","sequence","localSdp","_stringify","mediaId","LoggerProxy","logger","upload","EventEmitter","download","method","HTTP_VERBS","PUT","promise","webex","internal","newMetrics","submitClientEvent","name","meetingId","rawError","setupProgressListener","direction","eventEmitter","on","progressEvent","timeStamp","loaded","total","send","_this5","_request$muteOptions","muteOptions","_promise","Defer","newRequest","bind","defer","isConfluenceCreated","downgradeFromMultistreamToTranscoded","preferTranscoding","WebexPlugin"],"sources":["locusMediaRequest.ts"],"sourcesContent":["/* eslint-disable valid-jsdoc */\nimport {defer} from 'lodash';\nimport {Defer, transferEvents} from '@webex/common';\nimport {EventEmitter} from 'events';\nimport {WebexPlugin} from '@webex/webex-core';\nimport {MEDIA, HTTP_VERBS, ROAP} from '../constants';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {ClientMediaPreferences} from '../reachability/reachability.types';\n\nexport type MediaRequestType = 'RoapMessage' | 'LocalMute';\nexport type RequestResult = any;\n\nexport type RoapRequest = {\n type: 'RoapMessage';\n selfUrl: string;\n mediaId: string;\n roapMessage: any;\n reachability: any;\n clientMediaPreferences: ClientMediaPreferences;\n sequence?: any;\n};\n\nexport type LocalMuteRequest = {\n type: 'LocalMute';\n selfUrl: string;\n mediaId: string;\n sequence?: any;\n muteOptions: {\n audioMuted?: boolean;\n videoMuted?: boolean;\n };\n};\n\nexport type Request = RoapRequest | LocalMuteRequest;\n\n/** Class representing a single /media request being sent to Locus */\nclass InternalRequestInfo {\n public readonly request: Request;\n private pendingPromises: Defer[];\n private sendRequestFn: (request: Request) => Promise<RequestResult>;\n\n /** Constructor */\n constructor(\n request: Request,\n pendingPromise: Defer,\n sendRequestFn: (request: Request) => Promise<RequestResult>\n ) {\n this.request = request;\n this.pendingPromises = [pendingPromise];\n this.sendRequestFn = sendRequestFn;\n }\n\n /**\n * Returns the list of pending promises associated with this request\n */\n public getPendingPromises() {\n return this.pendingPromises;\n }\n\n /**\n * Adds promises to the list of pending promises associated with this request\n */\n public addPendingPromises(pendingPromises: Defer[]) {\n this.pendingPromises.push(...pendingPromises);\n }\n\n /**\n * Executes the request. Returned promise is resolved once the request\n * is completed (no matter if it succeeded or failed).\n */\n public execute(): Promise<void> {\n return this.sendRequestFn(this.request)\n .then((result) => {\n // resolve all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.resolve(result));\n })\n .catch((e) => {\n // reject all the pending promises associated with this request\n this.pendingPromises.forEach((d) => d.reject(e));\n });\n }\n}\n\nexport type Config = {\n device: {\n url: string;\n deviceType: string;\n countryCode?: string;\n regionCode?: string;\n };\n correlationId: string;\n meetingId: string;\n preferTranscoding: boolean;\n};\n\n/**\n * Returns true if the request is triggering confluence creation in the server\n */\nfunction isRequestAffectingConfluenceState(request: Request): boolean {\n return (\n request.type === 'RoapMessage' && request.roapMessage.messageType === ROAP.ROAP_TYPES.OFFER\n );\n}\n\n/**\n * This class manages all /media API requests to Locus. Every call to that\n * Locus API has to go through this class.\n */\nexport class LocusMediaRequest extends WebexPlugin {\n private config: Config;\n private latestAudioMuted?: boolean;\n private latestVideoMuted?: boolean;\n private isRequestInProgress: boolean;\n private queuedRequests: InternalRequestInfo[];\n private confluenceState: 'not created' | 'creation in progress' | 'created';\n /**\n * Constructor\n */\n constructor(config: Config, options: any) {\n super({}, options);\n this.isRequestInProgress = false;\n this.queuedRequests = [];\n this.config = config;\n this.confluenceState = 'not created';\n }\n\n /**\n * Add a request to the internal queue.\n */\n private addToQueue(info: InternalRequestInfo) {\n if (info.request.type === 'LocalMute' && this.queuedRequests.length > 0) {\n // We don't need additional local mute requests in the queue.\n // We only need at most 1 local mute or 1 roap request, because\n // roap requests also include mute state, so whatever request\n // is sent out, it will send the latest local mute state.\n // We only need to store the pendingPromises so that they get resolved\n // when the roap request is sent out.\n this.queuedRequests[0].addPendingPromises(info.getPendingPromises());\n\n return;\n }\n\n if (info.request.type === 'RoapMessage' && this.queuedRequests.length > 0) {\n // remove any LocalMute requests from the queue, because this Roap message\n // will also update the mute status in Locus, so they are redundant\n this.queuedRequests = this.queuedRequests.filter((r) => {\n if (r.request.type === 'LocalMute') {\n // we need to keep the pending promises from the local mute request\n // that we're removing from the queue\n info.addPendingPromises(r.getPendingPromises());\n\n return false;\n }\n\n return true;\n });\n }\n\n this.queuedRequests.push(info);\n }\n\n /**\n * Takes the next request from the queue and executes it. Once that\n * request is completed, the next one will be taken from the queue\n * and executed and this is repeated until the queue is empty.\n */\n private executeNextQueuedRequest(): void {\n if (this.isRequestInProgress) {\n return;\n }\n\n const nextRequest = this.queuedRequests.shift();\n\n if (nextRequest) {\n this.isRequestInProgress = true;\n nextRequest.execute().then(() => {\n this.isRequestInProgress = false;\n this.executeNextQueuedRequest();\n });\n }\n }\n\n /**\n * Returns latest requested audio and video mute values. If they have never been\n * requested, we assume audio/video to be muted.\n */\n private getLatestMuteState() {\n const audioMuted = this.latestAudioMuted !== undefined ? this.latestAudioMuted : true;\n const videoMuted = this.latestVideoMuted !== undefined ? this.latestVideoMuted : true;\n\n return {audioMuted, videoMuted};\n }\n\n /**\n * Prepares the uri and body for the media request to be sent to Locus\n */\n private sendHttpRequest(request: Request) {\n const uri = `${request.selfUrl}/${MEDIA}`;\n\n const {audioMuted, videoMuted} = this.getLatestMuteState();\n\n // first setup things common to all requests\n const body: any = {\n device: this.config.device,\n correlationId: this.config.correlationId,\n };\n\n const localMedias: any = {\n audioMuted,\n videoMuted,\n };\n\n // now add things specific to request type\n switch (request.type) {\n case 'LocalMute':\n body.respOnlySdp = true;\n body.usingResource = null;\n break;\n\n case 'RoapMessage':\n localMedias.roapMessage = request.roapMessage;\n localMedias.reachability = request.reachability;\n body.clientMediaPreferences = request.clientMediaPreferences;\n break;\n }\n\n if (request.sequence) {\n body.sequence = request.sequence;\n }\n\n body.localMedias = [\n {\n localSdp: JSON.stringify(localMedias), // this part must be JSON stringified, Locus requires this\n mediaId: request.mediaId,\n },\n ];\n\n LoggerProxy.logger.info(\n `Meeting:LocusMediaRequest#sendHttpRequest --> ${request.type} audioMuted=${audioMuted} videoMuted=${videoMuted}`\n );\n\n if (isRequestAffectingConfluenceState(request) && this.confluenceState === 'not created') {\n this.confluenceState = 'creation in progress';\n }\n\n const upload = new EventEmitter();\n const download = new EventEmitter();\n\n const options = {\n method: HTTP_VERBS.PUT,\n uri,\n body,\n upload,\n download,\n };\n\n // @ts-ignore\n const promise = this.request(options)\n .then((result) => {\n if (isRequestAffectingConfluenceState(request)) {\n this.confluenceState = 'created';\n }\n\n return result;\n })\n .catch((e) => {\n if (\n isRequestAffectingConfluenceState(request) &&\n this.confluenceState === 'creation in progress'\n ) {\n this.confluenceState = 'not created';\n }\n\n if (request.type === 'RoapMessage') {\n // @ts-ignore\n this.webex.internal.newMetrics.submitClientEvent({\n name: 'client.locus.media.response',\n options: {\n meetingId: this.config.meetingId,\n rawError: e,\n },\n });\n }\n\n throw e;\n });\n\n if (request.type === 'RoapMessage') {\n const setupProgressListener = (direction: string, eventEmitter: EventEmitter) => {\n eventEmitter.on('progress', (progressEvent: ProgressEvent) => {\n LoggerProxy.logger.info(\n `${request.type}: ${direction} Progress, Timestamp: ${progressEvent.timeStamp}, Progress: ${progressEvent.loaded}/${progressEvent.total}`\n );\n });\n };\n\n setupProgressListener('Upload', options.upload);\n setupProgressListener('Download', options.download);\n }\n\n return promise;\n }\n\n /**\n * Sends a media request to Locus\n */\n public send(request: Request): Promise<RequestResult> {\n if (request.type === 'LocalMute') {\n const {audioMuted, videoMuted} = request.muteOptions;\n\n if (audioMuted !== undefined) {\n this.latestAudioMuted = audioMuted;\n }\n if (videoMuted !== undefined) {\n this.latestVideoMuted = videoMuted;\n }\n\n if (this.confluenceState === 'not created') {\n // if there is no confluence, there is no point sending out local mute request\n // as it will fail so we just store the latest audio/video muted values\n // and resolve immediately, so that higher layer (MuteState class) doesn't get blocked\n // and can call us again if user mutes/unmutes again before confluence is created\n LoggerProxy.logger.info(\n 'Meeting:LocusMediaRequest#send --> called with LocalMute request before confluence creation'\n );\n\n return Promise.resolve({});\n }\n }\n\n const pendingPromise = new Defer();\n\n const newRequest = new InternalRequestInfo(\n request,\n pendingPromise,\n this.sendHttpRequest.bind(this)\n );\n\n this.addToQueue(newRequest);\n\n defer(() => this.executeNextQueuedRequest());\n\n return pendingPromise.promise;\n }\n\n /** Returns true if a confluence on the server is already created */\n public isConfluenceCreated() {\n return this.confluenceState === 'created';\n }\n\n /**\n * This method needs to be called when we downgrade from multistream to transcoded connection.\n */\n public downgradeFromMultistreamToTranscoded() {\n this.config.preferTranscoding = true;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AAAsD,SAAAO,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,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;IAAAC,KAAA,EACA,SAAAoG,oBAAA,EAA6B;MAC3B,OAAO,IAAI,CAACpE,eAAe,KAAK,SAAS;IAC3C;;IAEA;AACF;AACA;EAFE;IAAAjC,GAAA;IAAAC,KAAA,EAGA,SAAAqG,qCAAA,EAA8C;MAC5C,IAAI,CAAC3E,MAAM,CAAC4E,iBAAiB,GAAG,IAAI;IACtC;EAAC;EAAA,OAAAjF,iBAAA;AAAA,EAvPoCkF,sBAAW"}
@@ -117,8 +117,10 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
117
117
  }, {
118
118
  key: "enable",
119
119
  value: function enable(meeting, _enable) {
120
- this.state.client.enabled = _enable;
121
- this.applyClientStateToServer(meeting);
120
+ if (_enable !== this.state.client.enabled) {
121
+ this.state.client.enabled = _enable;
122
+ this.applyClientStateToServer(meeting);
123
+ }
122
124
  }
123
125
 
124
126
  /**
@@ -148,7 +150,6 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
148
150
  * @public
149
151
  * @memberof MuteState
150
152
  * @param {Object} [meeting] the meeting object
151
- * @param {Boolean} [mute] true for muting, false for unmuting request
152
153
  * @returns {void}
153
154
  */
154
155
  }, {
@@ -309,7 +310,6 @@ var MuteState = exports.MuteState = /*#__PURE__*/function () {
309
310
  * @param {Meeting} meeting
310
311
  * @returns {void}
311
312
  */
312
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
313
313
  }, {
314
314
  key: "applyUnmuteAllowedToStream",
315
315
  value: function applyUnmuteAllowedToStream(meeting) {
@@ -1 +1 @@
1
- {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_parameter","_util","_constants","createMuteState","exports","type","meeting","enabled","LoggerProxy","logger","info","concat","id","muteState","MuteState","_meeting$remoteVideoM","_meeting$unmuteVideoA","_classCallCheck2","default","_defineProperty2","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","_createClass2","key","value","init","_meeting$mediaPropert","_meeting$mediaPropert2","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","handleLocalStreamChange","enable","mute","reason","_meeting$mediaPropert3","setServerMuted","_meeting$mediaPropert4","handleLocalStreamMuteStateChange","newMuteState","userMuteState","systemMuteState","_meeting$mediaPropert5","_meeting$mediaPropert6","_meeting$mediaPropert7","userMuted","systemMuted","_meeting$mediaPropert8","_meeting$mediaPropert9","_meeting$mediaPropert10","applyClientStateLocally","getClientLocalMuteState","_this","localMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","_promise","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","_this2","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","_this3","members","muteMember","selfId","_meeting$mediaPropert11","setUnmuteAllowed","_meeting$mediaPropert12","handleServerRemoteMuteUpdate","handleServerLocalUnmuteRequired","_meeting$mediaPropert13","_meeting$mediaPropert14","isMuted","isRemotelyMuted","isUnmuteAllowed","isLocallyMuted"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [mute] true for muting, false for unmuting request\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: any) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n\n // either user or system may have triggered a mute state change, but localMute should reflect both\n let newMuteState: boolean;\n let userMuteState: boolean;\n let systemMuteState: boolean;\n if (this.type === AUDIO) {\n newMuteState = meeting.mediaProperties.audioStream?.muted;\n userMuteState = meeting.mediaProperties.audioStream?.userMuted;\n systemMuteState = meeting.mediaProperties.audioStream?.systemMuted;\n } else {\n newMuteState = meeting.mediaProperties.videoStream?.muted;\n userMuteState = meeting.mediaProperties.videoStream?.userMuted;\n systemMuteState = meeting.mediaProperties.videoStream?.systemMuted;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${newMuteState} (user mute: ${userMuteState}, system mute: ${systemMuteState})`\n );\n\n this.state.client.localMute = newMuteState;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n // failed to apply client state to server, so revert stream mute state to server state\n this.muteLocalStream(\n meeting,\n this.state.server.localMute || this.state.server.remoteMute,\n 'clientRequestFailed'\n );\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.muteLocalStream(meeting, muted, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [unmuteAllowed] whether the user is allowed to unmute self\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting: any, unmuteAllowed: boolean) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute (unmuteAllowed=${unmuteAllowed})`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.server.unmuteAllowed = unmuteAllowed;\n\n this.applyUnmuteAllowedToStream(meeting);\n\n // change user mute state to false, but keep localMute true if overall mute state is still true\n this.muteLocalStream(meeting, false, 'localUnmuteRequired');\n if (this.type === AUDIO) {\n this.state.client.localMute = meeting.mediaProperties.audioStream?.muted;\n } else {\n this.state.client.localMute = meeting.mediaProperties.videoStream?.muted;\n }\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA;AACO,IAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAIE,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,0CAAAC,MAAA,CACoBN,IAAI,0CAAAM,MAAA,CAAuCL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,EAAE,CACjG,CAAC;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACT,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOM,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOaC,SAAS,GAAAV,OAAA,CAAAU,SAAA;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAA,UAAYT,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA,IAAAQ,qBAAA,EAAAC,qBAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,SAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACxD,IAAIb,IAAI,KAAKe,gBAAK,IAAIf,IAAI,KAAKgB,gBAAK,EAAE;MACp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AA,uBAAnCA,uBAAA,CAAqCzD,KAAK;MAC1E,CAAC,MAAM;QAAA,IAAA0D,uBAAA;QACL,IAAI,CAAC/E,KAAK,CAACC,MAAM,CAACC,SAAS,IAAA6E,uBAAA,GAAGjG,OAAO,CAACqC,eAAe,CAACG,WAAW,cAAAyD,uBAAA,uBAAnCA,uBAAA,CAAqC1D,KAAK;MAC1E;MAEA,IAAI,CAACG,wBAAwB,CAAC1C,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA6B,GAAA;IAAAC,KAAA,EAQA,SAAAoE,QAAA,EAAiB;MACf,OACE,IAAI,CAAChF,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAqE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACjF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAsE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAAClF,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAI,GAAA;IAAAC,KAAA,EAOA,SAAAuE,eAAA,EAAwB;MACtB,OAAO,IAAI,CAACtC,uBAAuB,CAAC,CAAC;IACvC;EAAC;EAAA,OAAAvD,SAAA;AAAA"}
1
+ {"version":3,"names":["_loggerProxy","_interopRequireDefault","require","_parameter","_util","_constants","createMuteState","exports","type","meeting","enabled","LoggerProxy","logger","info","concat","id","muteState","MuteState","_meeting$remoteVideoM","_meeting$unmuteVideoA","_classCallCheck2","default","_defineProperty2","AUDIO","VIDEO","ParameterError","ignoreMuteStateChange","state","client","localMute","server","remoteMute","remoteMuted","remoteVideoMuted","unmuteAllowed","unmuteVideoAllowed","syncToServerInProgress","_createClass2","key","value","init","_meeting$mediaPropert","_meeting$mediaPropert2","applyUnmuteAllowedToStream","muteLocalStream","initialMute","mediaProperties","audioStream","muted","videoStream","undefined","applyClientStateToServer","handleLocalStreamChange","enable","mute","reason","_meeting$mediaPropert3","setServerMuted","_meeting$mediaPropert4","handleLocalStreamMuteStateChange","newMuteState","userMuteState","systemMuteState","_meeting$mediaPropert5","_meeting$mediaPropert6","_meeting$mediaPropert7","userMuted","systemMuted","_meeting$mediaPropert8","_meeting$mediaPropert9","_meeting$mediaPropert10","applyClientStateLocally","getClientLocalMuteState","_this","localMuteState","localMuteRequiresSync","remoteMuteRequiresSync","localMuteSyncPromise","sendLocalMuteRequestToServer","_promise","resolve","then","sendRemoteMuteRequestToServer","catch","e","warn","_this2","audioMuted","videoMuted","MeetingUtil","remoteUpdateAudioVideo","locus","locusInfo","handleLocusDelta","remoteUpdateError","reject","_this3","members","muteMember","selfId","_meeting$mediaPropert11","setUnmuteAllowed","_meeting$mediaPropert12","handleServerRemoteMuteUpdate","handleServerLocalUnmuteRequired","_meeting$mediaPropert13","_meeting$mediaPropert14","isMuted","isRemotelyMuted","isUnmuteAllowed","isLocallyMuted"],"sources":["muteState.ts"],"sourcesContent":["import {ServerMuteReason} from '@webex/media-helpers';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport ParameterError from '../common/errors/parameter';\nimport MeetingUtil from './util';\nimport {AUDIO, VIDEO} from '../constants';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const createMuteState = (type, meeting, enabled: boolean) => {\n // todo: remove the meeting argument (SPARK-399695)\n\n LoggerProxy.logger.info(\n `Meeting:muteState#createMuteState --> ${type}: creating MuteState for meeting id ${meeting?.id}`\n );\n\n const muteState = new MuteState(type, meeting, enabled);\n\n return muteState;\n};\n\n/** The purpose of this class is to manage the local and remote mute state and make sure that the server state always matches\n the last requested state by the client.\n\n More info about Locus muting API: https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html#\n\n This class is exported only for unit tests. It should never be instantiated directly with new MuteState(), instead createMuteState() should be called\n*/\nexport class MuteState {\n state: {\n client: {\n enabled: boolean; // indicates if audio/video is enabled at all or not\n localMute: boolean;\n };\n server: {localMute: boolean; remoteMute: boolean; unmuteAllowed: boolean};\n syncToServerInProgress: boolean;\n };\n\n type: any;\n ignoreMuteStateChange: boolean;\n\n /**\n * Constructor\n *\n * @param {String} type - audio or video\n * @param {Object} meeting - the meeting object (used for reading current remote mute status)\n * @param {boolean} enabled - whether the client audio/video is enabled at all\n */\n constructor(type: string, meeting: any, enabled: boolean) {\n if (type !== AUDIO && type !== VIDEO) {\n throw new ParameterError('Mute state is designed for handling audio or video only');\n }\n this.type = type;\n this.ignoreMuteStateChange = false;\n this.state = {\n client: {\n enabled,\n localMute: true,\n },\n server: {\n localMute: true,\n // because remoteVideoMuted and unmuteVideoAllowed are updated seperately, they might be undefined\n remoteMute: type === AUDIO ? meeting.remoteMuted : meeting.remoteVideoMuted ?? false,\n unmuteAllowed: type === AUDIO ? meeting.unmuteAllowed : meeting.unmuteVideoAllowed ?? true,\n },\n syncToServerInProgress: false,\n };\n }\n\n /**\n * Starts the mute state machine. Needs to be called after a new MuteState instance is created.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public init(meeting: any) {\n this.applyUnmuteAllowedToStream(meeting);\n\n // if we are remotely muted, we need to apply that to the local stream now (mute on-entry)\n if (this.state.server.remoteMute) {\n this.muteLocalStream(meeting, this.state.server.remoteMute, 'remotelyMuted');\n }\n\n const initialMute =\n this.type === AUDIO\n ? meeting.mediaProperties.audioStream?.muted\n : meeting.mediaProperties.videoStream?.muted;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#init --> ${this.type}: local stream initial mute state: ${initialMute}`\n );\n\n if (initialMute !== undefined) {\n this.state.client.localMute = initialMute;\n } else {\n // there is no stream, so it's like we are locally muted\n // (this is important especially for transcoded meetings, in which the SDP m-line direction always stays \"sendrecv\")\n this.state.client.localMute = true;\n }\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * This method needs to be called whenever the local audio/video stream has changed.\n * It reapplies the remote mute state onto the new stream and also reads the current\n * local mute state from the stream and updates the internal state machine and sends\n * any required requests to the server.\n *\n * @param {Object} meeting - the meeting object\n * @returns {void}\n */\n public handleLocalStreamChange(meeting: any) {\n return this.init(meeting);\n }\n\n /**\n * Enables/disables audio/video\n *\n * @param {Object} meeting - the meeting object\n * @param {boolean} enable\n * @returns {void}\n */\n public enable(meeting: any, enable: boolean) {\n if (enable !== this.state.client.enabled) {\n this.state.client.enabled = enable;\n\n this.applyClientStateToServer(meeting);\n }\n }\n\n /**\n * Mutes/unmutes local stream\n *\n * @param {Object} meeting - the meeting object\n * @param {Boolean} mute - true to mute the stream, false to unmute it\n * @param {ServerMuteReason} reason - reason for muting/unmuting\n * @returns {void}\n */\n private muteLocalStream(meeting: any, mute: boolean, reason: ServerMuteReason) {\n this.ignoreMuteStateChange = true;\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setServerMuted(mute, reason);\n } else {\n meeting.mediaProperties.videoStream?.setServerMuted(mute, reason);\n }\n this.ignoreMuteStateChange = false;\n }\n\n /**\n * This method should be called when the local stream mute state is changed\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @returns {void}\n */\n public handleLocalStreamMuteStateChange(meeting?: any) {\n if (this.ignoreMuteStateChange) {\n return;\n }\n\n // either user or system may have triggered a mute state change, but localMute should reflect both\n let newMuteState: boolean;\n let userMuteState: boolean;\n let systemMuteState: boolean;\n if (this.type === AUDIO) {\n newMuteState = meeting.mediaProperties.audioStream?.muted;\n userMuteState = meeting.mediaProperties.audioStream?.userMuted;\n systemMuteState = meeting.mediaProperties.audioStream?.systemMuted;\n } else {\n newMuteState = meeting.mediaProperties.videoStream?.muted;\n userMuteState = meeting.mediaProperties.videoStream?.userMuted;\n systemMuteState = meeting.mediaProperties.videoStream?.systemMuted;\n }\n\n LoggerProxy.logger.info(\n `Meeting:muteState#handleLocalStreamMuteStateChange --> ${this.type}: local stream new mute state: ${newMuteState} (user mute: ${userMuteState}, system mute: ${systemMuteState})`\n );\n\n this.state.client.localMute = newMuteState;\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Applies the current mute state to the local stream (by enabling or disabling it accordingly)\n *\n * @public\n * @param {Object} [meeting] the meeting object\n * @param {ServerMuteReason} reason - reason why we're applying our client state to the local stream\n * @memberof MuteState\n * @returns {void}\n */\n public applyClientStateLocally(meeting?: any, reason?: ServerMuteReason) {\n this.muteLocalStream(meeting, this.state.client.localMute, reason);\n }\n\n /** Returns true if client is locally muted - it takes into account not just the client local mute state,\n * but also whether audio/video is enabled at all\n *\n * @returns {boolean}\n */\n private getClientLocalMuteState() {\n return this.state.client.enabled ? this.state.client.localMute : true;\n }\n\n /**\n * Updates the server local and remote mute values so that they match the current client desired state.\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {void}\n */\n private applyClientStateToServer(meeting?: any) {\n if (this.state.syncToServerInProgress) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: request to server in progress, we need to wait for it to complete`\n );\n\n return;\n }\n\n const localMuteState = this.getClientLocalMuteState();\n const localMuteRequiresSync = localMuteState !== this.state.server.localMute;\n const remoteMuteRequiresSync = !localMuteState && this.state.server.remoteMute;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: localMuteRequiresSync: ${localMuteRequiresSync} (${localMuteState} ?= ${this.state.server.localMute})`\n );\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: remoteMuteRequiresSync: ${remoteMuteRequiresSync}`\n );\n\n if (!localMuteRequiresSync && !remoteMuteRequiresSync) {\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: client state already matching server state, nothing to do`\n );\n\n return;\n }\n\n this.state.syncToServerInProgress = true;\n\n // first sync local mute with server\n const localMuteSyncPromise = localMuteRequiresSync\n ? this.sendLocalMuteRequestToServer(meeting)\n : Promise.resolve();\n\n localMuteSyncPromise\n .then(() =>\n // then follow it up with remote mute sync\n remoteMuteRequiresSync ? this.sendRemoteMuteRequestToServer(meeting) : Promise.resolve()\n )\n .then(() => {\n this.state.syncToServerInProgress = false;\n LoggerProxy.logger.info(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: sync with server completed`\n );\n\n // need to check if a new sync is required, because this.state.client may have changed while we were doing the current sync\n this.applyClientStateToServer(meeting);\n })\n .catch((e) => {\n this.state.syncToServerInProgress = false;\n\n LoggerProxy.logger.warn(\n `Meeting:muteState#applyClientStateToServer --> ${this.type}: error: ${e}`\n );\n\n // failed to apply client state to server, so revert stream mute state to server state\n this.muteLocalStream(\n meeting,\n this.state.server.localMute || this.state.server.remoteMute,\n 'clientRequestFailed'\n );\n });\n }\n\n /**\n * Sets the local mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendLocalMuteRequestToServer(meeting?: any) {\n const audioMuted = this.type === AUDIO ? this.getClientLocalMuteState() : undefined;\n const videoMuted = this.type === VIDEO ? this.getClientLocalMuteState() : undefined;\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: sending local mute (audio=${audioMuted}, video=${videoMuted}) to server`\n );\n\n return MeetingUtil.remoteUpdateAudioVideo(meeting, audioMuted, videoMuted)\n .then((locus) => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: local mute (audio=${audioMuted}, video=${videoMuted}) applied to server`\n );\n\n this.state.server.localMute = this.type === AUDIO ? audioMuted : videoMuted;\n\n if (locus) {\n meeting.locusInfo.handleLocusDelta(locus, meeting);\n }\n\n return locus;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendLocalMuteRequestToServer --> ${this.type}: failed to apply local mute (audio=${audioMuted}, video=${videoMuted}) to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /**\n * Sets the remote mute value in the server\n *\n * @private\n * @param {Object} [meeting] the meeting object\n * @memberof MuteState\n * @returns {Promise}\n */\n private sendRemoteMuteRequestToServer(meeting?: any) {\n const remoteMute = this.getClientLocalMuteState();\n\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: sending remote mute:${remoteMute} to server`\n );\n\n return meeting.members\n .muteMember(meeting.members.selfId, remoteMute, this.type === AUDIO)\n .then(() => {\n LoggerProxy.logger.info(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: remote mute:${remoteMute} applied to server`\n );\n\n this.state.server.remoteMute = remoteMute;\n })\n .catch((remoteUpdateError) => {\n LoggerProxy.logger.warn(\n `Meeting:muteState#sendRemoteMuteRequestToServer --> ${this.type}: failed to apply remote mute ${remoteMute} to server: ${remoteUpdateError}`\n );\n\n return Promise.reject(remoteUpdateError);\n });\n }\n\n /** Applies the current value for unmute allowed to the underlying stream\n *\n * @param {Meeting} meeting\n * @returns {void}\n */\n private applyUnmuteAllowedToStream(meeting: any) {\n if (this.type === AUDIO) {\n meeting.mediaProperties.audioStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n } else {\n meeting.mediaProperties.videoStream?.setUnmuteAllowed(this.state.server.unmuteAllowed);\n }\n }\n\n /**\n * This method should be called whenever the server remote mute state is changed\n *\n * @public\n * @memberof MuteState\n * @param {Meeting} meeting\n * @param {Boolean} [muted] true if user is remotely muted, false otherwise\n * @param {Boolean} [unmuteAllowed] indicates if user is allowed to unmute self (false when \"hard mute\" feature is used)\n * @returns {undefined}\n */\n public handleServerRemoteMuteUpdate(meeting: any, muted?: boolean, unmuteAllowed?: boolean) {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerRemoteMuteUpdate --> ${this.type}: updating server remoteMute to (${muted})`\n );\n if (unmuteAllowed !== undefined) {\n this.state.server.unmuteAllowed = unmuteAllowed;\n this.applyUnmuteAllowedToStream(meeting);\n }\n if (muted !== undefined) {\n this.state.server.remoteMute = muted;\n this.muteLocalStream(meeting, muted, 'remotelyMuted');\n }\n }\n\n /**\n * This method should be called whenever we receive from the server a requirement to locally unmute\n *\n * @public\n * @memberof MuteState\n * @param {Object} [meeting] the meeting object\n * @param {Boolean} [unmuteAllowed] whether the user is allowed to unmute self\n * @returns {undefined}\n */\n public handleServerLocalUnmuteRequired(meeting: any, unmuteAllowed: boolean) {\n if (!this.state.client.enabled) {\n LoggerProxy.logger.warn(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received while ${this.type} is disabled -> local unmute will not result in ${this.type} being sent`\n );\n } else {\n LoggerProxy.logger.info(\n `Meeting:muteState#handleServerLocalUnmuteRequired --> ${this.type}: localAudioUnmuteRequired received -> doing local unmute (unmuteAllowed=${unmuteAllowed})`\n );\n }\n\n // todo: I'm seeing \"you can now unmute yourself \" popup when this happens - but same thing happens on web.w.c so we can ignore for now\n this.state.server.remoteMute = false;\n this.state.server.unmuteAllowed = unmuteAllowed;\n\n this.applyUnmuteAllowedToStream(meeting);\n\n // change user mute state to false, but keep localMute true if overall mute state is still true\n this.muteLocalStream(meeting, false, 'localUnmuteRequired');\n if (this.type === AUDIO) {\n this.state.client.localMute = meeting.mediaProperties.audioStream?.muted;\n } else {\n this.state.client.localMute = meeting.mediaProperties.videoStream?.muted;\n }\n\n this.applyClientStateToServer(meeting);\n }\n\n /**\n * Returns true if the user is locally or remotely muted.\n * It only checks the mute status, ignoring the fact whether audio/video is enabled.\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isMuted() {\n return (\n this.state.client.localMute || this.state.server.localMute || this.state.server.remoteMute\n );\n }\n\n /**\n * Returns true if the user is remotely muted\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isRemotelyMuted() {\n return this.state.server.remoteMute;\n }\n\n /**\n * Returns true if unmute is allowed\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isUnmuteAllowed() {\n return this.state.server.unmuteAllowed;\n }\n\n /**\n * Returns true if the user is locally muted or audio/video is disabled\n *\n * @public\n * @memberof MuteState\n * @returns {Boolean}\n */\n public isLocallyMuted() {\n return this.getClientLocalMuteState();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,KAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA;AACO,IAAMI,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAIE,IAAI,EAAEC,OAAO,EAAEC,OAAgB,EAAK;EAClE;;EAEAC,oBAAW,CAACC,MAAM,CAACC,IAAI,0CAAAC,MAAA,CACoBN,IAAI,0CAAAM,MAAA,CAAuCL,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEM,EAAE,CACjG,CAAC;EAED,IAAMC,SAAS,GAAG,IAAIC,SAAS,CAACT,IAAI,EAAEC,OAAO,EAAEC,OAAO,CAAC;EAEvD,OAAOM,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOaC,SAAS,GAAAV,OAAA,CAAAU,SAAA;EAapB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,SAAAA,UAAYT,IAAY,EAAEC,OAAY,EAAEC,OAAgB,EAAE;IAAA,IAAAQ,qBAAA,EAAAC,qBAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAJ,SAAA;IAAA,IAAAK,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IAAA,IAAAC,gBAAA,CAAAD,OAAA;IACxD,IAAIb,IAAI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uBAAA;QACvB,IAAI,CAAC9E,KAAK,CAACC,MAAM,CAACC,SAAS,IAAA4E,uBAAA,GAAGhG,OAAO,CAACqC,eAAe,CAACC,WAAW,cAAA0D,uBAAA,uBAAnCA,uBAAA,CAAqCzD,KAAK;MAC1E,CAAC,MAAM;QAAA,IAAA0D,uBAAA;QACL,IAAI,CAAC/E,KAAK,CAACC,MAAM,CAACC,SAAS,IAAA6E,uBAAA,GAAGjG,OAAO,CAACqC,eAAe,CAACG,WAAW,cAAAyD,uBAAA,uBAAnCA,uBAAA,CAAqC1D,KAAK;MAC1E;MAEA,IAAI,CAACG,wBAAwB,CAAC1C,OAAO,CAAC;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EAPE;IAAA6B,GAAA;IAAAC,KAAA,EAQA,SAAAoE,QAAA,EAAiB;MACf,OACE,IAAI,CAAChF,KAAK,CAACC,MAAM,CAACC,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACD,SAAS,IAAI,IAAI,CAACF,KAAK,CAACG,MAAM,CAACC,UAAU;IAE9F;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAqE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAACjF,KAAK,CAACG,MAAM,CAACC,UAAU;IACrC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAO,GAAA;IAAAC,KAAA,EAOA,SAAAsE,gBAAA,EAAyB;MACvB,OAAO,IAAI,CAAClF,KAAK,CAACG,MAAM,CAACI,aAAa;IACxC;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAI,GAAA;IAAAC,KAAA,EAOA,SAAAuE,eAAA,EAAwB;MACtB,OAAO,IAAI,CAACtC,uBAAuB,CAAC,CAAC;IACvC;EAAC;EAAA,OAAAvD,SAAA;AAAA"}
@@ -869,6 +869,36 @@ var MeetingRequest = exports.default = /*#__PURE__*/function (_StatelessWebexPlu
869
869
  }
870
870
  });
871
871
  }
872
+
873
+ /**
874
+ * Sends a request to set post meeting data consent.
875
+ *
876
+ * @param {Object} options - The options for post meeting data consent request.
877
+ * @param {boolean} options.consent - Whether accepted or declined.
878
+ * @param {string} options.locusUrl - The URL of the locus.
879
+ * @param {string} options.deviceUrl - The URL of the device.
880
+ * @param {string} options.selfId - The ID of the participant.
881
+ * @returns {Promise}
882
+ */
883
+ }, {
884
+ key: "setPostMeetingDataConsent",
885
+ value: function setPostMeetingDataConsent(_ref15) {
886
+ var postMeetingDataConsent = _ref15.postMeetingDataConsent,
887
+ locusUrl = _ref15.locusUrl,
888
+ deviceUrl = _ref15.deviceUrl,
889
+ selfId = _ref15.selfId;
890
+ var uri = "".concat(locusUrl, "/").concat(_constants.PARTICIPANT, "/").concat(selfId, "/").concat(_constants.CONTROLS);
891
+ return this.locusDeltaRequest({
892
+ method: _constants.HTTP_VERBS.PATCH,
893
+ uri: uri,
894
+ body: {
895
+ consent: {
896
+ postMeetingDataConsent: postMeetingDataConsent,
897
+ deviceUrl: deviceUrl
898
+ }
899
+ }
900
+ });
901
+ }
872
902
  }]);
873
903
  return MeetingRequest;
874
904
  }(_webexCore.StatelessWebexPlugin);