diff --git a/packages/@webex/media-helpers/package.json b/packages/@webex/media-helpers/package.json index aa4a09108a3..4d7f8b4219d 100644 --- a/packages/@webex/media-helpers/package.json +++ b/packages/@webex/media-helpers/package.json @@ -22,7 +22,7 @@ "deploy:npm": "yarn npm publish" }, "dependencies": { - "@webex/internal-media-core": "2.7.4", + "@webex/internal-media-core": "2.8.0", "@webex/ts-events": "^1.1.0", "@webex/web-media-effects": "2.18.0" }, diff --git a/packages/@webex/plugin-meetings/package.json b/packages/@webex/plugin-meetings/package.json index 046fff9cb5a..6d79c7fe7ce 100644 --- a/packages/@webex/plugin-meetings/package.json +++ b/packages/@webex/plugin-meetings/package.json @@ -62,7 +62,7 @@ }, "dependencies": { "@webex/common": "workspace:*", - "@webex/internal-media-core": "2.7.4", + "@webex/internal-media-core": "2.8.0", "@webex/internal-plugin-conversation": "workspace:*", "@webex/internal-plugin-device": "workspace:*", "@webex/internal-plugin-llm": "workspace:*", diff --git a/packages/@webex/plugin-meetings/src/meeting/index.ts b/packages/@webex/plugin-meetings/src/meeting/index.ts index c942fb9f0f4..78ab7948ace 100644 --- a/packages/@webex/plugin-meetings/src/meeting/index.ts +++ b/packages/@webex/plugin-meetings/src/meeting/index.ts @@ -694,6 +694,7 @@ export default class Meeting extends StatelessWebexPlugin { private joinWithMediaRetryInfo?: {isRetry: boolean; prevJoinResponse?: any}; private connectionStateHandler?: ConnectionStateHandler; private iceCandidateErrors: Map; + private iceCandidatesCount: number; /** * @param {Object} attrs @@ -1508,6 +1509,15 @@ export default class Meeting extends StatelessWebexPlugin { * @memberof Meeting */ this.iceCandidateErrors = new Map(); + + /** + * Gathered ICE Candidates count + * @instance + * @type {number} + * @private + * @memberof Meeting + */ + this.iceCandidatesCount = 0; } /** @@ -6119,6 +6129,13 @@ export default class Meeting extends StatelessWebexPlugin { this.iceCandidateErrors.set(error, count + 1); }); + + this.iceCandidatesCount = 0; + this.mediaProperties.webrtcMediaConnection.on(Event.ICE_CANDIDATE, (event) => { + if (event.candidate) { + this.iceCandidatesCount += 1; + } + }); }; /** @@ -6990,6 +7007,7 @@ export default class Meeting extends StatelessWebexPlugin { retriedWithTurnServer: this.addMediaData.retriedWithTurnServer, isJoinWithMediaRetry: this.joinWithMediaRetryInfo.isRetry, ...reachabilityStats, + iceCandidatesCount: this.iceCandidatesCount, }); // @ts-ignore this.webex.internal.newMetrics.submitClientEvent({ @@ -7045,6 +7063,7 @@ export default class Meeting extends StatelessWebexPlugin { 'unknown', ...reachabilityMetrics, ...iceCandidateErrors, + iceCandidatesCount: this.iceCandidatesCount, }); await this.cleanUpOnAddMediaFailure(); diff --git a/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js b/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js index cc872ca7c52..6d0b3a7bcca 100644 --- a/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js +++ b/packages/@webex/plugin-meetings/test/unit/spec/meeting/index.js @@ -2022,6 +2022,7 @@ describe('plugin-meetings', () => { someReachabilityMetric2: 'some value2', selectedCandidatePairChanges: 2, numTransports: 1, + iceCandidatesCount: 0, } ); }); @@ -2129,6 +2130,7 @@ describe('plugin-meetings', () => { someReachabilityMetric2: 'some value2', selectedCandidatePairChanges: 2, numTransports: 1, + iceCandidatesCount: 0, } ); }); @@ -2670,6 +2672,7 @@ describe('plugin-meetings', () => { iceConnectionState: 'unknown', selectedCandidatePairChanges: 2, numTransports: 1, + iceCandidatesCount: 0, }, ]); @@ -2858,6 +2861,7 @@ describe('plugin-meetings', () => { isMultistream: false, retriedWithTurnServer: true, isJoinWithMediaRetry: false, + iceCandidatesCount: 0, }, ]); meeting.roap.doTurnDiscovery; @@ -2986,6 +2990,8 @@ describe('plugin-meetings', () => { someReachabilityMetric2: 'some value2', }), }; + meeting.iceCandidatesCount = 3; + await meeting.addMedia({ mediaSettings: {}, }); @@ -3005,6 +3011,7 @@ describe('plugin-meetings', () => { isJoinWithMediaRetry: false, someReachabilityMetric1: 'some value1', someReachabilityMetric2: 'some value2', + iceCandidatesCount: 3, } ); @@ -3067,6 +3074,7 @@ describe('plugin-meetings', () => { iceConnectionState: 'unknown', selectedCandidatePairChanges: 2, numTransports: 1, + iceCandidatesCount: 0, } ); @@ -3126,7 +3134,8 @@ describe('plugin-meetings', () => { selectedCandidatePairChanges: 2, numTransports: 1, '701_error': 2, - '701_turn_host_lookup_received_error': 1 + '701_turn_host_lookup_received_error': 1, + iceCandidatesCount: 0, } ); @@ -7503,6 +7512,7 @@ describe('plugin-meetings', () => { assert.isFunction(eventListeners[Event.REMOTE_TRACK_ADDED]); assert.isFunction(eventListeners[Event.PEER_CONNECTION_STATE_CHANGED]); assert.isFunction(eventListeners[Event.ICE_CONNECTION_STATE_CHANGED]); + assert.isFunction(eventListeners[Event.ICE_CANDIDATE]); assert.isFunction(eventListeners[Event.ICE_CANDIDATE_ERROR]); }); @@ -7539,10 +7549,27 @@ describe('plugin-meetings', () => { }); }); - describe('should react on a ICE_CANDIDATE_ERROR event', () => { + describe('should react on a ICE_CANDIDATE event', () => { beforeEach(() => { meeting.setupMediaConnectionListeners(); + }); + + it('should collect ice candidates', () => { + eventListeners[Event.ICE_CANDIDATE]({candidate: 'candidate'}); + + assert.equal(meeting.iceCandidatesCount, 1); + }); + + it('should not collect null ice candidates', () => { + eventListeners[Event.ICE_CANDIDATE]({candidate: null}); + assert.equal(meeting.iceCandidatesCount, 0); + }); + }); + + describe('should react on a ICE_CANDIDATE_ERROR event', () => { + beforeEach(() => { + meeting.setupMediaConnectionListeners(); }); it('should not collect skipped ice candidates error', () => { diff --git a/packages/calling/package.json b/packages/calling/package.json index b8dff69d553..041dd513f63 100644 --- a/packages/calling/package.json +++ b/packages/calling/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@types/platform": "1.3.4", - "@webex/internal-media-core": "2.7.4", + "@webex/internal-media-core": "2.8.0", "@webex/media-helpers": "workspace:*", "async-mutex": "0.4.0", "buffer": "6.0.3", diff --git a/yarn.lock b/yarn.lock index a0d9dd840d5..09e9b39ff6d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7400,7 +7400,7 @@ __metadata: "@typescript-eslint/eslint-plugin": 5.38.1 "@typescript-eslint/parser": 5.38.1 "@web/dev-server": 0.4.5 - "@webex/internal-media-core": 2.7.4 + "@webex/internal-media-core": 2.8.0 "@webex/media-helpers": "workspace:*" async-mutex: 0.4.0 buffer: 6.0.3 @@ -7691,19 +7691,19 @@ __metadata: languageName: unknown linkType: soft -"@webex/internal-media-core@npm:2.7.4": - version: 2.7.4 - resolution: "@webex/internal-media-core@npm:2.7.4" +"@webex/internal-media-core@npm:2.8.0": + version: 2.8.0 + resolution: "@webex/internal-media-core@npm:2.8.0" dependencies: "@babel/runtime": ^7.18.9 "@webex/ts-sdp": 1.7.0 - "@webex/web-client-media-engine": 3.22.4 + "@webex/web-client-media-engine": 3.23.1 events: ^3.3.0 typed-emitter: ^2.1.0 uuid: ^8.3.2 webrtc-adapter: ^8.1.2 xstate: ^4.30.6 - checksum: 0610035ae8dfe3031a0d9004daa0b5f0d155743aa2eaff17c532786de544b77bb64c77a3b65964bf8ff24a1a308525c3256f22814aec73e177ccaad5bec221c9 + checksum: a27ddbd484404dc99b627879df10ff97212fddb3bf94829aa41408d719436b33d6bce824b2a33a30a5dd83eabc9c3d70cbb4fe086fc00d5c1aca5da918503e3d languageName: node linkType: hard @@ -8471,7 +8471,7 @@ __metadata: "@babel/preset-typescript": 7.22.11 "@webex/babel-config-legacy": "workspace:*" "@webex/eslint-config-legacy": "workspace:*" - "@webex/internal-media-core": 2.7.4 + "@webex/internal-media-core": 2.8.0 "@webex/jest-config-legacy": "workspace:*" "@webex/legacy-tools": "workspace:*" "@webex/test-helper-chai": "workspace:*" @@ -8707,7 +8707,7 @@ __metadata: "@webex/babel-config-legacy": "workspace:*" "@webex/common": "workspace:*" "@webex/eslint-config-legacy": "workspace:*" - "@webex/internal-media-core": 2.7.4 + "@webex/internal-media-core": 2.8.0 "@webex/internal-plugin-conversation": "workspace:*" "@webex/internal-plugin-device": "workspace:*" "@webex/internal-plugin-llm": "workspace:*" @@ -9419,9 +9419,9 @@ __metadata: languageName: node linkType: hard -"@webex/web-client-media-engine@npm:3.22.4": - version: 3.22.4 - resolution: "@webex/web-client-media-engine@npm:3.22.4" +"@webex/web-client-media-engine@npm:3.23.1": + version: 3.23.1 + resolution: "@webex/web-client-media-engine@npm:3.23.1" dependencies: "@webex/json-multistream": 2.1.3 "@webex/rtcstats": ^1.3.2 @@ -9434,7 +9434,7 @@ __metadata: js-logger: ^1.6.1 typed-emitter: ^2.1.0 uuid: ^8.3.2 - checksum: 13f24b0411cceaaef046887f6fee8e57be8e12ed07b5382a9a51eb07f56f1ec4eb02bdbb2ed567925690618862a02e831c6775019f9abe559bf7f29c1d3b5fe9 + checksum: e1a502725ac0ad588891e4ec0e73ffa5242d44fc612161a4c09d9f5f3a31734f22be28c8bf41838d3ae779e5f5689933f0b8deeb325c755499d3648d6e8035a5 languageName: node linkType: hard