Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@webex/media-helpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"deploy:npm": "yarn npm publish"
},
"dependencies": {
"@webex/internal-media-core": "2.14.3",
"@webex/internal-media-core": "2.14.4",
"@webex/ts-events": "^1.1.0",
"@webex/web-media-effects": "2.19.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@webex/plugin-meetings/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"dependencies": {
"@webex/common": "workspace:*",
"@webex/event-dictionary-ts": "^1.0.1688",
"@webex/internal-media-core": "2.14.3",
"@webex/internal-media-core": "2.14.4",
"@webex/internal-plugin-conversation": "workspace:*",
"@webex/internal-plugin-device": "workspace:*",
"@webex/internal-plugin-llm": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ export default class MediaConnectionAwaiter {

this.clearCallbacks();

LoggerProxy.logger.warn('Media:MediaConnectionAwaiter#connectionStateChange --> Resolving');

this.defer.resolve();
}

Expand Down
47 changes: 34 additions & 13 deletions packages/@webex/plugin-meetings/src/media/properties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,45 @@ export default class MediaProperties {
selectedCandidatePairChanges: number;
numTransports: number;
}> {
const allStatsReports = [];

try {
const statsResult = await this.webrtcMediaConnection.getStats();
statsResult.forEach((report) => allStatsReports.push(report));
const allStatsReports = [];

await new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error('timed out'));
}, 1000);

this.webrtcMediaConnection
.getStats()
.then((statsResult) => {
clearTimeout(timeout);
statsResult.forEach((report) => allStatsReports.push(report));
resolve(allStatsReports);
})
.catch((error) => {
clearTimeout(timeout);
reject(error);
});
});

const connectionType = this.getConnectionType(allStatsReports);
const {selectedCandidatePairChanges, numTransports} = this.getTransportInfo(allStatsReports);

return {
connectionType,
selectedCandidatePairChanges,
numTransports,
};
} catch (error) {
LoggerProxy.logger.warn(
`Media:properties#getCurrentConnectionInfo --> getStats() failed: ${error}`
);
}

const connectionType = this.getConnectionType(allStatsReports);
const {selectedCandidatePairChanges, numTransports} = this.getTransportInfo(allStatsReports);

return {
connectionType,
selectedCandidatePairChanges,
numTransports,
};
return {
connectionType: 'unknown',
selectedCandidatePairChanges: -1,
numTransports: 0,
};
}
}
}
11 changes: 11 additions & 0 deletions packages/@webex/plugin-meetings/src/meeting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3431,6 +3431,10 @@ export default class Meeting extends StatelessWebexPlugin {
// The second on is if the audio is muted, we need to tell the statsAnalyzer when
// the audio is muted or the user is not willing to send media
this.locusInfo.on(LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, (status) => {
LoggerProxy.logger.info(
'Meeting:index#setUpLocusInfoSelfListener --> MEDIA_STATUS_CHANGE received, processing...'
);

if (this.statsAnalyzer) {
this.statsAnalyzer.updateMediaStatus({
actual: status,
Expand All @@ -3444,6 +3448,10 @@ export default class Meeting extends StatelessWebexPlugin {
receiveShare: this.mediaProperties.mediaDirection?.receiveShare,
},
});
} else {
LoggerProxy.logger.warn(
'Meeting:index#setUpLocusInfoSelfListener --> MEDIA_STATUS_CHANGE, statsAnalyzer is not available.'
);
}
});

Expand Down Expand Up @@ -7542,6 +7550,9 @@ export default class Meeting extends StatelessWebexPlugin {
throw error;
}
}

LoggerProxy.logger.info(`${LOG_HEADER} media connected, finalizing...`);

if (this.mediaProperties.hasLocalShareStream()) {
await this.enqueueScreenShareFloorRequest();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@ describe('MediaProperties', () => {
assert.equal(numTransports, 0);
});

it('handles time out in the case when getStats() is not resolving', async () => {
// Promise that never resolves
mockMC.getStats = new Promise(() => {});

const promise = mediaProperties.getCurrentConnectionInfo();

await clock.tickAsync(1000);

const {connectionType, selectedCandidatePairChanges, numTransports} = await promise;

assert.equal(connectionType, 'unknown');
assert.equal(selectedCandidatePairChanges, -1);
assert.equal(numTransports, 0);
});

describe('selectedCandidatePairChanges and numTransports', () => {
it('returns correct values when getStats() returns no transport stats at all', async () => {
mockMC.getStats.resolves([{type: 'something', id: '1234'}]);
Expand Down
2 changes: 1 addition & 1 deletion packages/calling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"dependencies": {
"@types/platform": "1.3.4",
"@webex/internal-media-core": "2.14.3",
"@webex/internal-media-core": "2.14.4",
"@webex/media-helpers": "workspace:*",
"async-mutex": "0.4.0",
"buffer": "6.0.3",
Expand Down
14 changes: 7 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7820,7 +7820,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.14.3
"@webex/internal-media-core": 2.14.4
"@webex/media-helpers": "workspace:*"
async-mutex: 0.4.0
buffer: 6.0.3
Expand Down Expand Up @@ -8111,9 +8111,9 @@ __metadata:
languageName: unknown
linkType: soft

"@webex/internal-media-core@npm:2.14.3":
version: 2.14.3
resolution: "@webex/internal-media-core@npm:2.14.3"
"@webex/internal-media-core@npm:2.14.4":
version: 2.14.4
resolution: "@webex/internal-media-core@npm:2.14.4"
dependencies:
"@babel/runtime": ^7.18.9
"@babel/runtime-corejs2": ^7.25.0
Expand All @@ -8126,7 +8126,7 @@ __metadata:
uuid: ^8.3.2
webrtc-adapter: ^8.1.2
xstate: ^4.30.6
checksum: 8b282cb6d56e1108f0bea5a68c637d281b791f20159dbfac50b20469b0a3562703086cc7b2e0543d986857d63565048fe767e74805c9b709229005ffddf43dbd
checksum: 94680bc2fe8f0a01e16dc97ccfd17faff51e5afbbc20426d445835dafba9c983d4935d35d124b68d7da5ae82525317256f612794bae3ecbc99fcb33ebad5da06
languageName: node
linkType: hard

Expand Down Expand Up @@ -8885,7 +8885,7 @@ __metadata:
"@babel/preset-typescript": 7.22.11
"@webex/babel-config-legacy": "workspace:*"
"@webex/eslint-config-legacy": "workspace:*"
"@webex/internal-media-core": 2.14.3
"@webex/internal-media-core": 2.14.4
"@webex/jest-config-legacy": "workspace:*"
"@webex/legacy-tools": "workspace:*"
"@webex/test-helper-chai": "workspace:*"
Expand Down Expand Up @@ -9122,7 +9122,7 @@ __metadata:
"@webex/common": "workspace:*"
"@webex/eslint-config-legacy": "workspace:*"
"@webex/event-dictionary-ts": ^1.0.1688
"@webex/internal-media-core": 2.14.3
"@webex/internal-media-core": 2.14.4
"@webex/internal-plugin-conversation": "workspace:*"
"@webex/internal-plugin-device": "workspace:*"
"@webex/internal-plugin-llm": "workspace:*"
Expand Down