Skip to content

Commit 8bb550b

Browse files
authored
fix(calling): remove STUN server list for windows chromium webrtc workaround (#4527)
1 parent e8d6c18 commit 8bb550b

File tree

2 files changed

+16
-18
lines changed

2 files changed

+16
-18
lines changed

packages/calling/src/CallingClient/CallingClient.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,21 @@ export class CallingClient extends Eventing<CallingClientEventTypes> implements
189189
* @ignore
190190
*/
191191
public async init() {
192-
try {
193-
await windowsChromiumIceWarmup({
194-
iceServers: [
195-
{urls: 'stun:stun01a-us.bcld.webex.com:5004'},
196-
{urls: 'stun:stun02a-us.bcld.webex.com:5004'},
197-
],
198-
timeoutMs: 1000,
199-
});
200-
log.info(`ICE warmup completed`, '' as LogContext);
201-
} catch (err) {
202-
log.warn(`ICE warmup failed: ${err}`, '' as LogContext);
192+
// Only for Windows Chromium based browsers we need to do the ICE warmup
193+
if (typeof window !== 'undefined' && window?.navigator?.userAgent) {
194+
const ua = window.navigator.userAgent;
195+
if (ua.toLowerCase().includes('windows')) {
196+
log.info('Starting ICE warmup for Windows Chromium based browser', '' as LogContext);
197+
try {
198+
await windowsChromiumIceWarmup({
199+
iceServers: [],
200+
timeoutMs: 1000,
201+
});
202+
log.info(`ICE warmup completed`, '' as LogContext);
203+
} catch (err) {
204+
log.warn(`ICE warmup failed: ${err}`, '' as LogContext);
205+
}
206+
}
203207
}
204208

205209
await this.getMobiusServers();

packages/calling/src/CallingClient/windowsChromiumIceWarmupUtils.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ function waitForIceComplete(pc: RTCPeerConnection, timeoutMs: number) {
3838
});
3939
}
4040

41-
export default async function windowsChromiumIceWarmup({
42-
iceServers = [
43-
{urls: 'stun:stun01a-us.bcld.webex.com:5004'},
44-
{urls: 'stun:stun02a-us.bcld.webex.com:5004'},
45-
],
46-
timeoutMs = 1000,
47-
}) {
41+
export default async function windowsChromiumIceWarmup({iceServers = [], timeoutMs = 1000}) {
4842
const pc1 = new RTCPeerConnection({iceServers, iceCandidatePoolSize: 1});
4943
const pc2 = new RTCPeerConnection({iceServers, iceCandidatePoolSize: 1});
5044

0 commit comments

Comments
 (0)