@webex/plugin-meetings 3.0.0-beta.0 → 3.0.0-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.0",
3
+ "version": "3.0.0-beta.1",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -28,30 +28,30 @@
28
28
  ]
29
29
  },
30
30
  "devDependencies": {
31
- "@webex/plugin-meetings": "3.0.0-beta.0",
32
- "@webex/test-helper-chai": "3.0.0-beta.0",
33
- "@webex/test-helper-mocha": "3.0.0-beta.0",
34
- "@webex/test-helper-mock-webex": "3.0.0-beta.0",
35
- "@webex/test-helper-retry": "3.0.0-beta.0",
36
- "@webex/test-helper-test-users": "3.0.0-beta.0",
31
+ "@webex/plugin-meetings": "3.0.0-beta.1",
32
+ "@webex/test-helper-chai": "3.0.0-beta.1",
33
+ "@webex/test-helper-mocha": "3.0.0-beta.1",
34
+ "@webex/test-helper-mock-webex": "3.0.0-beta.1",
35
+ "@webex/test-helper-retry": "3.0.0-beta.1",
36
+ "@webex/test-helper-test-users": "3.0.0-beta.1",
37
37
  "chai": "^4.3.4",
38
38
  "chai-as-promised": "^7.1.1",
39
39
  "jsdom-global": "3.0.2",
40
40
  "sinon": "^9.2.4"
41
41
  },
42
42
  "dependencies": {
43
- "@webex/common": "3.0.0-beta.0",
43
+ "@webex/common": "3.0.0-beta.1",
44
44
  "@webex/internal-media-core": "^0.0.7-beta",
45
- "@webex/internal-plugin-conversation": "3.0.0-beta.0",
46
- "@webex/internal-plugin-device": "3.0.0-beta.0",
47
- "@webex/internal-plugin-mercury": "3.0.0-beta.0",
48
- "@webex/internal-plugin-metrics": "3.0.0-beta.0",
49
- "@webex/internal-plugin-support": "3.0.0-beta.0",
50
- "@webex/internal-plugin-user": "3.0.0-beta.0",
51
- "@webex/plugin-people": "3.0.0-beta.0",
52
- "@webex/plugin-rooms": "3.0.0-beta.0",
45
+ "@webex/internal-plugin-conversation": "3.0.0-beta.1",
46
+ "@webex/internal-plugin-device": "3.0.0-beta.1",
47
+ "@webex/internal-plugin-mercury": "3.0.0-beta.1",
48
+ "@webex/internal-plugin-metrics": "3.0.0-beta.1",
49
+ "@webex/internal-plugin-support": "3.0.0-beta.1",
50
+ "@webex/internal-plugin-user": "3.0.0-beta.1",
51
+ "@webex/plugin-people": "3.0.0-beta.1",
52
+ "@webex/plugin-rooms": "3.0.0-beta.1",
53
53
  "@webex/ts-sdp": "^1.0.1",
54
- "@webex/webex-core": "3.0.0-beta.0",
54
+ "@webex/webex-core": "3.0.0-beta.1",
55
55
  "bowser": "^2.11.0",
56
56
  "btoa": "^1.2.1",
57
57
  "dotenv": "^4.0.0",
@@ -36,7 +36,6 @@ import {
36
36
  _INCOMING_,
37
37
  _JOIN_,
38
38
  AUDIO,
39
- CONNECTION_STATE,
40
39
  CONTENT,
41
40
  ENDED,
42
41
  EVENT_TRIGGERS,
@@ -58,7 +57,6 @@ import {
58
57
  ONLINE,
59
58
  OFFLINE,
60
59
  PASSWORD_STATUS,
61
- PC_BAIL_TIMEOUT,
62
60
  PSTN_STATUS,
63
61
  QUALITY_LEVELS,
64
62
  RECORDING_STATE,
@@ -4256,129 +4254,110 @@ export default class Meeting extends StatelessWebexPlugin {
4256
4254
  enableRtx: this.config.enableRtx,
4257
4255
  enableExtmap: this.config.enableExtmap,
4258
4256
  setStartLocalSDPGenRemoteSDPRecvDelay: this.setStartLocalSDPGenRemoteSDPRecvDelay.bind(this)
4259
- })
4260
- .then((peerConnection) => this.getDevices().then((devices) => {
4261
- MeetingUtil.handleDeviceLogging(devices);
4257
+ }))
4258
+ .then((peerConnection) => this.getDevices().then((devices) => {
4259
+ MeetingUtil.handleDeviceLogging(devices);
4262
4260
 
4263
- return peerConnection;
4264
- }))
4265
- .then((peerConnection) => {
4266
- this.handleMediaLogging(this.mediaProperties);
4267
- LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection Received from attachMedia `);
4261
+ return peerConnection;
4262
+ }))
4263
+ .then((peerConnection) => {
4264
+ this.handleMediaLogging(this.mediaProperties);
4265
+ LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection Received from attachMedia `);
4266
+
4267
+ this.setRemoteStream(peerConnection);
4268
+ if (this.config.stats.enableStatsAnalyzer) {
4269
+ // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
4270
+ this.networkQualityMonitor = new NetworkQualityMonitor(this.config.stats);
4271
+ this.statsAnalyzer = new StatsAnalyzer(this.config.stats, this.networkQualityMonitor);
4272
+ this.setupStatsAnalyzerEventHandlers();
4273
+ this.networkQualityMonitor.on(EVENT_TRIGGERS.NETWORK_QUALITY, this.sendNetworkQualityEvent.bind(this));
4274
+ }
4275
+ })
4276
+ .catch((error) => {
4277
+ LoggerProxy.logger.error(`${LOG_HEADER} Error adding media , setting up peerconnection, `, error);
4268
4278
 
4269
- this.setRemoteStream(peerConnection);
4270
- if (this.config.stats.enableStatsAnalyzer) {
4271
- // TODO: ** Dont re create StatsAnalyzer on reconnect or rejoin
4272
- this.networkQualityMonitor = new NetworkQualityMonitor(this.config.stats);
4273
- this.statsAnalyzer = new StatsAnalyzer(this.config.stats, this.networkQualityMonitor);
4274
- this.setupStatsAnalyzerEventHandlers();
4275
- this.networkQualityMonitor.on(EVENT_TRIGGERS.NETWORK_QUALITY, this.sendNetworkQualityEvent.bind(this));
4279
+ Metrics.sendBehavioralMetric(
4280
+ BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE,
4281
+ {
4282
+ correlation_id: this.correlationId,
4283
+ locus_id: this.locusUrl.split('/').pop(),
4284
+ reason: error.message,
4285
+ stack: error.stack,
4286
+ turnDiscoverySkippedReason,
4287
+ turnServerUsed
4276
4288
  }
4277
- })
4278
- .catch((error) => {
4279
- LoggerProxy.logger.error(`${LOG_HEADER} Error adding media , setting up peerconnection, `, error);
4280
-
4281
- Metrics.sendBehavioralMetric(
4282
- BEHAVIORAL_METRICS.ADD_MEDIA_FAILURE,
4283
- {
4284
- correlation_id: this.correlationId,
4285
- locus_id: this.locusUrl.split('/').pop(),
4286
- reason: error.message,
4287
- stack: error.stack,
4288
- turnDiscoverySkippedReason,
4289
- turnServerUsed
4290
- }
4291
- );
4289
+ );
4292
4290
 
4293
- throw error;
4294
- })
4295
- .then(() => new Promise((resolve, reject) => {
4296
- let timerCount = 0;
4291
+ throw error;
4292
+ })
4293
+ .then(() => new Promise((resolve, reject) => {
4294
+ let timerCount = 0;
4297
4295
 
4298
- // eslint-disable-next-line func-names
4299
- // eslint-disable-next-line prefer-arrow-callback
4300
- if (this.type === _CALL_) {
4296
+ // eslint-disable-next-line func-names
4297
+ // eslint-disable-next-line prefer-arrow-callback
4298
+ if (this.type === _CALL_) {
4299
+ resolve();
4300
+ }
4301
+ const joiningTimer = setInterval(() => {
4302
+ timerCount += 1;
4303
+ if (this.meetingState === FULL_STATE.ACTIVE) {
4304
+ clearInterval(joiningTimer);
4301
4305
  resolve();
4302
4306
  }
4303
- const joiningTimer = setInterval(() => {
4304
- timerCount += 1;
4305
- if (this.meetingState === FULL_STATE.ACTIVE) {
4306
- clearInterval(joiningTimer);
4307
- resolve();
4308
- }
4309
4307
 
4310
- if (timerCount === 4) {
4311
- clearInterval(joiningTimer);
4312
- reject(new Error('Meeting is still not active '));
4313
- }
4314
- }, 1000);
4308
+ if (timerCount === 4) {
4309
+ clearInterval(joiningTimer);
4310
+ reject(new Error('Meeting is still not active '));
4311
+ }
4312
+ }, 1000);
4313
+ }))
4314
+ .then(() =>
4315
+ logRequest(this.roap
4316
+ .sendRoapMediaRequest({
4317
+ sdp: this.mediaProperties.peerConnection.sdp,
4318
+ roapSeq: this.roapSeq,
4319
+ meeting: this // or can pass meeting ID
4320
+ }), {
4321
+ header: `${LOG_HEADER} Send Roap Media Request.`,
4322
+ success: `${LOG_HEADER} Successfully send roap media request`,
4323
+ failure: `${LOG_HEADER} Error joining the call on send roap media request, `
4315
4324
  }))
4316
- .then(() =>
4317
- logRequest(this.roap
4318
- .sendRoapMediaRequest({
4319
- sdp: this.mediaProperties.peerConnection.sdp,
4320
- roapSeq: this.roapSeq,
4321
- meeting: this // or can pass meeting ID
4322
- }), {
4323
- header: `${LOG_HEADER} Send Roap Media Request.`,
4324
- success: `${LOG_HEADER} Successfully send roap media request`,
4325
- failure: `${LOG_HEADER} Error joining the call on send roap media request, `
4326
- }))
4327
- .then(() => {
4328
- const {peerConnection} = this.mediaProperties;
4329
-
4330
- return new Promise((resolve, reject) => {
4331
- if (peerConnection.connectionState === CONNECTION_STATE.CONNECTED) {
4332
- LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection CONNECTED`);
4333
-
4334
- resolve(peerConnection);
4335
-
4336
- return;
4337
- }
4338
- // Check if Peer Connection is STABLE (connected)
4339
- const stabilityTimeout = setTimeout(() => {
4340
- if (peerConnection.connectionState !== CONNECTION_STATE.CONNECTED) {
4341
- // TODO: Fix this after the error code pr goes in
4342
- reject(createMeetingsError(30202, 'Meeting connection failed'));
4343
- }
4344
- else {
4345
- LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection CONNECTED`);
4346
- resolve(peerConnection);
4347
- }
4348
- }, PC_BAIL_TIMEOUT);
4349
-
4350
- this.once(EVENT_TRIGGERS.MEDIA_READY, () => {
4351
- LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection CONNECTED, clearing stability timer.`);
4352
- clearTimeout(stabilityTimeout);
4353
- resolve(peerConnection);
4354
- });
4355
- });
4356
- })
4357
- .then(() => {
4358
- if (mediaSettings && mediaSettings.sendShare && localShare) {
4359
- if (this.state === MEETING_STATE.STATES.JOINED) {
4360
- return this.share();
4361
- }
4325
+ .then(
4326
+ () => this.mediaProperties.waitForIceConnectedState()
4327
+ .catch(() => {
4328
+ throw createMeetingsError(30202, 'Meeting connection failed');
4329
+ })
4330
+ )
4331
+ .then(() => {
4332
+ LoggerProxy.logger.info(`${LOG_HEADER} PeerConnection CONNECTED`);
4362
4333
 
4363
- // When the self state changes to JOINED then request the floor
4364
- this.floorGrantPending = true;
4334
+ if (mediaSettings && mediaSettings.sendShare && localShare) {
4335
+ if (this.state === MEETING_STATE.STATES.JOINED) {
4336
+ return this.share();
4365
4337
  }
4366
4338
 
4367
- Metrics.sendBehavioralMetric(
4368
- BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS,
4369
- {
4370
- correlation_id: this.correlationId,
4371
- locus_id: this.locusUrl.split('/').pop()
4372
- }
4373
- );
4339
+ // When the self state changes to JOINED then request the floor
4340
+ this.floorGrantPending = true;
4341
+ }
4374
4342
 
4375
- return Promise.resolve();
4376
- }))
4343
+ return {};
4344
+ })
4345
+ .then(() => this.mediaProperties.getCurrentConnectionType())
4346
+ .then((connectionType) => {
4347
+ Metrics.sendBehavioralMetric(
4348
+ BEHAVIORAL_METRICS.ADD_MEDIA_SUCCESS,
4349
+ {
4350
+ correlation_id: this.correlationId,
4351
+ locus_id: this.locusUrl.split('/').pop(),
4352
+ connectionType
4353
+ }
4354
+ );
4355
+ })
4377
4356
  .catch((error) => {
4378
4357
  // Clean up stats analyzer, peer connection, and turn off listeners
4379
4358
  const stopStatsAnalyzer = (this.statsAnalyzer) ? this.statsAnalyzer.stopAnalyzer() : Promise.resolve();
4380
4359
 
4381
- stopStatsAnalyzer
4360
+ return stopStatsAnalyzer
4382
4361
  .then(() => {
4383
4362
  this.statsAnalyzer = null;
4384
4363