@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15

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 (252) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -0
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js.map +1 -1
  6. package/dist/common/errors/captcha-error.js +5 -5
  7. package/dist/common/errors/captcha-error.js.map +1 -1
  8. package/dist/common/errors/intent-to-join.js +5 -5
  9. package/dist/common/errors/intent-to-join.js.map +1 -1
  10. package/dist/common/errors/join-meeting.js +6 -6
  11. package/dist/common/errors/join-meeting.js.map +1 -1
  12. package/dist/common/errors/media.js +5 -5
  13. package/dist/common/errors/media.js.map +1 -1
  14. package/dist/common/errors/parameter.js +5 -5
  15. package/dist/common/errors/parameter.js.map +1 -1
  16. package/dist/common/errors/password-error.js +5 -5
  17. package/dist/common/errors/password-error.js.map +1 -1
  18. package/dist/common/errors/permission.js +4 -4
  19. package/dist/common/errors/permission.js.map +1 -1
  20. package/dist/common/errors/reconnection.js +5 -5
  21. package/dist/common/errors/reconnection.js.map +1 -1
  22. package/dist/common/errors/stats.js +5 -5
  23. package/dist/common/errors/stats.js.map +1 -1
  24. package/dist/common/errors/webex-errors.js.map +1 -1
  25. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  26. package/dist/common/events/events-scope.js.map +1 -1
  27. package/dist/common/events/events.js.map +1 -1
  28. package/dist/common/events/trigger-proxy.js.map +1 -1
  29. package/dist/common/events/util.js.map +1 -1
  30. package/dist/common/logs/logger-proxy.js.map +1 -1
  31. package/dist/common/logs/request.js.map +1 -1
  32. package/dist/config.js.map +1 -1
  33. package/dist/constants.js.map +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/locus-info/controlsUtils.js.map +1 -1
  36. package/dist/locus-info/fullState.js.map +1 -1
  37. package/dist/locus-info/hostUtils.js.map +1 -1
  38. package/dist/locus-info/index.js +11 -8
  39. package/dist/locus-info/index.js.map +1 -1
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  42. package/dist/locus-info/parser.js +2 -1
  43. package/dist/locus-info/parser.js.map +1 -1
  44. package/dist/locus-info/selfUtils.js +2 -1
  45. package/dist/locus-info/selfUtils.js.map +1 -1
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/internal-media-core-wrapper.js.map +1 -1
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/media/util.js +1 -1
  50. package/dist/media/util.js.map +1 -1
  51. package/dist/mediaQualityMetrics/config.js.map +1 -1
  52. package/dist/meeting/effectsState.js +1 -1
  53. package/dist/meeting/effectsState.js.map +1 -1
  54. package/dist/meeting/in-meeting-actions.js.map +1 -1
  55. package/dist/meeting/index.js +118 -89
  56. package/dist/meeting/index.js.map +1 -1
  57. package/dist/meeting/muteState.js +1 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +25 -0
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/request.type.js +8 -0
  62. package/dist/meeting/request.type.js.map +1 -0
  63. package/dist/meeting/state.js +5 -5
  64. package/dist/meeting/state.js.map +1 -1
  65. package/dist/meeting/util.js.map +1 -1
  66. package/dist/meeting-info/collection.js.map +1 -1
  67. package/dist/meeting-info/index.js +2 -2
  68. package/dist/meeting-info/index.js.map +1 -1
  69. package/dist/meeting-info/meeting-info-v2.js +48 -48
  70. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  71. package/dist/meeting-info/request.js.map +1 -1
  72. package/dist/meeting-info/util.js.map +1 -1
  73. package/dist/meeting-info/utilv2.js +1 -1
  74. package/dist/meeting-info/utilv2.js.map +1 -1
  75. package/dist/meetings/collection.js.map +1 -1
  76. package/dist/meetings/index.js +251 -250
  77. package/dist/meetings/index.js.map +1 -1
  78. package/dist/meetings/request.js +2 -2
  79. package/dist/meetings/request.js.map +1 -1
  80. package/dist/meetings/util.js +14 -14
  81. package/dist/meetings/util.js.map +1 -1
  82. package/dist/member/index.js +31 -31
  83. package/dist/member/index.js.map +1 -1
  84. package/dist/member/util.js.map +1 -1
  85. package/dist/members/collection.js.map +1 -1
  86. package/dist/members/index.js +43 -43
  87. package/dist/members/index.js.map +1 -1
  88. package/dist/members/request.js.map +1 -1
  89. package/dist/members/util.js.map +1 -1
  90. package/dist/metrics/config.js.map +1 -1
  91. package/dist/metrics/constants.js.map +1 -1
  92. package/dist/metrics/index.js +23 -20
  93. package/dist/metrics/index.js.map +1 -1
  94. package/dist/multistream/multistreamMedia.js +2 -1
  95. package/dist/multistream/multistreamMedia.js.map +1 -1
  96. package/dist/multistream/receiveSlot.js.map +1 -1
  97. package/dist/multistream/receiveSlotManager.js +2 -0
  98. package/dist/multistream/receiveSlotManager.js.map +1 -1
  99. package/dist/multistream/remoteMedia.js.map +1 -1
  100. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  101. package/dist/multistream/remoteMediaManager.js.map +1 -1
  102. package/dist/networkQualityMonitor/index.js +8 -8
  103. package/dist/networkQualityMonitor/index.js.map +1 -1
  104. package/dist/personal-meeting-room/index.js +7 -7
  105. package/dist/personal-meeting-room/index.js.map +1 -1
  106. package/dist/personal-meeting-room/request.js.map +1 -1
  107. package/dist/personal-meeting-room/util.js.map +1 -1
  108. package/dist/reachability/index.js.map +1 -1
  109. package/dist/reachability/request.js.map +1 -1
  110. package/dist/reactions/reactions.js.map +1 -1
  111. package/dist/reactions/reactions.type.js +3 -1
  112. package/dist/reactions/reactions.type.js.map +1 -1
  113. package/dist/reconnection-manager/index.js +4 -4
  114. package/dist/reconnection-manager/index.js.map +1 -1
  115. package/dist/roap/index.js +5 -5
  116. package/dist/roap/index.js.map +1 -1
  117. package/dist/roap/request.js.map +1 -1
  118. package/dist/roap/turnDiscovery.js.map +1 -1
  119. package/dist/statsAnalyzer/global.js.map +1 -1
  120. package/dist/statsAnalyzer/index.js.map +1 -1
  121. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  122. package/dist/transcription/index.js +4 -1
  123. package/dist/transcription/index.js.map +1 -1
  124. package/internal-README.md +7 -6
  125. package/package.json +18 -18
  126. package/src/common/browser-detection.ts +9 -6
  127. package/src/common/collection.ts +3 -1
  128. package/src/common/errors/captcha-error.ts +6 -6
  129. package/src/common/errors/intent-to-join.ts +6 -6
  130. package/src/common/errors/join-meeting.ts +12 -8
  131. package/src/common/errors/media.ts +6 -6
  132. package/src/common/errors/parameter.ts +9 -6
  133. package/src/common/errors/password-error.ts +6 -6
  134. package/src/common/errors/permission.ts +5 -5
  135. package/src/common/errors/reconnection.ts +6 -6
  136. package/src/common/errors/stats.ts +6 -6
  137. package/src/common/errors/webex-errors.ts +7 -5
  138. package/src/common/errors/webex-meetings-error.ts +1 -1
  139. package/src/common/events/events-scope.ts +5 -1
  140. package/src/common/events/events.ts +5 -1
  141. package/src/common/events/trigger-proxy.ts +8 -3
  142. package/src/common/events/util.ts +1 -2
  143. package/src/common/logs/logger-proxy.ts +21 -10
  144. package/src/common/logs/request.ts +11 -8
  145. package/src/config.ts +11 -11
  146. package/src/constants.ts +1 -1
  147. package/src/index.js +1 -1
  148. package/src/locus-info/controlsUtils.ts +34 -24
  149. package/src/locus-info/fullState.ts +15 -11
  150. package/src/locus-info/hostUtils.ts +4 -3
  151. package/src/locus-info/index.ts +25 -34
  152. package/src/locus-info/infoUtils.ts +12 -4
  153. package/src/locus-info/mediaSharesUtils.ts +4 -4
  154. package/src/locus-info/parser.ts +45 -68
  155. package/src/locus-info/selfUtils.ts +106 -57
  156. package/src/media/index.ts +123 -135
  157. package/src/media/internal-media-core-wrapper.ts +2 -2
  158. package/src/media/properties.ts +30 -20
  159. package/src/media/util.ts +1 -1
  160. package/src/mediaQualityMetrics/config.ts +46 -46
  161. package/src/meeting/effectsState.ts +35 -35
  162. package/src/meeting/in-meeting-actions.ts +7 -3
  163. package/src/meeting/index.ts +1576 -1291
  164. package/src/meeting/muteState.ts +62 -31
  165. package/src/meeting/request.ts +174 -113
  166. package/src/meeting/request.type.ts +11 -0
  167. package/src/meeting/state.ts +45 -30
  168. package/src/meeting/util.ts +101 -70
  169. package/src/meeting-info/collection.ts +2 -1
  170. package/src/meeting-info/index.ts +32 -30
  171. package/src/meeting-info/meeting-info-v2.ts +106 -108
  172. package/src/meeting-info/request.ts +9 -3
  173. package/src/meeting-info/util.ts +54 -46
  174. package/src/meeting-info/utilv2.ts +59 -53
  175. package/src/meetings/collection.ts +1 -1
  176. package/src/meetings/index.ts +512 -440
  177. package/src/meetings/request.ts +26 -24
  178. package/src/meetings/util.ts +29 -29
  179. package/src/member/index.ts +55 -49
  180. package/src/member/util.ts +26 -13
  181. package/src/members/collection.ts +0 -1
  182. package/src/members/index.ts +182 -126
  183. package/src/members/request.ts +46 -14
  184. package/src/members/util.ts +44 -42
  185. package/src/metrics/config.ts +254 -81
  186. package/src/metrics/constants.ts +0 -2
  187. package/src/metrics/index.ts +84 -71
  188. package/src/multistream/multistreamMedia.ts +1 -0
  189. package/src/multistream/receiveSlot.ts +1 -0
  190. package/src/multistream/receiveSlotManager.ts +1 -0
  191. package/src/multistream/remoteMedia.ts +1 -1
  192. package/src/multistream/remoteMediaGroup.ts +2 -1
  193. package/src/multistream/remoteMediaManager.ts +3 -0
  194. package/src/networkQualityMonitor/index.ts +20 -23
  195. package/src/personal-meeting-room/index.ts +12 -16
  196. package/src/personal-meeting-room/request.ts +10 -3
  197. package/src/personal-meeting-room/util.ts +3 -3
  198. package/src/reachability/index.ts +61 -59
  199. package/src/reachability/request.ts +36 -32
  200. package/src/reactions/reactions.ts +4 -4
  201. package/src/reactions/reactions.type.ts +4 -3
  202. package/src/reconnection-manager/index.ts +139 -84
  203. package/src/roap/index.ts +46 -38
  204. package/src/roap/request.ts +44 -31
  205. package/src/roap/turnDiscovery.ts +59 -30
  206. package/src/statsAnalyzer/global.ts +30 -33
  207. package/src/statsAnalyzer/index.ts +432 -175
  208. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  209. package/src/transcription/index.ts +34 -32
  210. package/test/integration/spec/journey.js +663 -462
  211. package/test/integration/spec/space-meeting.js +318 -203
  212. package/test/integration/spec/transcription.js +6 -7
  213. package/test/unit/spec/common/browser-detection.js +9 -28
  214. package/test/unit/spec/fixture/locus.js +92 -90
  215. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  216. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  217. package/test/unit/spec/locus-info/index.js +1 -2
  218. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  219. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  220. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  221. package/test/unit/spec/locus-info/parser.js +3 -9
  222. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  223. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  224. package/test/unit/spec/meeting/effectsState.js +36 -46
  225. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  226. package/test/unit/spec/meeting/index.js +1342 -684
  227. package/test/unit/spec/meeting/muteState.js +42 -33
  228. package/test/unit/spec/meeting/request.js +75 -45
  229. package/test/unit/spec/meeting/utils.js +78 -53
  230. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  231. package/test/unit/spec/meeting-info/request.js +7 -9
  232. package/test/unit/spec/meeting-info/util.js +11 -12
  233. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  234. package/test/unit/spec/meetings/collection.js +1 -1
  235. package/test/unit/spec/meetings/index.js +438 -257
  236. package/test/unit/spec/meetings/utils.js +14 -12
  237. package/test/unit/spec/member/index.js +0 -1
  238. package/test/unit/spec/member/util.js +5 -6
  239. package/test/unit/spec/members/index.js +104 -54
  240. package/test/unit/spec/members/request.js +29 -20
  241. package/test/unit/spec/members/utils.js +8 -5
  242. package/test/unit/spec/metrics/index.js +16 -21
  243. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  244. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  245. package/test/unit/spec/reachability/index.ts +9 -11
  246. package/test/unit/spec/reconnection-manager/index.js +16 -18
  247. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  248. package/test/unit/spec/stats-analyzer/index.js +25 -20
  249. package/test/utils/cmr.js +44 -42
  250. package/test/utils/testUtils.js +83 -74
  251. package/test/utils/webex-config.js +18 -18
  252. package/test/utils/webex-test-users.js +53 -50
@@ -4,11 +4,7 @@
4
4
  /* globals navigator */
5
5
 
6
6
  import LoggerProxy from '../common/logs/logger-proxy';
7
- import {
8
- AUDIO_INPUT,
9
- VIDEO_INPUT,
10
- MEDIA_TRACK_CONSTRAINT,
11
- } from '../constants';
7
+ import {AUDIO_INPUT, VIDEO_INPUT, MEDIA_TRACK_CONSTRAINT} from '../constants';
12
8
  import Config from '../config';
13
9
  import StaticConfig from '../common/config';
14
10
  import MediaError from '../common/errors/media';
@@ -77,10 +73,10 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
77
73
  {
78
74
  localSdp: JSON.stringify({
79
75
  audioMuted,
80
- videoMuted
76
+ videoMuted,
81
77
  }),
82
- mediaId
83
- }
78
+ mediaId,
79
+ },
84
80
  ];
85
81
  }
86
82
 
@@ -94,9 +90,7 @@ Media.generateLocalMedias = (mediaId: string, audioMuted: boolean, videoMuted: b
94
90
  * @returns {Promise}
95
91
  */
96
92
  Media.getLocalMedia = (options: any, config: object) => {
97
- const {
98
- sendAudio, sendVideo, sendShare, sharePreferences, isSharing
99
- } = options;
93
+ const {sendAudio, sendVideo, sendShare, sharePreferences, isSharing} = options;
100
94
 
101
95
  if (sendAudio || sendVideo) {
102
96
  return Media.getMedia(sendAudio, sendVideo, config);
@@ -107,7 +101,7 @@ Media.getLocalMedia = (options: any, config: object) => {
107
101
  {
108
102
  sendAudio: false,
109
103
  sendShare: true,
110
- sharePreferences
104
+ sharePreferences,
111
105
  },
112
106
  config
113
107
  );
@@ -136,31 +130,25 @@ Media.createMediaConnection = (
136
130
  options: {
137
131
  mediaProperties?: {
138
132
  mediaDirection?: {
139
- receiveAudio: boolean,
140
- receiveVideo: boolean,
141
- receiveShare: boolean,
142
- },
143
- audioTrack?: MediaStreamTrack,
144
- videoTrack?: MediaStreamTrack,
145
- shareTrack?: MediaStreamTrack
146
- },
147
- remoteQualityLevel?: 'LOW'|'MEDIUM'|'HIGH',
148
- enableRtx?: boolean,
149
- enableExtmap?: boolean,
133
+ receiveAudio: boolean;
134
+ receiveVideo: boolean;
135
+ receiveShare: boolean;
136
+ };
137
+ audioTrack?: MediaStreamTrack;
138
+ videoTrack?: MediaStreamTrack;
139
+ shareTrack?: MediaStreamTrack;
140
+ };
141
+ remoteQualityLevel?: 'LOW' | 'MEDIUM' | 'HIGH';
142
+ enableRtx?: boolean;
143
+ enableExtmap?: boolean;
150
144
  turnServerInfo?: {
151
- url: string,
152
- username: string,
153
- password: string
154
- }
145
+ url: string;
146
+ username: string;
147
+ password: string;
148
+ };
155
149
  }
156
150
  ) => {
157
- const {
158
- mediaProperties,
159
- remoteQualityLevel,
160
- enableRtx,
161
- enableExtmap,
162
- turnServerInfo
163
- } = options;
151
+ const {mediaProperties, remoteQualityLevel, enableRtx, enableExtmap, turnServerInfo} = options;
164
152
 
165
153
  const iceServers = [];
166
154
 
@@ -168,57 +156,58 @@ Media.createMediaConnection = (
168
156
  iceServers.push({
169
157
  urls: turnServerInfo.url,
170
158
  username: turnServerInfo.username || '',
171
- credential: turnServerInfo.password || ''
159
+ credential: turnServerInfo.password || '',
172
160
  });
173
161
  }
174
162
 
175
163
  if (isMultistream) {
176
- return new MultistreamRoapMediaConnection({
177
- iceServers,
178
- }, debugId);
164
+ return new MultistreamRoapMediaConnection(
165
+ {
166
+ iceServers,
167
+ },
168
+ debugId
169
+ );
179
170
  }
180
171
 
181
172
  if (!mediaProperties) {
182
173
  throw new Error('mediaProperties have to be provided for non-multistream media connections');
183
174
  }
184
175
 
185
- const {
186
- mediaDirection,
187
- audioTrack,
188
- videoTrack,
189
- shareTrack
190
- } = mediaProperties;
191
-
192
-
193
- return new RoapMediaConnection({
194
- iceServers,
195
- skipInactiveTransceivers: false,
196
- requireH264: true,
197
- sdpMunging: {
198
- convertPort9to0: false,
199
- addContentSlides: true,
200
- bandwidthLimits: {
201
- audio: StaticConfig.meetings.bandwidth.audio,
202
- video: StaticConfig.meetings.bandwidth.video,
176
+ const {mediaDirection, audioTrack, videoTrack, shareTrack} = mediaProperties;
177
+
178
+ return new RoapMediaConnection(
179
+ {
180
+ iceServers,
181
+ skipInactiveTransceivers: false,
182
+ requireH264: true,
183
+ sdpMunging: {
184
+ convertPort9to0: false,
185
+ addContentSlides: true,
186
+ bandwidthLimits: {
187
+ audio: StaticConfig.meetings.bandwidth.audio,
188
+ video: StaticConfig.meetings.bandwidth.video,
189
+ },
190
+ startBitrate: StaticConfig.meetings.bandwidth.startBitrate,
191
+ periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way
192
+ disableExtmap: !enableExtmap,
193
+ disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP
203
194
  },
204
- startBitrate: StaticConfig.meetings.bandwidth.startBitrate,
205
- periodicKeyframes: 20, // it's always been hardcoded in SDK so for now keeping it that way
206
- disableExtmap: !enableExtmap,
207
- disableRtx: !enableRtx, // see https://bugs.chromium.org/p/chromium/issues/detail?id=1020642 why we might want to remove RTX from SDP
208
- }
209
- }, {
210
- send: {
211
- audio: audioTrack,
212
- video: videoTrack,
213
- screenShareVideo: shareTrack
214
195
  },
215
- receive: {
216
- audio: mediaDirection.receiveAudio,
217
- video: mediaDirection.receiveVideo,
218
- screenShareVideo: mediaDirection.receiveShare,
219
- remoteQualityLevel
220
- }
221
- }, debugId);
196
+ {
197
+ send: {
198
+ audio: audioTrack,
199
+ video: videoTrack,
200
+ screenShareVideo: shareTrack,
201
+ },
202
+ receive: {
203
+ audio: mediaDirection.receiveAudio,
204
+ video: mediaDirection.receiveVideo,
205
+ screenShareVideo: mediaDirection.receiveShare,
206
+ remoteQualityLevel,
207
+ },
208
+ },
209
+ debugId
210
+ );
222
211
  };
223
212
 
224
213
  /**
@@ -252,38 +241,31 @@ Media.getDisplayMedia = (
252
241
  const hasSharePreferences = options.sharePreferences;
253
242
  const hasCustomConstraints = hasSharePreferences && hasSharePreferences.shareConstraints;
254
243
  const hasHighFrameRate = hasSharePreferences && hasSharePreferences.highFrameRate;
255
- const {
256
- screenResolution,
257
- resolution,
258
- videoShareFrameRate,
259
- screenFrameRate,
260
- aspectRatio
261
- } = Config.meetings;
244
+ const {screenResolution, resolution, videoShareFrameRate, screenFrameRate, aspectRatio} =
245
+ Config.meetings;
262
246
 
263
247
  let shareConstraints: any = {
264
248
  cursor: MEDIA_TRACK_CONSTRAINT.CURSOR.AWLAYS,
265
- aspectRatio
249
+ aspectRatio,
266
250
  };
267
251
 
268
252
  if (hasCustomConstraints) {
269
253
  shareConstraints = hasSharePreferences.shareConstraints;
270
- }
271
- else if (hasHighFrameRate) {
254
+ } else if (hasHighFrameRate) {
272
255
  shareConstraints = {
273
256
  ...shareConstraints,
274
257
  frameRate: videoShareFrameRate,
275
258
  height: resolution.idealHeight,
276
259
  width: resolution.idealWidth,
277
- ...config.resolution
260
+ ...config.resolution,
278
261
  };
279
- }
280
- else {
262
+ } else {
281
263
  shareConstraints = {
282
264
  ...shareConstraints,
283
265
  frameRate: customShareFrameRate || screenFrameRate,
284
266
  height: customResolution.idealHeight || screenResolution.idealHeight,
285
267
  width: customResolution.idealWidth || screenResolution.idealWidth,
286
- ...config.screenResolution
268
+ ...config.screenResolution,
287
269
  };
288
270
  }
289
271
 
@@ -294,15 +276,14 @@ Media.getDisplayMedia = (
294
276
  // to have higher quality, and for developers to control the values
295
277
  // eventually we may have to add the same functionality to chrome, OR conversely, get to with firefox
296
278
 
297
-
298
279
  if (isBrowser('firefox')) {
299
280
  const mediaConfig: any = {
300
281
  audio: options.sendAudio,
301
- video: options.sendShare
282
+ video: options.sendShare,
302
283
  };
303
284
 
304
-
305
- return navigator.mediaDevices.getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
285
+ return navigator.mediaDevices
286
+ .getDisplayMedia({audio: options.sendAudio, video: mediaConfig})
306
287
  .then((stream) => {
307
288
  if (options.sendShare && stream.getVideoTracks().length > 0) {
308
289
  // Firefox has a bug with the spec where changing in the height and width only happens
@@ -311,7 +292,6 @@ Media.getDisplayMedia = (
311
292
  stream.getVideoTracks()[0].applyConstraints(shareConstraints);
312
293
  }
313
294
 
314
-
315
295
  return stream;
316
296
  });
317
297
  }
@@ -341,34 +321,32 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
341
321
  audio,
342
322
  // TODO: Remove temporary workaround once Firefox fixes low constraint issues
343
323
  // eslint-disable-next-line no-nested-ternary
344
- video: video ?
345
- isBrowser('firefox') && video.width && video.width.max === 320 ?
346
- {
347
- deviceId: video.deviceId ? video.deviceId : undefined,
348
- width: 320,
349
- height: 180,
350
- frameRate: video.frameRate ? video.frameRate : undefined,
351
- facingMode: video.facingMode ? video.facingMode : undefined,
352
- } :
353
- {
354
- deviceId: video.deviceId ? video.deviceId : undefined,
355
- width: video.width ? video.width : defaultWidth,
356
- height: video.height ? video.height : defaultHeight,
357
- frameRate: video.frameRate ? video.frameRate : undefined,
358
- facingMode: video.facingMode ? video.facingMode : undefined,
359
- } :
360
- false,
361
- fake: process.env.NODE_ENV === 'test' // Special case to get fake media for Firefox browser for testing
324
+ video: video
325
+ ? isBrowser('firefox') && video.width && video.width.max === 320
326
+ ? {
327
+ deviceId: video.deviceId ? video.deviceId : undefined,
328
+ width: 320,
329
+ height: 180,
330
+ frameRate: video.frameRate ? video.frameRate : undefined,
331
+ facingMode: video.facingMode ? video.facingMode : undefined,
332
+ }
333
+ : {
334
+ deviceId: video.deviceId ? video.deviceId : undefined,
335
+ width: video.width ? video.width : defaultWidth,
336
+ height: video.height ? video.height : defaultHeight,
337
+ frameRate: video.frameRate ? video.frameRate : undefined,
338
+ facingMode: video.facingMode ? video.facingMode : undefined,
339
+ }
340
+ : false,
341
+ fake: process.env.NODE_ENV === 'test', // Special case to get fake media for Firefox browser for testing
362
342
  };
363
343
 
364
- return navigator.mediaDevices
365
- .getUserMedia(mediaConfig)
366
- .catch((err) => {
367
- const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
344
+ return navigator.mediaDevices.getUserMedia(mediaConfig).catch((err) => {
345
+ const logPath = 'Media:index#getMedia --> navigator.mediaDevices.getUserMedia';
368
346
 
369
- LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
370
- throw err;
371
- });
347
+ LoggerProxy.logger.error(`${logPath} failed - ${err} (${err.constraint})`);
348
+ throw err;
349
+ });
372
350
  };
373
351
 
374
352
  /**
@@ -383,24 +361,24 @@ Media.getMedia = (audio: any | boolean, video: any | boolean, config: any) => {
383
361
  * sendVideo: true/false
384
362
  *}
385
363
  */
386
- Media.getSupportedDevice = ({ sendAudio, sendVideo }: { sendAudio: boolean; sendVideo: boolean }) =>
364
+ Media.getSupportedDevice = ({sendAudio, sendVideo}: {sendAudio: boolean; sendVideo: boolean}) =>
387
365
  Promise.resolve().then(() => {
388
366
  if (!navigator.mediaDevices || navigator.mediaDevices.enumerateDevices === undefined) {
389
367
  return {
390
368
  sendAudio: false,
391
- sendVideo: false
369
+ sendVideo: false,
392
370
  };
393
371
  }
394
372
 
395
373
  return navigator.mediaDevices.enumerateDevices().then((devices) => {
396
374
  const supported = {
397
375
  audio: devices.filter((device) => device.kind === AUDIO_INPUT).length > 0,
398
- video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0
376
+ video: devices.filter((device) => device.kind === VIDEO_INPUT).length > 0,
399
377
  };
400
378
 
401
379
  return {
402
380
  sendAudio: supported.audio && sendAudio,
403
- sendVideo: supported.video && sendVideo
381
+ sendVideo: supported.video && sendVideo,
404
382
  };
405
383
  });
406
384
  });
@@ -439,9 +417,10 @@ Media.stopTracks = (track: any) => {
439
417
  if (track && track.stop) {
440
418
  try {
441
419
  track.stop();
442
- }
443
- catch (e) {
444
- LoggerProxy.logger.error(`Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`);
420
+ } catch (e) {
421
+ LoggerProxy.logger.error(
422
+ `Media:index#stopTracks --> Unable to stop the track with state ${track.readyState}, error: ${e}`
423
+ );
445
424
  }
446
425
  }
447
426
  });
@@ -455,7 +434,9 @@ Media.stopTracks = (track: any) => {
455
434
  * @deprecated after v1.89.3
456
435
  */
457
436
  Media.stopStream = (stream: any) => {
458
- LoggerProxy.logger.warn('Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3');
437
+ LoggerProxy.logger.warn(
438
+ 'Media:index#stopStream --> [DEPRECATION WARNING]: stopStream has been deprecated after v1.89.3'
439
+ );
459
440
  if (!stream) {
460
441
  return Promise.resolve();
461
442
  }
@@ -470,8 +451,7 @@ Media.stopStream = (stream: any) => {
470
451
  stream.getTracks().forEach((track) => {
471
452
  track.stop();
472
453
  });
473
- }
474
- else if (stream.stop) {
454
+ } else if (stream.stop) {
475
455
  stream.stop();
476
456
  }
477
457
  });
@@ -510,13 +490,21 @@ Media.getUserMedia = (
510
490
  },
511
491
  config: object
512
492
  ) =>
513
- Media.getLocalMedia({
514
- sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
515
- sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false
516
- }, config).then((localStream) => Media.getLocalMedia({
517
- sendShare: mediaSetting.sendShare,
518
- isSharing: mediaSetting.isSharing,
519
- sharePreferences
520
- }, config).then((shareStream) => [localStream, shareStream]));
493
+ Media.getLocalMedia(
494
+ {
495
+ sendAudio: mediaSetting.sendAudio ? audioVideo.audio || mediaSetting.sendAudio : false,
496
+ sendVideo: mediaSetting.sendVideo ? audioVideo.video || mediaSetting.sendVideo : false,
497
+ },
498
+ config
499
+ ).then((localStream) =>
500
+ Media.getLocalMedia(
501
+ {
502
+ sendShare: mediaSetting.sendShare,
503
+ isSharing: mediaSetting.isSharing,
504
+ sharePreferences,
505
+ },
506
+ config
507
+ ).then((shareStream) => [localStream, shareStream])
508
+ );
521
509
 
522
510
  export default Media;
@@ -5,5 +5,5 @@ import {MediaConnection as MC} from '@webex/internal-media-core';
5
5
  * because they are exported by @webex/internal-media-core as non-writable, non-configurable
6
6
  * properties of MediaConnection and sinon doesn't allow spying on them or stubbing them.
7
7
  */
8
- export const RoapMediaConnection = MC.RoapMediaConnection;
9
- export const MultistreamRoapMediaConnection = MC.MultistreamRoapMediaConnection;
8
+ export const {RoapMediaConnection} = MC;
9
+ export const {MultistreamRoapMediaConnection} = MC;
@@ -1,10 +1,6 @@
1
1
  import {MediaConnection as MC} from '@webex/internal-media-core';
2
2
 
3
- import {
4
- MEETINGS,
5
- PC_BAIL_TIMEOUT,
6
- QUALITY_LEVELS
7
- } from '../constants';
3
+ import {MEETINGS, PC_BAIL_TIMEOUT, QUALITY_LEVELS} from '../constants';
8
4
  import LoggerProxy from '../common/logs/logger-proxy';
9
5
 
10
6
  /**
@@ -137,7 +133,9 @@ export default class MediaProperties {
137
133
  * @returns {void}
138
134
  */
139
135
  unsetRemoteStream() {
140
- LoggerProxy.logger.warn('Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');
136
+ LoggerProxy.logger.warn(
137
+ 'Media:properties#unsetRemoteStream --> [DEPRECATION WARNING]: unsetRemoteStream has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
138
+ );
141
139
  // unsets audio and video only
142
140
  this.unsetRemoteMedia();
143
141
  }
@@ -166,7 +164,9 @@ export default class MediaProperties {
166
164
  * @returns {void}
167
165
  */
168
166
  unsetRemoteStreams() {
169
- LoggerProxy.logger.warn('Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)');
167
+ LoggerProxy.logger.warn(
168
+ 'Media:properties#unsetRemoteStreams --> [DEPRECATION WARNING]: unsetRemoteStreams has been deprecated after v1.89.3 (use unsetRemoteTracks instead)'
169
+ );
170
170
  this.unsetRemoteStream();
171
171
  this.unsetRemoteShare();
172
172
  }
@@ -191,7 +191,9 @@ export default class MediaProperties {
191
191
  * @returns {void}
192
192
  */
193
193
  unsetMediaStreams() {
194
- LoggerProxy.logger.warn('Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)');
194
+ LoggerProxy.logger.warn(
195
+ 'Media:properties#unsetMediaStreams --> [DEPRECATION WARNING]: unsetMediaStreams has been deprecated after v1.89.3 (use unsetMediaTracks instead)'
196
+ );
195
197
  this.unsetLocalVideoTrack();
196
198
  this.unsetRemoteStream();
197
199
  }
@@ -211,9 +213,8 @@ export default class MediaProperties {
211
213
  * @returns {Promise<void>}
212
214
  */
213
215
  waitForMediaConnectionConnected() {
214
- const isConnected = () => (
215
- this.webrtcMediaConnection.getConnectionState() === MC.ConnectionState.Connected
216
- );
216
+ const isConnected = () =>
217
+ this.webrtcMediaConnection.getConnectionState() === MC.ConnectionState.Connected;
217
218
 
218
219
  if (isConnected()) {
219
220
  return Promise.resolve();
@@ -223,11 +224,16 @@ export default class MediaProperties {
223
224
  let timer;
224
225
 
225
226
  const connectionStateListener = () => {
226
- LoggerProxy.logger.log(`Media:properties#waitForMediaConnectionConnected --> connection state: ${this.webrtcMediaConnection.getConnectionState()}`);
227
+ LoggerProxy.logger.log(
228
+ `Media:properties#waitForMediaConnectionConnected --> connection state: ${this.webrtcMediaConnection.getConnectionState()}`
229
+ );
227
230
 
228
231
  if (isConnected()) {
229
232
  clearTimeout(timer);
230
- this.webrtcMediaConnection.off(MC.Event.CONNECTION_STATE_CHANGED, connectionStateListener);
233
+ this.webrtcMediaConnection.off(
234
+ MC.Event.CONNECTION_STATE_CHANGED,
235
+ connectionStateListener
236
+ );
231
237
  resolve();
232
238
  }
233
239
  };
@@ -257,9 +263,10 @@ export default class MediaProperties {
257
263
  const statsResult = await this.webrtcMediaConnection.getStats();
258
264
 
259
265
  statsResult.forEach((report) => allStatsReports.push(report));
260
- }
261
- catch (error) {
262
- LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`);
266
+ } catch (error) {
267
+ LoggerProxy.logger.warn(
268
+ `Media:properties#getCurrentConnectionType --> getStats() failed: ${error}`
269
+ );
263
270
  }
264
271
 
265
272
  const successfulCandidatePairs = allStatsReports.filter(
@@ -270,10 +277,14 @@ export default class MediaProperties {
270
277
 
271
278
  // all of the successful pairs should have the same connection type, so just return the type for the first one
272
279
  successfulCandidatePairs.some((pair) => {
273
- const localCandidate = allStatsReports.find((report) => report.type === 'local-candidate' && report.id === pair.localCandidateId);
280
+ const localCandidate = allStatsReports.find(
281
+ (report) => report.type === 'local-candidate' && report.id === pair.localCandidateId
282
+ );
274
283
 
275
284
  if (localCandidate === undefined) {
276
- LoggerProxy.logger.warn(`Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`);
285
+ LoggerProxy.logger.warn(
286
+ `Media:properties#getCurrentConnectionType --> failed to find local candidate "${pair.localCandidateId}" in getStats() results`
287
+ );
277
288
 
278
289
  return false;
279
290
  }
@@ -282,8 +293,7 @@ export default class MediaProperties {
282
293
 
283
294
  if (localCandidate.relayProtocol) {
284
295
  connectionType = `TURN-${localCandidate.relayProtocol.toUpperCase()}`;
285
- }
286
- else {
296
+ } else {
287
297
  connectionType = localCandidate.protocol?.toUpperCase(); // it will be UDP or TCP
288
298
  }
289
299
 
package/src/media/util.ts CHANGED
@@ -6,7 +6,7 @@ const MediaUtil: any = {};
6
6
 
7
7
  MediaUtil.createMediaStream = (tracks) => {
8
8
  if (!tracks) {
9
- LoggerProxy.logger.error('Media:util#createMediaStream --> Tracks don\'t exist');
9
+ LoggerProxy.logger.error("Media:util#createMediaStream --> Tracks don't exist");
10
10
  }
11
11
  const filtredTracks = tracks.filter((element) => !!element);
12
12