@webex/plugin-meetings 3.1.0 → 3.3.0

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 (206) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/common/errors/{reconnection-in-progress.js → reconnection-not-started.js} +27 -15
  4. package/dist/common/errors/reconnection-not-started.js.map +1 -0
  5. package/dist/constants.js +12 -3
  6. package/dist/constants.js.map +1 -1
  7. package/dist/index.js +80 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/interpretation/index.js +1 -1
  10. package/dist/interpretation/siLanguage.js +1 -1
  11. package/dist/locus-info/controlsUtils.js +7 -1
  12. package/dist/locus-info/controlsUtils.js.map +1 -1
  13. package/dist/locus-info/index.js +10 -0
  14. package/dist/locus-info/index.js.map +1 -1
  15. package/dist/media/properties.js +102 -57
  16. package/dist/media/properties.js.map +1 -1
  17. package/dist/meeting/in-meeting-actions.js +6 -0
  18. package/dist/meeting/in-meeting-actions.js.map +1 -1
  19. package/dist/meeting/index.js +543 -467
  20. package/dist/meeting/index.js.map +1 -1
  21. package/dist/meeting/locusMediaRequest.js +27 -0
  22. package/dist/meeting/locusMediaRequest.js.map +1 -1
  23. package/dist/meeting/util.js +9 -16
  24. package/dist/meeting/util.js.map +1 -1
  25. package/dist/meeting/voicea-meeting.js +37 -49
  26. package/dist/meeting/voicea-meeting.js.map +1 -1
  27. package/dist/meeting-info/util.js +304 -267
  28. package/dist/meeting-info/util.js.map +1 -1
  29. package/dist/meeting-info/utilv2.js +334 -298
  30. package/dist/meeting-info/utilv2.js.map +1 -1
  31. package/dist/meetings/index.js +6 -27
  32. package/dist/meetings/index.js.map +1 -1
  33. package/dist/reachability/index.js +6 -0
  34. package/dist/reachability/index.js.map +1 -1
  35. package/dist/reconnection-manager/index.js +138 -109
  36. package/dist/reconnection-manager/index.js.map +1 -1
  37. package/dist/roap/request.js +3 -27
  38. package/dist/roap/request.js.map +1 -1
  39. package/dist/statsAnalyzer/index.js +4 -0
  40. package/dist/statsAnalyzer/index.js.map +1 -1
  41. package/dist/statsAnalyzer/mqaUtil.js +3 -0
  42. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  43. package/dist/types/common/errors/reconnection-not-started.d.ts +13 -0
  44. package/dist/{constants.d.ts → types/constants.d.ts} +11 -2
  45. package/dist/types/index.d.ts +19 -0
  46. package/dist/{media → types/media}/properties.d.ts +26 -2
  47. package/dist/{meeting → types/meeting}/in-meeting-actions.d.ts +6 -0
  48. package/dist/{meeting → types/meeting}/index.d.ts +5 -6
  49. package/dist/{meeting → types/meeting}/locusMediaRequest.d.ts +1 -0
  50. package/dist/{meeting → types/meeting}/util.d.ts +3 -0
  51. package/dist/{meeting → types/meeting}/voicea-meeting.d.ts +3 -2
  52. package/dist/{meeting-info → types/meeting-info}/index.d.ts +1 -1
  53. package/dist/{meeting-info → types/meeting-info}/meeting-info-v2.d.ts +1 -1
  54. package/dist/types/meeting-info/util.d.ts +49 -0
  55. package/dist/types/meeting-info/utilv2.d.ts +65 -0
  56. package/dist/{meetings → types/meetings}/index.d.ts +1 -16
  57. package/dist/{reconnection-manager → types/reconnection-manager}/index.d.ts +4 -14
  58. package/dist/webinar/index.js +1 -1
  59. package/package.json +22 -22
  60. package/src/common/errors/reconnection-not-started.ts +25 -0
  61. package/src/constants.ts +12 -4
  62. package/src/index.ts +30 -0
  63. package/src/locus-info/controlsUtils.ts +11 -0
  64. package/src/locus-info/index.ts +16 -0
  65. package/src/media/properties.ts +67 -15
  66. package/src/meeting/in-meeting-actions.ts +12 -0
  67. package/src/meeting/index.ts +121 -98
  68. package/src/meeting/locusMediaRequest.ts +31 -0
  69. package/src/meeting/util.ts +9 -16
  70. package/src/meeting/voicea-meeting.ts +44 -46
  71. package/src/meeting-info/util.ts +241 -233
  72. package/src/meeting-info/utilv2.ts +250 -244
  73. package/src/meetings/index.ts +8 -25
  74. package/src/reachability/index.ts +3 -0
  75. package/src/reconnection-manager/index.ts +128 -105
  76. package/src/roap/request.ts +1 -24
  77. package/src/statsAnalyzer/index.ts +4 -0
  78. package/src/statsAnalyzer/mqaUtil.ts +5 -0
  79. package/test/unit/spec/locus-info/controlsUtils.js +20 -0
  80. package/test/unit/spec/locus-info/index.js +21 -0
  81. package/test/unit/spec/media/properties.ts +145 -140
  82. package/test/unit/spec/meeting/in-meeting-actions.ts +6 -0
  83. package/test/unit/spec/meeting/index.js +243 -97
  84. package/test/unit/spec/meeting/locusMediaRequest.ts +49 -0
  85. package/test/unit/spec/meeting/utils.js +3 -10
  86. package/test/unit/spec/meeting/voicea-meeting.ts +5 -14
  87. package/test/unit/spec/meetings/index.js +27 -8
  88. package/test/unit/spec/reconnection-manager/index.js +127 -39
  89. package/test/unit/spec/roap/request.ts +0 -37
  90. package/test/unit/spec/stats-analyzer/index.js +11 -0
  91. package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
  92. package/dist/common/errors/reconnection-in-progress.js.map +0 -1
  93. package/dist/index.d.ts +0 -7
  94. package/dist/meeting-info/util.d.ts +0 -2
  95. package/dist/meeting-info/utilv2.d.ts +0 -2
  96. package/src/common/errors/reconnection-in-progress.ts +0 -8
  97. /package/dist/{annotation → types/annotation}/annotation.types.d.ts +0 -0
  98. /package/dist/{annotation → types/annotation}/constants.d.ts +0 -0
  99. /package/dist/{annotation → types/annotation}/index.d.ts +0 -0
  100. /package/dist/{breakouts → types/breakouts}/breakout.d.ts +0 -0
  101. /package/dist/{breakouts → types/breakouts}/collection.d.ts +0 -0
  102. /package/dist/{breakouts → types/breakouts}/edit-lock-error.d.ts +0 -0
  103. /package/dist/{breakouts → types/breakouts}/events.d.ts +0 -0
  104. /package/dist/{breakouts → types/breakouts}/index.d.ts +0 -0
  105. /package/dist/{breakouts → types/breakouts}/request.d.ts +0 -0
  106. /package/dist/{breakouts → types/breakouts}/utils.d.ts +0 -0
  107. /package/dist/{common → types/common}/browser-detection.d.ts +0 -0
  108. /package/dist/{common → types/common}/collection.d.ts +0 -0
  109. /package/dist/{common → types/common}/config.d.ts +0 -0
  110. /package/dist/{common → types/common}/errors/captcha-error.d.ts +0 -0
  111. /package/dist/{common → types/common}/errors/intent-to-join.d.ts +0 -0
  112. /package/dist/{common → types/common}/errors/join-meeting.d.ts +0 -0
  113. /package/dist/{common → types/common}/errors/media.d.ts +0 -0
  114. /package/dist/{common → types/common}/errors/no-meeting-info.d.ts +0 -0
  115. /package/dist/{common → types/common}/errors/parameter.d.ts +0 -0
  116. /package/dist/{common → types/common}/errors/password-error.d.ts +0 -0
  117. /package/dist/{common → types/common}/errors/permission.d.ts +0 -0
  118. /package/dist/{common → types/common}/errors/reclaim-host-role-errors.d.ts +0 -0
  119. /package/dist/{common → types/common}/errors/reconnection.d.ts +0 -0
  120. /package/dist/{common → types/common}/errors/stats.d.ts +0 -0
  121. /package/dist/{common → types/common}/errors/webex-errors.d.ts +0 -0
  122. /package/dist/{common → types/common}/errors/webex-meetings-error.d.ts +0 -0
  123. /package/dist/{common → types/common}/events/events-scope.d.ts +0 -0
  124. /package/dist/{common → types/common}/events/events.d.ts +0 -0
  125. /package/dist/{common → types/common}/events/trigger-proxy.d.ts +0 -0
  126. /package/dist/{common → types/common}/events/util.d.ts +0 -0
  127. /package/dist/{common → types/common}/logs/logger-config.d.ts +0 -0
  128. /package/dist/{common → types/common}/logs/logger-proxy.d.ts +0 -0
  129. /package/dist/{common → types/common}/logs/request.d.ts +0 -0
  130. /package/dist/{common → types/common}/queue.d.ts +0 -0
  131. /package/dist/{config.d.ts → types/config.d.ts} +0 -0
  132. /package/dist/{controls-options-manager → types/controls-options-manager}/constants.d.ts +0 -0
  133. /package/dist/{controls-options-manager → types/controls-options-manager}/enums.d.ts +0 -0
  134. /package/dist/{controls-options-manager → types/controls-options-manager}/index.d.ts +0 -0
  135. /package/dist/{controls-options-manager → types/controls-options-manager}/types.d.ts +0 -0
  136. /package/dist/{controls-options-manager → types/controls-options-manager}/util.d.ts +0 -0
  137. /package/dist/{interceptors → types/interceptors}/index.d.ts +0 -0
  138. /package/dist/{interceptors → types/interceptors}/locusRetry.d.ts +0 -0
  139. /package/dist/{interpretation → types/interpretation}/collection.d.ts +0 -0
  140. /package/dist/{interpretation → types/interpretation}/index.d.ts +0 -0
  141. /package/dist/{interpretation → types/interpretation}/siLanguage.d.ts +0 -0
  142. /package/dist/{locus-info → types/locus-info}/controlsUtils.d.ts +0 -0
  143. /package/dist/{locus-info → types/locus-info}/embeddedAppsUtils.d.ts +0 -0
  144. /package/dist/{locus-info → types/locus-info}/fullState.d.ts +0 -0
  145. /package/dist/{locus-info → types/locus-info}/hostUtils.d.ts +0 -0
  146. /package/dist/{locus-info → types/locus-info}/index.d.ts +0 -0
  147. /package/dist/{locus-info → types/locus-info}/infoUtils.d.ts +0 -0
  148. /package/dist/{locus-info → types/locus-info}/mediaSharesUtils.d.ts +0 -0
  149. /package/dist/{locus-info → types/locus-info}/parser.d.ts +0 -0
  150. /package/dist/{locus-info → types/locus-info}/selfUtils.d.ts +0 -0
  151. /package/dist/{media → types/media}/MediaConnectionAwaiter.d.ts +0 -0
  152. /package/dist/{media → types/media}/index.d.ts +0 -0
  153. /package/dist/{media → types/media}/util.d.ts +0 -0
  154. /package/dist/{mediaQualityMetrics → types/mediaQualityMetrics}/config.d.ts +0 -0
  155. /package/dist/{meeting → types/meeting}/muteState.d.ts +0 -0
  156. /package/dist/{meeting → types/meeting}/request.d.ts +0 -0
  157. /package/dist/{meeting → types/meeting}/request.type.d.ts +0 -0
  158. /package/dist/{meeting → types/meeting}/state.d.ts +0 -0
  159. /package/dist/{meeting-info → types/meeting-info}/collection.d.ts +0 -0
  160. /package/dist/{meeting-info → types/meeting-info}/request.d.ts +0 -0
  161. /package/dist/{meetings → types/meetings}/collection.d.ts +0 -0
  162. /package/dist/{meetings → types/meetings}/meetings.types.d.ts +0 -0
  163. /package/dist/{meetings → types/meetings}/request.d.ts +0 -0
  164. /package/dist/{meetings → types/meetings}/util.d.ts +0 -0
  165. /package/dist/{member → types/member}/index.d.ts +0 -0
  166. /package/dist/{member → types/member}/types.d.ts +0 -0
  167. /package/dist/{member → types/member}/util.d.ts +0 -0
  168. /package/dist/{members → types/members}/collection.d.ts +0 -0
  169. /package/dist/{members → types/members}/index.d.ts +0 -0
  170. /package/dist/{members → types/members}/request.d.ts +0 -0
  171. /package/dist/{members → types/members}/types.d.ts +0 -0
  172. /package/dist/{members → types/members}/util.d.ts +0 -0
  173. /package/dist/{metrics → types/metrics}/constants.d.ts +0 -0
  174. /package/dist/{metrics → types/metrics}/index.d.ts +0 -0
  175. /package/dist/{multistream → types/multistream}/mediaRequestManager.d.ts +0 -0
  176. /package/dist/{multistream → types/multistream}/receiveSlot.d.ts +0 -0
  177. /package/dist/{multistream → types/multistream}/receiveSlotManager.d.ts +0 -0
  178. /package/dist/{multistream → types/multistream}/remoteMedia.d.ts +0 -0
  179. /package/dist/{multistream → types/multistream}/remoteMediaGroup.d.ts +0 -0
  180. /package/dist/{multistream → types/multistream}/remoteMediaManager.d.ts +0 -0
  181. /package/dist/{multistream → types/multistream}/sendSlotManager.d.ts +0 -0
  182. /package/dist/{networkQualityMonitor → types/networkQualityMonitor}/index.d.ts +0 -0
  183. /package/dist/{personal-meeting-room → types/personal-meeting-room}/index.d.ts +0 -0
  184. /package/dist/{personal-meeting-room → types/personal-meeting-room}/request.d.ts +0 -0
  185. /package/dist/{personal-meeting-room → types/personal-meeting-room}/util.d.ts +0 -0
  186. /package/dist/{reachability → types/reachability}/clusterReachability.d.ts +0 -0
  187. /package/dist/{reachability → types/reachability}/index.d.ts +0 -0
  188. /package/dist/{reachability → types/reachability}/request.d.ts +0 -0
  189. /package/dist/{reachability → types/reachability}/util.d.ts +0 -0
  190. /package/dist/{reactions → types/reactions}/constants.d.ts +0 -0
  191. /package/dist/{reactions → types/reactions}/reactions.d.ts +0 -0
  192. /package/dist/{reactions → types/reactions}/reactions.type.d.ts +0 -0
  193. /package/dist/{recording-controller → types/recording-controller}/enums.d.ts +0 -0
  194. /package/dist/{recording-controller → types/recording-controller}/index.d.ts +0 -0
  195. /package/dist/{recording-controller → types/recording-controller}/util.d.ts +0 -0
  196. /package/dist/{roap → types/roap}/index.d.ts +0 -0
  197. /package/dist/{roap → types/roap}/request.d.ts +0 -0
  198. /package/dist/{roap → types/roap}/turnDiscovery.d.ts +0 -0
  199. /package/dist/{rtcMetrics → types/rtcMetrics}/constants.d.ts +0 -0
  200. /package/dist/{rtcMetrics → types/rtcMetrics}/index.d.ts +0 -0
  201. /package/dist/{statsAnalyzer → types/statsAnalyzer}/global.d.ts +0 -0
  202. /package/dist/{statsAnalyzer → types/statsAnalyzer}/index.d.ts +0 -0
  203. /package/dist/{statsAnalyzer → types/statsAnalyzer}/mqaUtil.d.ts +0 -0
  204. /package/dist/{transcription → types/transcription}/index.d.ts +0 -0
  205. /package/dist/{webinar → types/webinar}/collection.d.ts +0 -0
  206. /package/dist/{webinar → types/webinar}/index.d.ts +0 -0
@@ -54,189 +54,194 @@ describe('MediaProperties', () => {
54
54
  });
55
55
  });
56
56
 
57
- describe('getCurrentConnectionType', () => {
58
- it('calls waitForMediaConnectionConnected', async () => {
59
- const spy = sinon.stub(mediaProperties, 'waitForMediaConnectionConnected');
57
+ describe('getCurrentConnectionInfo', () => {
58
+ it('handles the case when getStats() fails', async () => {
59
+ mockMC.getStats.rejects(new Error());
60
60
 
61
- await mediaProperties.getCurrentConnectionType();
61
+ const {connectionType, selectedCandidatePairChanges, numTransports} =
62
+ await mediaProperties.getCurrentConnectionInfo();
62
63
 
63
- assert.calledOnce(spy);
64
+ assert.equal(connectionType, 'unknown');
65
+ assert.equal(selectedCandidatePairChanges, -1);
66
+ assert.equal(numTransports, 0);
64
67
  });
65
- it('calls getStats() only after waitForMediaConnectionConnected resolves', async () => {
66
- const waitForMediaConnectionConnectedResult = new Defer();
67
-
68
- const waitForMediaConnectionConnectedStub = sinon
69
- .stub(mediaProperties, 'waitForMediaConnectionConnected')
70
- .returns(waitForMediaConnectionConnectedResult.promise);
71
-
72
- const result = mediaProperties.getCurrentConnectionType();
73
68
 
74
- await testUtils.flushPromises();
69
+ describe('selectedCandidatePairChanges and numTransports', () => {
70
+ it('returns correct values when getStats() returns no transport stats at all', async () => {
71
+ mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
75
72
 
76
- assert.called(waitForMediaConnectionConnectedStub);
77
- assert.notCalled(mockMC.getStats);
73
+ const {selectedCandidatePairChanges, numTransports} =
74
+ await mediaProperties.getCurrentConnectionInfo();
78
75
 
79
- waitForMediaConnectionConnectedResult.resolve();
80
- await testUtils.flushPromises();
76
+ assert.equal(selectedCandidatePairChanges, -1);
77
+ assert.equal(numTransports, 0);
78
+ });
81
79
 
82
- assert.called(mockMC.getStats);
83
- await result;
84
- });
85
- it('rejects if waitForMediaConnectionConnected rejects', async () => {
86
- const waitForMediaConnectionConnectedResult = new Defer();
80
+ it('returns correct values when getStats() returns transport stats without selectedCandidatePairChanges', async () => {
81
+ mockMC.getStats.resolves([{type: 'transport', id: '1234'}]);
87
82
 
88
- const waitForMediaConnectionConnectedStub = sinon
89
- .stub(mediaProperties, 'waitForMediaConnectionConnected')
90
- .returns(waitForMediaConnectionConnectedResult.promise);
83
+ const {selectedCandidatePairChanges, numTransports} =
84
+ await mediaProperties.getCurrentConnectionInfo();
91
85
 
92
- const result = mediaProperties.getCurrentConnectionType();
86
+ assert.equal(selectedCandidatePairChanges, -1);
87
+ assert.equal(numTransports, 1);
88
+ });
93
89
 
94
- await testUtils.flushPromises();
90
+ it('returns correct values when getStats() returns transport stats with selectedCandidatePairChanges', async () => {
91
+ mockMC.getStats.resolves([
92
+ {type: 'transport', id: '1234', selectedCandidatePairChanges: 13},
93
+ ]);
95
94
 
96
- assert.called(waitForMediaConnectionConnectedStub);
95
+ const {selectedCandidatePairChanges, numTransports} =
96
+ await mediaProperties.getCurrentConnectionInfo();
97
97
 
98
- waitForMediaConnectionConnectedResult.reject(new Error('fake error'));
99
- await testUtils.flushPromises();
98
+ assert.equal(selectedCandidatePairChanges, 13);
99
+ assert.equal(numTransports, 1);
100
+ });
100
101
 
101
- assert.notCalled(mockMC.getStats);
102
+ it('returns correct values when getStats() returns multiple transport stats', async () => {
103
+ mockMC.getStats.resolves([
104
+ {type: 'transport', id: '1', selectedCandidatePairChanges: 11},
105
+ {type: 'transport', id: '2', selectedCandidatePairChanges: 12},
106
+ ]);
102
107
 
103
- await assert.isRejected(result);
104
- });
105
- it('returns "unknown" if getStats() fails', async () => {
106
- mockMC.getStats.rejects(new Error());
108
+ const {selectedCandidatePairChanges, numTransports} =
109
+ await mediaProperties.getCurrentConnectionInfo();
107
110
 
108
- const connectionType = await mediaProperties.getCurrentConnectionType();
109
- assert.equal(connectionType, 'unknown');
111
+ assert.equal(selectedCandidatePairChanges, 11); // we expect stats from the first transport to be returned
112
+ assert.equal(numTransports, 2);
113
+ });
110
114
  });
115
+ describe('connectionType', () => {
116
+ it('returns "unknown" if getStats() returns no candidate pairs', async () => {
117
+ mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
111
118
 
112
- it('returns "unknown" if getStats() returns no candidate pairs', async () => {
113
- mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
119
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
120
+ assert.equal(connectionType, 'unknown');
121
+ });
114
122
 
115
- const connectionType = await mediaProperties.getCurrentConnectionType();
116
- assert.equal(connectionType, 'unknown');
117
- });
123
+ it('returns "unknown" if getStats() returns no successful candidate pair', async () => {
124
+ mockMC.getStats.resolves([{type: 'candidate-pair', id: '1234', state: 'inprogress'}]);
118
125
 
119
- it('returns "unknown" if getStats() returns no successful candidate pair', async () => {
120
- mockMC.getStats.resolves([{type: 'candidate-pair', id: '1234', state: 'inprogress'}]);
126
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
127
+ assert.equal(connectionType, 'unknown');
128
+ });
121
129
 
122
- const connectionType = await mediaProperties.getCurrentConnectionType();
123
- assert.equal(connectionType, 'unknown');
124
- });
130
+ it('returns "unknown" if getStats() returns a successful candidate pair but local candidate is missing', async () => {
131
+ mockMC.getStats.resolves([
132
+ {type: 'candidate-pair', id: '1234', state: 'succeeded', localCandidateId: 'wrong id'},
133
+ ]);
125
134
 
126
- it('returns "unknown" if getStats() returns a successful candidate pair but local candidate is missing', async () => {
127
- mockMC.getStats.resolves([
128
- {type: 'candidate-pair', id: '1234', state: 'succeeded', localCandidateId: 'wrong id'},
129
- ]);
135
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
136
+ assert.equal(connectionType, 'unknown');
137
+ });
130
138
 
131
- const connectionType = await mediaProperties.getCurrentConnectionType();
132
- assert.equal(connectionType, 'unknown');
133
- });
139
+ it('returns "UDP" if getStats() returns a successful candidate pair with udp local candidate', async () => {
140
+ mockMC.getStats.resolves([
141
+ {
142
+ type: 'candidate-pair',
143
+ id: 'some candidate pair id',
144
+ state: 'succeeded',
145
+ localCandidateId: 'local candidate id',
146
+ },
147
+ {type: 'local-candidate', id: 'some other candidate id', protocol: 'tcp'},
148
+ {type: 'local-candidate', id: 'local candidate id', protocol: 'udp'},
149
+ ]);
134
150
 
135
- it('returns "UDP" if getStats() returns a successful candidate pair with udp local candidate', async () => {
136
- mockMC.getStats.resolves([
137
- {
138
- type: 'candidate-pair',
139
- id: 'some candidate pair id',
140
- state: 'succeeded',
141
- localCandidateId: 'local candidate id',
142
- },
143
- {type: 'local-candidate', id: 'some other candidate id', protocol: 'tcp'},
144
- {type: 'local-candidate', id: 'local candidate id', protocol: 'udp'},
145
- ]);
146
-
147
- const connectionType = await mediaProperties.getCurrentConnectionType();
148
- assert.equal(connectionType, 'UDP');
149
- });
151
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
152
+ assert.equal(connectionType, 'UDP');
153
+ });
150
154
 
151
- it('returns "TCP" if getStats() returns a successful candidate pair with tcp local candidate', async () => {
152
- mockMC.getStats.resolves([
153
- {
154
- type: 'candidate-pair',
155
- id: 'some candidate pair id',
156
- state: 'succeeded',
157
- localCandidateId: 'some candidate id',
158
- },
159
- {type: 'local-candidate', id: 'some other candidate id', protocol: 'udp'},
160
- {type: 'local-candidate', id: 'some candidate id', protocol: 'tcp'},
161
- ]);
162
-
163
- const connectionType = await mediaProperties.getCurrentConnectionType();
164
- assert.equal(connectionType, 'TCP');
165
- });
155
+ it('returns "TCP" if getStats() returns a successful candidate pair with tcp local candidate', async () => {
156
+ mockMC.getStats.resolves([
157
+ {
158
+ type: 'candidate-pair',
159
+ id: 'some candidate pair id',
160
+ state: 'succeeded',
161
+ localCandidateId: 'some candidate id',
162
+ },
163
+ {type: 'local-candidate', id: 'some other candidate id', protocol: 'udp'},
164
+ {type: 'local-candidate', id: 'some candidate id', protocol: 'tcp'},
165
+ ]);
166
166
 
167
- [
168
- {relayProtocol: 'tls', expectedConnectionType: 'TURN-TLS'},
169
- {relayProtocol: 'tcp', expectedConnectionType: 'TURN-TCP'},
170
- {relayProtocol: 'udp', expectedConnectionType: 'TURN-UDP'},
171
- ].forEach(({relayProtocol, expectedConnectionType}) =>
172
- it(`returns "${expectedConnectionType}" if getStats() returns a successful candidate pair with a local candidate with relayProtocol=${relayProtocol}`, async () => {
167
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
168
+ assert.equal(connectionType, 'TCP');
169
+ });
170
+
171
+ [
172
+ {relayProtocol: 'tls', expectedConnectionType: 'TURN-TLS'},
173
+ {relayProtocol: 'tcp', expectedConnectionType: 'TURN-TCP'},
174
+ {relayProtocol: 'udp', expectedConnectionType: 'TURN-UDP'},
175
+ ].forEach(({relayProtocol, expectedConnectionType}) =>
176
+ it(`returns "${expectedConnectionType}" if getStats() returns a successful candidate pair with a local candidate with relayProtocol=${relayProtocol}`, async () => {
177
+ mockMC.getStats.resolves([
178
+ {
179
+ type: 'candidate-pair',
180
+ id: 'some candidate pair id',
181
+ state: 'succeeded',
182
+ localCandidateId: 'selected candidate id',
183
+ },
184
+ {
185
+ type: 'candidate-pair',
186
+ id: 'some other candidate pair id',
187
+ state: 'failed',
188
+ localCandidateId: 'some other candidate id 1',
189
+ },
190
+ {type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
191
+ {type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
192
+ {
193
+ type: 'local-candidate',
194
+ id: 'selected candidate id',
195
+ protocol: 'udp',
196
+ relayProtocol,
197
+ },
198
+ ]);
199
+
200
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
201
+ assert.equal(connectionType, expectedConnectionType);
202
+ })
203
+ );
204
+
205
+ it('returns connection type of the first successful candidate pair', async () => {
206
+ // in real life this will never happen and all active candidate pairs will have same transport,
207
+ // but here we're simulating a situation where they have different transports and just checking
208
+ // that the code still works and just returns the first one
173
209
  mockMC.getStats.resolves([
210
+ {
211
+ type: 'inbound-rtp',
212
+ id: 'whatever',
213
+ },
174
214
  {
175
215
  type: 'candidate-pair',
176
216
  id: 'some candidate pair id',
177
217
  state: 'succeeded',
178
- localCandidateId: 'selected candidate id',
218
+ localCandidateId: '1st selected candidate id',
179
219
  },
180
220
  {
181
221
  type: 'candidate-pair',
182
222
  id: 'some other candidate pair id',
183
- state: 'failed',
184
- localCandidateId: 'some other candidate id 1',
223
+ state: 'succeeded',
224
+ localCandidateId: '2nd selected candidate id',
185
225
  },
186
226
  {type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
187
227
  {type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
188
228
  {
189
229
  type: 'local-candidate',
190
- id: 'selected candidate id',
230
+ id: '1st selected candidate id',
231
+ protocol: 'udp',
232
+ relayProtocol: 'tls',
233
+ },
234
+ {
235
+ type: 'local-candidate',
236
+ id: '2nd selected candidate id',
191
237
  protocol: 'udp',
192
- relayProtocol,
238
+ relayProtocol: 'tcp',
193
239
  },
194
240
  ]);
195
241
 
196
- const connectionType = await mediaProperties.getCurrentConnectionType();
197
- assert.equal(connectionType, expectedConnectionType);
198
- })
199
- );
200
-
201
- it('returns connection type of the first successful candidate pair', async () => {
202
- // in real life this will never happen and all active candidate pairs will have same transport,
203
- // but here we're simulating a situation where they have different transports and just checking
204
- // that the code still works and just returns the first one
205
- mockMC.getStats.resolves([
206
- {
207
- type: 'inbound-rtp',
208
- id: 'whatever',
209
- },
210
- {
211
- type: 'candidate-pair',
212
- id: 'some candidate pair id',
213
- state: 'succeeded',
214
- localCandidateId: '1st selected candidate id',
215
- },
216
- {
217
- type: 'candidate-pair',
218
- id: 'some other candidate pair id',
219
- state: 'succeeded',
220
- localCandidateId: '2nd selected candidate id',
221
- },
222
- {type: 'local-candidate', id: 'some other candidate id 1', protocol: 'udp'},
223
- {type: 'local-candidate', id: 'some other candidate id 2', protocol: 'tcp'},
224
- {
225
- type: 'local-candidate',
226
- id: '1st selected candidate id',
227
- protocol: 'udp',
228
- relayProtocol: 'tls',
229
- },
230
- {
231
- type: 'local-candidate',
232
- id: '2nd selected candidate id',
233
- protocol: 'udp',
234
- relayProtocol: 'tcp',
235
- },
236
- ]);
237
-
238
- const connectionType = await mediaProperties.getCurrentConnectionType();
239
- assert.equal(connectionType, 'TURN-TLS');
242
+ const {connectionType} = await mediaProperties.getCurrentConnectionInfo();
243
+ assert.equal(connectionType, 'TURN-TLS');
244
+ });
240
245
  });
241
246
  });
242
247
  });
@@ -30,6 +30,9 @@ describe('plugin-meetings', () => {
30
30
  canStartTranscribing: null,
31
31
  canStopTranscribing: null,
32
32
  isClosedCaptionActive: null,
33
+ canStartManualCaption: null,
34
+ canStopManualCaption: null,
35
+ isManualCaptionActive: null,
33
36
  isSaveTranscriptsEnabled: null,
34
37
  isWebexAssistantActive: null,
35
38
  canViewCaptionPanel: null,
@@ -110,6 +113,9 @@ describe('plugin-meetings', () => {
110
113
  'canEnableClosedCaption',
111
114
  'canStopTranscribing',
112
115
  'isClosedCaptionActive',
116
+ 'canStartManualCaption',
117
+ 'canStopManualCaption',
118
+ 'isManualCaptionActive',
113
119
  'isSaveTranscriptsEnabled',
114
120
  'isWebexAssistantActive',
115
121
  'canViewCaptionPanel',