@webex/plugin-meetings 2.37.0 → 2.37.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 (308) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -20
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js +5 -20
  6. package/dist/common/collection.js.map +1 -1
  7. package/dist/common/config.js +0 -7
  8. package/dist/common/config.js.map +1 -1
  9. package/dist/common/errors/captcha-error.js +5 -26
  10. package/dist/common/errors/captcha-error.js.map +1 -1
  11. package/dist/common/errors/intent-to-join.js +5 -26
  12. package/dist/common/errors/intent-to-join.js.map +1 -1
  13. package/dist/common/errors/join-meeting.js +6 -27
  14. package/dist/common/errors/join-meeting.js.map +1 -1
  15. package/dist/common/errors/media.js +5 -26
  16. package/dist/common/errors/media.js.map +1 -1
  17. package/dist/common/errors/parameter.js +5 -33
  18. package/dist/common/errors/parameter.js.map +1 -1
  19. package/dist/common/errors/password-error.js +5 -26
  20. package/dist/common/errors/password-error.js.map +1 -1
  21. package/dist/common/errors/permission.js +4 -25
  22. package/dist/common/errors/permission.js.map +1 -1
  23. package/dist/common/errors/reconnection-in-progress.js +0 -17
  24. package/dist/common/errors/reconnection-in-progress.js.map +1 -1
  25. package/dist/common/errors/reconnection.js +5 -26
  26. package/dist/common/errors/reconnection.js.map +1 -1
  27. package/dist/common/errors/stats.js +5 -26
  28. package/dist/common/errors/stats.js.map +1 -1
  29. package/dist/common/errors/webex-errors.js +7 -46
  30. package/dist/common/errors/webex-errors.js.map +1 -1
  31. package/dist/common/errors/webex-meetings-error.js +1 -24
  32. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  33. package/dist/common/events/events-scope.js +0 -22
  34. package/dist/common/events/events-scope.js.map +1 -1
  35. package/dist/common/events/events.js +0 -23
  36. package/dist/common/events/events.js.map +1 -1
  37. package/dist/common/events/trigger-proxy.js +0 -12
  38. package/dist/common/events/trigger-proxy.js.map +1 -1
  39. package/dist/common/events/util.js +0 -15
  40. package/dist/common/events/util.js.map +1 -1
  41. package/dist/common/logs/logger-config.js +0 -4
  42. package/dist/common/logs/logger-config.js.map +1 -1
  43. package/dist/common/logs/logger-proxy.js +1 -8
  44. package/dist/common/logs/logger-proxy.js.map +1 -1
  45. package/dist/common/logs/request.js +35 -61
  46. package/dist/common/logs/request.js.map +1 -1
  47. package/dist/common/queue.js +4 -14
  48. package/dist/common/queue.js.map +1 -1
  49. package/dist/config.js +1 -5
  50. package/dist/config.js.map +1 -1
  51. package/dist/constants.js +46 -42
  52. package/dist/constants.js.map +1 -1
  53. package/dist/index.js +1 -17
  54. package/dist/index.js.map +1 -1
  55. package/dist/locus-info/controlsUtils.js +10 -28
  56. package/dist/locus-info/controlsUtils.js.map +1 -1
  57. package/dist/locus-info/embeddedAppsUtils.js +3 -26
  58. package/dist/locus-info/embeddedAppsUtils.js.map +1 -1
  59. package/dist/locus-info/fullState.js +0 -15
  60. package/dist/locus-info/fullState.js.map +1 -1
  61. package/dist/locus-info/hostUtils.js +4 -12
  62. package/dist/locus-info/hostUtils.js.map +1 -1
  63. package/dist/locus-info/index.js +101 -193
  64. package/dist/locus-info/index.js.map +1 -1
  65. package/dist/locus-info/infoUtils.js +0 -37
  66. package/dist/locus-info/infoUtils.js.map +1 -1
  67. package/dist/locus-info/mediaSharesUtils.js +12 -38
  68. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  69. package/dist/locus-info/parser.js +87 -123
  70. package/dist/locus-info/parser.js.map +1 -1
  71. package/dist/locus-info/selfUtils.js +16 -81
  72. package/dist/locus-info/selfUtils.js.map +1 -1
  73. package/dist/media/index.js +74 -137
  74. package/dist/media/index.js.map +1 -1
  75. package/dist/media/properties.js +64 -110
  76. package/dist/media/properties.js.map +1 -1
  77. package/dist/media/util.js +3 -17
  78. package/dist/media/util.js.map +1 -1
  79. package/dist/mediaQualityMetrics/config.js +10 -12
  80. package/dist/mediaQualityMetrics/config.js.map +1 -1
  81. package/dist/meeting/effectsState.js +120 -192
  82. package/dist/meeting/effectsState.js.map +1 -1
  83. package/dist/meeting/in-meeting-actions.js +0 -13
  84. package/dist/meeting/in-meeting-actions.js.map +1 -1
  85. package/dist/meeting/index.js +812 -1487
  86. package/dist/meeting/index.js.map +1 -1
  87. package/dist/meeting/muteState.js +31 -78
  88. package/dist/meeting/muteState.js.map +1 -1
  89. package/dist/meeting/request.js +157 -227
  90. package/dist/meeting/request.js.map +1 -1
  91. package/dist/meeting/state.js +21 -31
  92. package/dist/meeting/state.js.map +1 -1
  93. package/dist/meeting/util.js +25 -169
  94. package/dist/meeting/util.js.map +1 -1
  95. package/dist/meeting-info/collection.js +3 -25
  96. package/dist/meeting-info/collection.js.map +1 -1
  97. package/dist/meeting-info/index.js +10 -33
  98. package/dist/meeting-info/index.js.map +1 -1
  99. package/dist/meeting-info/meeting-info-v2.js +179 -268
  100. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  101. package/dist/meeting-info/request.js +1 -16
  102. package/dist/meeting-info/request.js.map +1 -1
  103. package/dist/meeting-info/util.js +98 -183
  104. package/dist/meeting-info/util.js.map +1 -1
  105. package/dist/meeting-info/utilv2.js +137 -228
  106. package/dist/meeting-info/utilv2.js.map +1 -1
  107. package/dist/meetings/collection.js +3 -21
  108. package/dist/meetings/collection.js.map +1 -1
  109. package/dist/meetings/index.js +451 -570
  110. package/dist/meetings/index.js.map +1 -1
  111. package/dist/meetings/request.js +7 -30
  112. package/dist/meetings/request.js.map +1 -1
  113. package/dist/meetings/util.js +94 -148
  114. package/dist/meetings/util.js.map +1 -1
  115. package/dist/member/index.js +49 -89
  116. package/dist/member/index.js.map +1 -1
  117. package/dist/member/util.js +17 -68
  118. package/dist/member/util.js.map +1 -1
  119. package/dist/members/collection.js +2 -12
  120. package/dist/members/collection.js.map +1 -1
  121. package/dist/members/index.js +68 -184
  122. package/dist/members/index.js.map +1 -1
  123. package/dist/members/request.js +21 -56
  124. package/dist/members/request.js.map +1 -1
  125. package/dist/members/util.js +9 -38
  126. package/dist/members/util.js.map +1 -1
  127. package/dist/metrics/config.js +0 -2
  128. package/dist/metrics/config.js.map +1 -1
  129. package/dist/metrics/constants.js +1 -2
  130. package/dist/metrics/constants.js.map +1 -1
  131. package/dist/metrics/index.js +48 -136
  132. package/dist/metrics/index.js.map +1 -1
  133. package/dist/networkQualityMonitor/index.js +28 -57
  134. package/dist/networkQualityMonitor/index.js.map +1 -1
  135. package/dist/peer-connection-manager/index.js +60 -190
  136. package/dist/peer-connection-manager/index.js.map +1 -1
  137. package/dist/peer-connection-manager/util.js +10 -24
  138. package/dist/peer-connection-manager/util.js.map +1 -1
  139. package/dist/personal-meeting-room/index.js +10 -45
  140. package/dist/personal-meeting-room/index.js.map +1 -1
  141. package/dist/personal-meeting-room/request.js +2 -33
  142. package/dist/personal-meeting-room/request.js.map +1 -1
  143. package/dist/personal-meeting-room/util.js +0 -13
  144. package/dist/personal-meeting-room/util.js.map +1 -1
  145. package/dist/reachability/index.js +100 -166
  146. package/dist/reachability/index.js.map +1 -1
  147. package/dist/reachability/request.js +2 -18
  148. package/dist/reachability/request.js.map +1 -1
  149. package/dist/reactions/reactions.js +0 -2
  150. package/dist/reactions/reactions.js.map +1 -1
  151. package/dist/reactions/reactions.type.js +0 -5
  152. package/dist/reactions/reactions.type.js.map +1 -1
  153. package/dist/reconnection-manager/index.js +294 -468
  154. package/dist/reconnection-manager/index.js.map +1 -1
  155. package/dist/roap/collection.js +1 -12
  156. package/dist/roap/collection.js.map +1 -1
  157. package/dist/roap/handler.js +15 -85
  158. package/dist/roap/handler.js.map +1 -1
  159. package/dist/roap/index.js +42 -94
  160. package/dist/roap/index.js.map +1 -1
  161. package/dist/roap/request.js +81 -148
  162. package/dist/roap/request.js.map +1 -1
  163. package/dist/roap/state.js +2 -39
  164. package/dist/roap/state.js.map +1 -1
  165. package/dist/roap/turnDiscovery.js +8 -52
  166. package/dist/roap/turnDiscovery.js.map +1 -1
  167. package/dist/roap/util.js +0 -26
  168. package/dist/roap/util.js.map +1 -1
  169. package/dist/statsAnalyzer/global.js +0 -2
  170. package/dist/statsAnalyzer/global.js.map +1 -1
  171. package/dist/statsAnalyzer/index.js +68 -168
  172. package/dist/statsAnalyzer/index.js.map +1 -1
  173. package/dist/statsAnalyzer/mqaUtil.js +54 -53
  174. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  175. package/dist/transcription/index.js +13 -45
  176. package/dist/transcription/index.js.map +1 -1
  177. package/internal-README.md +7 -6
  178. package/package.json +17 -17
  179. package/src/common/browser-detection.ts +9 -6
  180. package/src/common/collection.ts +3 -1
  181. package/src/common/errors/captcha-error.ts +6 -6
  182. package/src/common/errors/intent-to-join.ts +6 -6
  183. package/src/common/errors/join-meeting.ts +12 -8
  184. package/src/common/errors/media.ts +6 -6
  185. package/src/common/errors/parameter.ts +9 -6
  186. package/src/common/errors/password-error.ts +6 -6
  187. package/src/common/errors/permission.ts +5 -5
  188. package/src/common/errors/reconnection.ts +6 -6
  189. package/src/common/errors/stats.ts +6 -6
  190. package/src/common/errors/webex-errors.ts +7 -5
  191. package/src/common/errors/webex-meetings-error.ts +1 -1
  192. package/src/common/events/events-scope.ts +5 -1
  193. package/src/common/events/events.ts +5 -1
  194. package/src/common/events/trigger-proxy.ts +8 -3
  195. package/src/common/events/util.ts +1 -2
  196. package/src/common/logs/logger-proxy.ts +21 -10
  197. package/src/common/logs/request.ts +11 -8
  198. package/src/config.ts +11 -11
  199. package/src/constants.ts +138 -119
  200. package/src/index.js +1 -1
  201. package/src/locus-info/controlsUtils.ts +34 -24
  202. package/src/locus-info/fullState.ts +15 -11
  203. package/src/locus-info/hostUtils.ts +4 -3
  204. package/src/locus-info/index.ts +25 -34
  205. package/src/locus-info/infoUtils.ts +12 -4
  206. package/src/locus-info/mediaSharesUtils.ts +4 -4
  207. package/src/locus-info/parser.ts +45 -68
  208. package/src/locus-info/selfUtils.ts +106 -57
  209. package/src/media/index.ts +118 -109
  210. package/src/media/properties.ts +26 -20
  211. package/src/media/util.ts +2 -2
  212. package/src/mediaQualityMetrics/config.ts +46 -46
  213. package/src/meeting/effectsState.ts +35 -35
  214. package/src/meeting/in-meeting-actions.ts +7 -3
  215. package/src/meeting/index.ts +1435 -1210
  216. package/src/meeting/muteState.ts +62 -31
  217. package/src/meeting/request.ts +160 -113
  218. package/src/meeting/state.ts +45 -30
  219. package/src/meeting/util.ts +131 -90
  220. package/src/meeting-info/collection.ts +2 -1
  221. package/src/meeting-info/index.ts +32 -30
  222. package/src/meeting-info/meeting-info-v2.ts +106 -108
  223. package/src/meeting-info/request.ts +9 -3
  224. package/src/meeting-info/util.ts +54 -46
  225. package/src/meeting-info/utilv2.ts +59 -53
  226. package/src/meetings/collection.ts +1 -1
  227. package/src/meetings/index.ts +513 -441
  228. package/src/meetings/request.ts +26 -24
  229. package/src/meetings/util.ts +26 -23
  230. package/src/member/index.ts +55 -49
  231. package/src/member/util.ts +26 -13
  232. package/src/members/collection.ts +0 -1
  233. package/src/members/index.ts +172 -121
  234. package/src/members/request.ts +46 -14
  235. package/src/members/util.ts +44 -42
  236. package/src/metrics/config.ts +254 -81
  237. package/src/metrics/constants.ts +0 -2
  238. package/src/metrics/index.ts +84 -71
  239. package/src/networkQualityMonitor/index.ts +20 -23
  240. package/src/peer-connection-manager/index.ts +321 -241
  241. package/src/peer-connection-manager/util.ts +4 -2
  242. package/src/personal-meeting-room/index.ts +12 -16
  243. package/src/personal-meeting-room/request.ts +10 -3
  244. package/src/personal-meeting-room/util.ts +3 -3
  245. package/src/reachability/index.ts +61 -59
  246. package/src/reachability/request.ts +36 -32
  247. package/src/reactions/reactions.ts +4 -4
  248. package/src/reactions/reactions.type.ts +2 -3
  249. package/src/reconnection-manager/index.ts +159 -98
  250. package/src/roap/collection.ts +2 -4
  251. package/src/roap/handler.ts +63 -32
  252. package/src/roap/index.ts +78 -58
  253. package/src/roap/request.ts +69 -54
  254. package/src/roap/state.ts +17 -11
  255. package/src/roap/turnDiscovery.ts +60 -31
  256. package/src/roap/util.ts +39 -31
  257. package/src/statsAnalyzer/global.ts +30 -33
  258. package/src/statsAnalyzer/index.ts +397 -169
  259. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  260. package/src/transcription/index.ts +34 -32
  261. package/test/integration/spec/journey.js +666 -462
  262. package/test/integration/spec/space-meeting.js +318 -203
  263. package/test/integration/spec/transcription.js +6 -7
  264. package/test/unit/spec/common/browser-detection.js +9 -28
  265. package/test/unit/spec/fixture/locus.js +92 -90
  266. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  267. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  268. package/test/unit/spec/locus-info/index.js +1 -2
  269. package/test/unit/spec/locus-info/infoUtils.js +24 -31
  270. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  271. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  272. package/test/unit/spec/locus-info/parser.js +3 -9
  273. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  274. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  275. package/test/unit/spec/meeting/effectsState.js +33 -45
  276. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  277. package/test/unit/spec/meeting/index.js +1141 -649
  278. package/test/unit/spec/meeting/muteState.js +42 -33
  279. package/test/unit/spec/meeting/request.js +56 -45
  280. package/test/unit/spec/meeting/utils.js +66 -49
  281. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  282. package/test/unit/spec/meeting-info/request.js +7 -9
  283. package/test/unit/spec/meeting-info/util.js +11 -12
  284. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  285. package/test/unit/spec/meetings/collection.js +1 -1
  286. package/test/unit/spec/meetings/index.js +438 -257
  287. package/test/unit/spec/meetings/utils.js +14 -12
  288. package/test/unit/spec/member/index.js +0 -1
  289. package/test/unit/spec/member/util.js +5 -6
  290. package/test/unit/spec/members/index.js +84 -35
  291. package/test/unit/spec/members/request.js +29 -20
  292. package/test/unit/spec/members/utils.js +8 -5
  293. package/test/unit/spec/metrics/index.js +16 -21
  294. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  295. package/test/unit/spec/peerconnection-manager/index.js +88 -58
  296. package/test/unit/spec/peerconnection-manager/utils.js +5 -4
  297. package/test/unit/spec/peerconnection-manager/utils.test-fixtures.ts +7 -8
  298. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  299. package/test/unit/spec/reachability/index.ts +9 -11
  300. package/test/unit/spec/reconnection-manager/index.js +14 -17
  301. package/test/unit/spec/roap/index.ts +18 -8
  302. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  303. package/test/unit/spec/roap/util.js +3 -3
  304. package/test/unit/spec/stats-analyzer/index.js +29 -24
  305. package/test/utils/cmr.js +44 -42
  306. package/test/utils/testUtils.js +83 -74
  307. package/test/utils/webex-config.js +18 -18
  308. package/test/utils/webex-test-users.js +53 -50
@@ -8,7 +8,7 @@ import {
8
8
  AUDIO_INPUT,
9
9
  VIDEO_INPUT,
10
10
  PEER_CONNECTION_STATE,
11
- MEDIA_TRACK_CONSTRAINT
11
+ MEDIA_TRACK_CONSTRAINT,
12
12
  } from '../constants';
13
13
  import Config from '../config';
14
14
  import PeerConnectionManager from '../peer-connection-manager';
@@ -82,11 +82,13 @@ Media.reconnectMedia = (
82
82
  meetingId: string;
83
83
  remoteQualityLevel: string;
84
84
  enableRtx: any;
85
- enableExtmap: any
85
+ enableExtmap: any;
86
86
  }
87
87
  ) => {
88
- if (peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED ||
89
- peerConnection.connectionState === PEER_CONNECTION_STATE.FAILED) {
88
+ if (
89
+ peerConnection.connectionState === PEER_CONNECTION_STATE.CLOSED ||
90
+ peerConnection.connectionState === PEER_CONNECTION_STATE.FAILED
91
+ ) {
90
92
  return Promise.reject(new ReconnectionError('Reinitiate peerconnection'));
91
93
  }
92
94
 
@@ -94,7 +96,7 @@ Media.reconnectMedia = (
94
96
  meetingId,
95
97
  remoteQualityLevel,
96
98
  enableRtx,
97
- enableExtmap
99
+ enableExtmap,
98
100
  });
99
101
  };
100
102
 
@@ -111,10 +113,10 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
111
113
  {
112
114
  localSdp: JSON.stringify({
113
115
  audioMuted,
114
- videoMuted
116
+ videoMuted,
115
117
  }),
116
- mediaId
117
- }
118
+ mediaId,
119
+ },
118
120
  ];
119
121
  }
120
122
 
@@ -128,9 +130,7 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
128
130
  * @returns {Promise}
129
131
  */
130
132
  Media.getLocalMedia = (options: any, config: object) => {
131
- const {
132
- sendAudio, sendVideo, sendShare, sharePreferences, isSharing
133
- } = options;
133
+ const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;
134
134
 
135
135
  if (sendAudio || sendVideo) {
136
136
  return Media.getMedia(sendAudio, sendVideo, config);
@@ -141,7 +141,7 @@ Media.getLocalMedia = (options: any, config: object) => {
141
141
  {
142
142
  sendAudio: false,
143
143
  sendShare: true,
144
- sharePreferences
144
+ sharePreferences,
145
145
  },
146
146
  config
147
147
  );
@@ -157,12 +157,15 @@ Media.getLocalMedia = (options: any, config: object) => {
157
157
  * @returns {Object} returns direction tracks to be added in transceiver
158
158
  */
159
159
  Media.checkTracks = (trackType: string, track: object, receiveTracks: boolean) => {
160
+ // eslint-disable-next-line @typescript-eslint/no-shadow
160
161
  const getDirection = (sendTracks, receiveTracks) => {
161
162
  if (sendTracks && receiveTracks) {
162
163
  return 'sendrecv';
163
- } if (sendTracks && !receiveTracks) {
164
+ }
165
+ if (sendTracks && !receiveTracks) {
164
166
  return 'sendonly';
165
- } if (!sendTracks && receiveTracks) {
167
+ }
168
+ if (!sendTracks && receiveTracks) {
166
169
  return 'recvonly';
167
170
  }
168
171
 
@@ -197,37 +200,51 @@ Media.attachMedia = (
197
200
  enableExtmap: any;
198
201
  }
199
202
  ) => {
200
- const {
201
- mediaDirection,
202
- audioTrack,
203
- videoTrack,
204
- shareTrack,
205
- peerConnection
206
- } = mediaProperties;
203
+ const {mediaDirection, audioTrack, videoTrack, shareTrack, peerConnection} = mediaProperties;
207
204
 
208
205
  let result = null;
209
206
 
210
207
  // Add Transceiver for audio
211
- result = Media.checkTracks('audio', mediaDirection.sendAudio && audioTrack, mediaDirection.receiveAudio);
212
- peerConnection.audioTransceiver = peerConnection.addTransceiver(result.track, {direction: result.direction});
208
+ result = Media.checkTracks(
209
+ 'audio',
210
+ mediaDirection.sendAudio && audioTrack,
211
+ mediaDirection.receiveAudio
212
+ );
213
+ peerConnection.audioTransceiver = peerConnection.addTransceiver(result.track, {
214
+ direction: result.direction,
215
+ });
213
216
 
214
217
  // Add Transceiver for video
215
- result = Media.checkTracks('video', mediaDirection.sendVideo && videoTrack, mediaDirection.receiveVideo);
216
- peerConnection.videoTransceiver = peerConnection.addTransceiver(result.track, {direction: result.direction});
218
+ result = Media.checkTracks(
219
+ 'video',
220
+ mediaDirection.sendVideo && videoTrack,
221
+ mediaDirection.receiveVideo
222
+ );
223
+ peerConnection.videoTransceiver = peerConnection.addTransceiver(result.track, {
224
+ direction: result.direction,
225
+ });
217
226
 
218
227
  // Add Transceiver for share
219
- result = Media.checkTracks('video', mediaDirection.sendShare && shareTrack, mediaDirection.receiveShare);
220
- peerConnection.shareTransceiver = peerConnection.addTransceiver(result.track, {direction: result.direction});
228
+ result = Media.checkTracks(
229
+ 'video',
230
+ mediaDirection.sendShare && shareTrack,
231
+ mediaDirection.receiveShare
232
+ );
233
+ peerConnection.shareTransceiver = peerConnection.addTransceiver(result.track, {
234
+ direction: result.direction,
235
+ });
221
236
 
222
237
  peerConnection.onnegotiationneeded = (event) => {
223
- LoggerProxy.logger.info(`Media:index#attachMedia --> onnegotiationneeded#PeerConnection: ${event}`);
238
+ LoggerProxy.logger.info(
239
+ `Media:index#attachMedia --> onnegotiationneeded#PeerConnection: ${event}`
240
+ );
224
241
  };
225
242
 
226
243
  return PeerConnectionManager.createOffer(peerConnection, {
227
244
  meetingId,
228
245
  remoteQualityLevel,
229
246
  enableRtx,
230
- enableExtmap
247
+ enableExtmap,
231
248
  });
232
249
  };
233
250
 
@@ -253,20 +270,14 @@ Media.updateMedia = (
253
270
  enableExtmap: any;
254
271
  }
255
272
  ) => {
256
- const {
257
- mediaDirection,
258
- audioTrack,
259
- videoTrack,
260
- shareTrack,
261
- peerConnection
262
- } = mediaProperties;
273
+ const {mediaDirection, audioTrack, videoTrack, shareTrack, peerConnection} = mediaProperties;
263
274
 
264
275
  // update audio transceiver
265
276
  Media.setTrackOnTransceiver(peerConnection.audioTransceiver, {
266
277
  type: 'audio',
267
278
  track: audioTrack,
268
279
  sendTrack: mediaDirection.sendAudio && audioTrack,
269
- receiveTrack: mediaDirection.receiveAudio
280
+ receiveTrack: mediaDirection.receiveAudio,
270
281
  });
271
282
 
272
283
  // update video transceiver
@@ -274,7 +285,7 @@ Media.updateMedia = (
274
285
  type: 'video',
275
286
  track: videoTrack,
276
287
  sendTrack: mediaDirection.sendVideo && videoTrack,
277
- receiveTrack: mediaDirection.receiveVideo
288
+ receiveTrack: mediaDirection.receiveVideo,
278
289
  });
279
290
 
280
291
  // update content transceiver
@@ -282,17 +293,19 @@ Media.updateMedia = (
282
293
  type: 'video',
283
294
  track: shareTrack,
284
295
  sendTrack: mediaDirection.sendShare && shareTrack,
285
- receiveTrack: mediaDirection.receiveShare
296
+ receiveTrack: mediaDirection.receiveShare,
286
297
  });
287
298
  peerConnection.onnegotiationneeded = (event) => {
288
- LoggerProxy.logger.info(`Media:index#updateMedia --> onnegotiationneeded#PeerConnection: ${event}`);
299
+ LoggerProxy.logger.info(
300
+ `Media:index#updateMedia --> onnegotiationneeded#PeerConnection: ${event}`
301
+ );
289
302
  };
290
303
 
291
304
  return PeerConnectionManager.createOffer(peerConnection, {
292
305
  meetingId,
293
306
  remoteQualityLevel,
294
307
  enableRtx,
295
- enableExtmap
308
+ enableExtmap,
296
309
  });
297
310
  };
298
311
 
@@ -311,9 +324,7 @@ Media.setTrackOnTransceiver = (
311
324
  receiveTrack: any;
312
325
  }
313
326
  ) => {
314
- const {
315
- type, track, sendTrack, receiveTrack
316
- } = options;
327
+ const {type, track, sendTrack, receiveTrack} = options;
317
328
 
318
329
  try {
319
330
  const result = Media.checkTracks(type, sendTrack && track, receiveTrack);
@@ -322,8 +333,7 @@ Media.setTrackOnTransceiver = (
322
333
  if (options.track) {
323
334
  transceiver.sender.replaceTrack(track);
324
335
  }
325
- }
326
- catch (e) {
336
+ } catch (e) {
327
337
  LoggerProxy.logger.error(`Media:index#setTrackOnTransceiver --> ${e}`);
328
338
  throw e;
329
339
  }
@@ -361,7 +371,7 @@ Media.updateTransceiver = (
361
371
  meetingId,
362
372
  remoteQualityLevel,
363
373
  enableRtx,
364
- enableExtmap
374
+ enableExtmap,
365
375
  });
366
376
  };
367
377
 
@@ -396,38 +406,31 @@ Media.getDisplayMedia = (
396
406
  const hasSharePreferences = options.sharePreferences;
397
407
  const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;
398
408
  const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;
399
- const {
400
- screenResolution,
401
- resolution,
402
- videoShareFrameRate,
403
- screenFrameRate,
404
- aspectRatio
405
- } = Config.meetings;
409
+ const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =
410
+ Config.meetings;
406
411
 
407
412
  let shareConstraints: any = {
408
413
  cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
409
- aspectRatio
414
+ aspectRatio,
410
415
  };
411
416
 
412
417
  if (hasCustomConstraints) {
413
418
  shareConstraints = hasSharePreferences.shareConstraints;
414
- }
415
- else if (hasHighFrameRate) {
419
+ } else if (hasHighFrameRate) {
416
420
  shareConstraints = {
417
421
  ...shareConstraints,
418
422
  frameRate: videoShareFrameRate,
419
423
  height: resolution.idealHeight,
420
424
  width: resolution.idealWidth,
421
- ...config.resolution
425
+ ...config.resolution,
422
426
  };
423
- }
424
- else {
427
+ } else {
425
428
  shareConstraints = {
426
429
  ...shareConstraints,
427
430
  frameRate: customShareFrameRate || screenFrameRate,
428
431
  height: customResolution.idealHeight || screenResolution.idealHeight,
429
432
  width: customResolution.idealWidth || screenResolution.idealWidth,
430
- ...config.screenResolution
433
+ ...config.screenResolution,
431
434
  };
432
435
  }
433
436
 
@@ -438,15 +441,14 @@ Media.getDisplayMedia = (
438
441
  // to have higher quality, and for developers to control the values
439
442
  // eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox
440
443
 
441
-
442
444
  if (isBrowser('firefox')) {
443
445
  const mediaConfig: any = {
444
446
  audio: options.sendAudio,
445
- video: options.sendShare
447
+ video: options.sendShare,
446
448
  };
447
449
 
448
-
449
- return navigator.mediaDevices.getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
450
+ return navigator.mediaDevices
451
+ .getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
450
452
  .then((stream) => {
451
453
  if (options.sendShare && stream.getVideoTracks().length > 0) {
452
454
  // Firefox has a bug with the spec where changing in the height and width only happens
@@ -455,7 +457,6 @@ Media.getDisplayMedia = (
455
457
  stream.getVideoTracks()[0].applyConstraints(shareConstraints);
456
458
  }
457
459
 
458
-
459
460
  return stream;
460
461
  });
461
462
  }
@@ -485,34 +486,32 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
485
486
  audio,
486
487
  // TODO: Remove temporary workaround once Firefox fixes low constraint issues
487
488
  // eslint-disable-next-line no-nested-ternary
488
- video: video ?
489
- isBrowser('firefox') && video.width && video.width.max === 320 ?
490
- {
491
- deviceId: video.deviceId ? video.deviceId : undefined,
492
- width: 320,
493
- height: 180,
494
- frameRate: video.frameRate ? video.frameRate : undefined,
495
- facingMode: video.facingMode ? video.facingMode : undefined,
496
- } :
497
- {
498
- deviceId: video.deviceId ? video.deviceId : undefined,
499
- width: video.width ? video.width : defaultWidth,
500
- height: video.height ? video.height : defaultHeight,
501
- frameRate: video.frameRate ? video.frameRate : undefined,
502
- facingMode: video.facingMode ? video.facingMode : undefined,
503
- } :
504
- false,
505
- fake: process.env.NODE_ENV === 'test' // Special case to get fake media for Firefox browser for testing
489
+ video: video
490
+ ? isBrowser('firefox') && video.width && video.width.max === 320
491
+ ? {
492
+ deviceId: video.deviceId ? video.deviceId : undefined,
493
+ width: 320,
494
+ height: 180,
495
+ frameRate: video.frameRate ? video.frameRate : undefined,
496
+ facingMode: video.facingMode ? video.facingMode : undefined,
497
+ }
498
+ : {
499
+ deviceId: video.deviceId ? video.deviceId : undefined,
500
+ width: video.width ? video.width : defaultWidth,
501
+ height: video.height ? video.height : defaultHeight,
502
+ frameRate: video.frameRate ? video.frameRate : undefined,
503
+ facingMode: video.facingMode ? video.facingMode : undefined,
504
+ }
505
+ : false,
506
+ fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing
506
507
  };
507
508
 
508
- return navigator.mediaDevices
509
- .getUserMedia(mediaConfig)
510
- .catch((err) => {
511
- const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
509
+ return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {
510
+ const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
512
511
 
513
- LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
514
- throw err;
515
- });
512
+ LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
513
+ throw err;
514
+ });
516
515
  };
517
516
 
518
517
  /**
@@ -527,24 +526,24 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
527
526
  * sendVideo: true/false
528
527
  *}
529
528
  */
530
- Media.getSupportedDevice = ({ sendAudio, sendVideo }: { sendAudio: boolean; sendVideo: boolean }) =>
529
+ Media.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>
531
530
  Promise.resolve().then(() => {
532
531
  if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
533
532
  return {
534
533
  sendAudio: false,
535
- sendVideo: false
534
+ sendVideo: false,
536
535
  };
537
536
  }
538
537
 
539
538
  return navigator.mediaDevices.enumerateDevices().then((devices) => {
540
539
  const supported = {
541
540
  audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,
542
- video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0
541
+ video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,
543
542
  };
544
543
 
545
544
  return {
546
545
  sendAudio: supported.audio && sendAudio,
547
- sendVideo: supported.video && sendVideo
546
+ sendVideo: supported.video && sendVideo,
548
547
  };
549
548
  });
550
549
  });
@@ -583,9 +582,10 @@ Media.stopTracks = (track: any) => {
583
582
  if (track && track.stop) {
584
583
  try {
585
584
  track.stop();
586
- }
587
- catch (e) {
588
- LoggerProxy.logger.error(`Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`);
585
+ } catch (e) {
586
+ LoggerProxy.logger.error(
587
+ `Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`
588
+ );
589
589
  }
590
590
  }
591
591
  });
@@ -599,7 +599,9 @@ Media.stopTracks = (track: any) => {
599
599
  * @deprecated after v1.89.3
600
600
  */
601
601
  Media.stopStream = (stream: any) => {
602
- LoggerProxy.logger.warn('Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3');
602
+ LoggerProxy.logger.warn(
603
+ 'Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3'
604
+ );
603
605
  if (!stream) {
604
606
  return Promise.resolve();
605
607
  }
@@ -614,8 +616,7 @@ Media.stopStream = (stream: any) => {
614
616
  stream.getTracks().forEach((track) => {
615
617
  track.stop();
616
618
  });
617
- }
618
- else if (stream.stop) {
619
+ } else if (stream.stop) {
619
620
  stream.stop();
620
621
  }
621
622
  });
@@ -654,13 +655,21 @@ Media.getUserMedia = (
654
655
  },
655
656
  config: object
656
657
  ) =>
657
- Media.getLocalMedia({
658
- sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
659
- sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false
660
- }, config).then((localStream) => Media.getLocalMedia({
661
- sendShare: mediaSetting.sendShare,
662
- isSharing: mediaSetting.isSharing,
663
- sharePreferences
664
- }, config).then((shareStream) => [localStream, shareStream]));
658
+ Media.getLocalMedia(
659
+ {
660
+ sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
661
+ sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,
662
+ },
663
+ config
664
+ ).then((localStream) =>
665
+ Media.getLocalMedia(
666
+ {
667
+ sendShare: mediaSetting.sendShare,
668
+ isSharing: mediaSetting.isSharing,
669
+ sharePreferences,
670
+ },
671
+ config
672
+ ).then((shareStream) => [localStream, shareStream])
673
+ );
665
674
 
666
675
  export default Media;
@@ -1,9 +1,4 @@
1
- import {
2
- ICE_STATE,
3
- MEETINGS,
4
- PC_BAIL_TIMEOUT,
5
- QUALITY_LEVELS
6
- } from '../constants';
1
+ import {ICE_STATE, MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
7
2
  import LoggerProxy from '../common/logs/logger-proxy';
8
3
 
9
4
  import MediaUtil from './util';
@@ -142,7 +137,9 @@ export default class MediaProperties {
142
137
  * @returns {void}
143
138
  */
144
139
  unsetRemoteStream() {
145
- LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');
140
+ LoggerProxy.logger.warn(
141
+ 'Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
142
+ );
146
143
  // unsets audio and video only
147
144
  this.unsetRemoteMedia();
148
145
  }
@@ -171,7 +168,9 @@ export default class MediaProperties {
171
168
  * @returns {void}
172
169
  */
173
170
  unsetRemoteStreams() {
174
- LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');
171
+ LoggerProxy.logger.warn(
172
+ 'Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
173
+ );
175
174
  this.unsetRemoteStream();
176
175
  this.unsetRemoteShare();
177
176
  }
@@ -196,7 +195,9 @@ export default class MediaProperties {
196
195
  * @returns {void}
197
196
  */
198
197
  unsetMediaStreams() {
199
- LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');
198
+ LoggerProxy.logger.warn(
199
+ 'Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)'
200
+ );
200
201
  this.unsetLocalVideoTrack();
201
202
  this.unsetRemoteStream();
202
203
  }
@@ -216,10 +217,9 @@ export default class MediaProperties {
216
217
  * @returns {Promise<void>}
217
218
  */
218
219
  waitForIceConnectedState() {
219
- const isIceConnected = () => (
220
+ const isIceConnected = () =>
220
221
  this.peerConnection.iceConnectionState === ICE_STATE.CONNECTED ||
221
- this.peerConnection.iceConnectionState === ICE_STATE.COMPLETED
222
- );
222
+ this.peerConnection.iceConnectionState === ICE_STATE.COMPLETED;
223
223
 
224
224
  if (isIceConnected()) {
225
225
  return Promise.resolve();
@@ -229,7 +229,9 @@ export default class MediaProperties {
229
229
  let timer;
230
230
 
231
231
  const iceListener = () => {
232
- LoggerProxy.logger.log(`Media:properties#waitForIceConnectedState --> ice state: ${this.peerConnection.iceConnectionState}, conn state: ${this.peerConnection.connectionState}`);
232
+ LoggerProxy.logger.log(
233
+ `Media:properties#waitForIceConnectedState --> ice state: ${this.peerConnection.iceConnectionState}, conn state: ${this.peerConnection.connectionState}`
234
+ );
233
235
 
234
236
  if (isIceConnected()) {
235
237
  clearTimeout(timer);
@@ -263,9 +265,10 @@ export default class MediaProperties {
263
265
  const statsResult = await this.peerConnection.getStats();
264
266
 
265
267
  statsResult.forEach((report) => allStatsReports.push(report));
266
- }
267
- catch (error) {
268
- LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`);
268
+ } catch (error) {
269
+ LoggerProxy.logger.warn(
270
+ `Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`
271
+ );
269
272
  }
270
273
 
271
274
  const successfulCandidatePairs = allStatsReports.filter(
@@ -276,10 +279,14 @@ export default class MediaProperties {
276
279
 
277
280
  // all of the successful pairs should have the same connection type, so just return the type for the first one
278
281
  successfulCandidatePairs.some((pair) => {
279
- const localCandidate = allStatsReports.find((report) => report.type === 'local-candidate' && report.id === pair.localCandidateId);
282
+ const localCandidate = allStatsReports.find(
283
+ (report) => report.type === 'local-candidate' && report.id === pair.localCandidateId
284
+ );
280
285
 
281
286
  if (localCandidate === undefined) {
282
- LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`);
287
+ LoggerProxy.logger.warn(
288
+ `Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`
289
+ );
283
290
 
284
291
  return false;
285
292
  }
@@ -288,8 +295,7 @@ export default class MediaProperties {
288
295
 
289
296
  if (localCandidate.relayProtocol) {
290
297
  connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;
291
- }
292
- else {
298
+ } else {
293
299
  connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP
294
300
  }
295
301
 
package/src/media/util.ts CHANGED
@@ -15,7 +15,7 @@ MediaUtil.createPeerConnection = (turnServerInfo) => {
15
15
  config.iceServers.push({
16
16
  urls: turnServerInfo.url,
17
17
  username: turnServerInfo.username || '',
18
- credential: turnServerInfo.password || ''
18
+ credential: turnServerInfo.password || '',
19
19
  });
20
20
  }
21
21
  if (isBrowser('firefox')) {
@@ -27,7 +27,7 @@ MediaUtil.createPeerConnection = (turnServerInfo) => {
27
27
 
28
28
  MediaUtil.createMediaStream = (tracks) => {
29
29
  if (!tracks) {
30
- LoggerProxy.logger.error('Media:util#createMediaStream --> Tracks don\'t exist');
30
+ LoggerProxy.logger.error("Media:util#createMediaStream --> Tracks don't exist");
31
31
  }
32
32
  const filtredTracks = tracks.filter((element) => !!element);
33
33